de.smartics.properties.api.core.domain
Interface PropertyDescriptorRegistry

Package class diagram package PropertyDescriptorRegistry
All Superinterfaces:
Iterable< PropertyDescriptor>, Serializable
All Known Implementing Classes:
InMemoryPropertyDescriptorRegistry

public interface PropertyDescriptorRegistry
     
     
extends Serializable, Iterable< PropertyDescriptor>

A registry for a set of property descriptors.

The typical usage of this class is to fetch a PropertyDescriptor by its (string) key.


Method Summary
 void addDescriptors(Class<?>... propertySetTypes)
          Adds the given descriptors.
 void addDescriptors(Class<?> propertySetType)
          Adds the given descriptor.
 void addDescriptors(Class<?> propertySetType, List<PropertyDescriptor> descriptors)
          Adds the descriptors to the given declaring type.
 void addDescriptors(Set<Class<?>> propertySetTypes)
          Adds the given descriptors.
 List<PropertyDescriptor> createMandatoryProperties()
          Returns the list of mandatory properties.
 List<? extends PropertyDescriptor> get(Class<?> propertySet)
          Returns the descriptors for the given descriptor type.
 PropertyDescriptor get(String key)
          Returns the descriptor for the given key or null if no descriptor is registered for the given key.
 PropertiesContext getContext(Class<?> declaringType)
          Returns the property context for the given property declaring type.
 PropertiesContext getContext(PropertyDescriptor descriptor)
          Returns the property context for the given property descriptor.
 String getDocumentationUrl(PropertyDescriptor descriptor)
          Returns the URL to the documentation report for the given property descriptor.
 String getMetaInfPath(PropertyDescriptor descriptor)
          Returns the path to the context information for the given property descriptor.
 Set<Class<?>> getPropertySetTypes()
          Returns the property set types of all property descriptors that have been added.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

addDescriptors

void addDescriptors(Class<?> propertySetType,
                    List<PropertyDescriptor> descriptors)
                    throws NullPointerException,
                           DuplicatePropertyDeclarationsException
Adds the descriptors to the given declaring type.

Parameters:
propertySetType - the type that declares the property descriptors.
descriptors - the descriptors to the given propertySetType.
Throws:
NullPointerException - if propertySetType or descriptors is null.
DuplicatePropertyDeclarationsException - if any of the descriptors declare the same property.

createMandatoryProperties

List<PropertyDescriptor> createMandatoryProperties()
Returns the list of mandatory properties.

Returns a copy that can be edited.

Returns:
the list of mandatory properties.

addDescriptors

void addDescriptors(Class<?> propertySetType)
                    throws DuplicatePropertyDeclarationsException
Adds the given descriptor.

Parameters:
propertySetType - the property set type to add.
Throws:
DuplicatePropertyDeclarationsException - if any of the descriptors declare the same property.

addDescriptors

void addDescriptors(Class<?>... propertySetTypes)
                    throws DuplicatePropertyDeclarationsException
Adds the given descriptors.

Parameters:
propertySetTypes - the array of property set types to add.
Throws:
DuplicatePropertyDeclarationsException - if any of the descriptors declare the same property.

addDescriptors

void addDescriptors(Set<Class<?>> propertySetTypes)
                    throws DuplicatePropertyDeclarationsException
Adds the given descriptors.

Parameters:
propertySetTypes - the array of property set types to add.
Throws:
DuplicatePropertyDeclarationsException - if any of the descriptors declare the same property.

get

List<? extends PropertyDescriptor> get(Class<?> propertySet)
Returns the descriptors for the given descriptor type.

Parameters:
propertySet - the type for descriptors to fetch.
Returns:
the list of descriptors registered. May be the empty list, but is never null.

get

PropertyDescriptor get(String key)
Returns the descriptor for the given key or null if no descriptor is registered for the given key.

Parameters:
key - the key whose descriptor is requested.
Returns:
the descriptor to the key or null.

getContext

PropertiesContext getContext(PropertyDescriptor descriptor)
                             throws ConfigException
Returns the property context for the given property descriptor.

Parameters:
descriptor - the descriptor whose context is requested.
Returns:
the requested context.
Throws:
ConfigException - if the context for the descriptor cannot be found.

getContext

PropertiesContext getContext(Class<?> declaringType)
                             throws ConfigException
Returns the property context for the given property declaring type.

Parameters:
declaringType - the type whose context is requested.
Returns:
the requested context.
Throws:
ConfigException - if the context for the descriptor cannot be found.

getDocumentationUrl

String getDocumentationUrl(PropertyDescriptor descriptor)
                           throws ConfigException
Returns the URL to the documentation report for the given property descriptor.

Parameters:
descriptor - the descriptor whose documentation is requested.
Returns:
the URL to the documentation.
Throws:
ConfigException - if the descriptors context cannot be found.

getMetaInfPath

String getMetaInfPath(PropertyDescriptor descriptor)
                      throws ConfigException
Returns the path to the context information for the given property descriptor.

Parameters:
descriptor - the descriptor whose context information is requested.
Returns:
the URL to the context information.
Throws:
ConfigException - if the descriptors context cannot be found.

getPropertySetTypes

Set<Class<?>> getPropertySetTypes()
Returns the property set types of all property descriptors that have been added.

Returns:
the property set types of all property descriptors that have been added.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.