|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.spi.core.registry.InMemoryPropertyDescriptorRegistry
@ThreadSafe public class InMemoryPropertyDescriptorRegistry
A registry for a set of property descriptors stored in-memory.
The typical usage of this class is to fetch a PropertyDescriptor
by its (string) key.
Constructor Summary | |
---|---|
InMemoryPropertyDescriptorRegistry() Convenience constructor to start without a set of descriptor sets. |
|
InMemoryPropertyDescriptorRegistry(Class<?>... propertySetTypes) Default constructor. |
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. |
Iterator<PropertyDescriptor> |
iterator() |
String |
toString() Returns the string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InMemoryPropertyDescriptorRegistry()
public InMemoryPropertyDescriptorRegistry(Class<?>... propertySetTypes) throws DuplicatePropertyDeclarationException
propertySetTypes
- the array of property set types.
DuplicatePropertyDeclarationException
- if any of the descriptors declare the same property.
Method Detail |
---|
public final void addDescriptors(Class<?> propertySetType, List<PropertyDescriptor> descriptors) throws NullPointerException, DuplicatePropertyDeclarationsException
PropertyDescriptorRegistry
addDescriptors
in interface
PropertyDescriptorRegistry
propertySetType
- the type that declares the property
descriptors
.
descriptors
- the descriptors to the given
propertySetType
.
NullPointerException
- if
propertySetType
or
descriptors
is
null
.
DuplicatePropertyDeclarationsException
- if any of the descriptors declare the same property.
public final List<PropertyDescriptor> createMandatoryProperties()
PropertyDescriptorRegistry
Returns a copy that can be edited.
createMandatoryProperties
in interface
PropertyDescriptorRegistry
public final void addDescriptors(Class<?> propertySetType) throws DuplicatePropertyDeclarationsException
PropertyDescriptorRegistry
addDescriptors
in interface
PropertyDescriptorRegistry
propertySetType
- the property set type to add.
DuplicatePropertyDeclarationsException
- if any of the descriptors declare the same property.
public final void addDescriptors(Class<?>... propertySetTypes) throws DuplicatePropertyDeclarationsException
PropertyDescriptorRegistry
addDescriptors
in interface
PropertyDescriptorRegistry
propertySetTypes
- the array of property set types to add.
DuplicatePropertyDeclarationsException
- if any of the descriptors declare the same property.
public final void addDescriptors(Set<Class<?>> propertySetTypes) throws DuplicatePropertyDeclarationsException
PropertyDescriptorRegistry
addDescriptors
in interface
PropertyDescriptorRegistry
propertySetTypes
- the array of property set types to add.
DuplicatePropertyDeclarationsException
- if any of the descriptors declare the same property.
public final List<? extends PropertyDescriptor> get(Class<?> propertySet)
PropertyDescriptorRegistry
get
in interface
PropertyDescriptorRegistry
propertySet
- the type for descriptors to fetch.
null
.
public final PropertyDescriptor get(String key)
PropertyDescriptorRegistry
null
if no descriptor is registered for the given key.
get
in interface
PropertyDescriptorRegistry
key
- the key whose descriptor is requested.
null
.
public final PropertiesContext getContext(PropertyDescriptor descriptor) throws ConfigException
PropertyDescriptorRegistry
getContext
in interface
PropertyDescriptorRegistry
descriptor
- the descriptor whose context is requested.
ConfigException
- if the context for the descriptor cannot be found.
public final PropertiesContext getContext(Class<?> declaringType) throws ConfigException
PropertyDescriptorRegistry
getContext
in interface
PropertyDescriptorRegistry
declaringType
- the type whose context is requested.
ConfigException
- if the context for the descriptor cannot be found.
public final String getDocumentationUrl(PropertyDescriptor descriptor) throws ConfigException
PropertyDescriptorRegistry
getDocumentationUrl
in interface
PropertyDescriptorRegistry
descriptor
- the descriptor whose documentation is requested.
ConfigException
- if the descriptors context cannot be found.
public final String getMetaInfPath(PropertyDescriptor descriptor) throws ConfigException
PropertyDescriptorRegistry
getMetaInfPath
in interface
PropertyDescriptorRegistry
descriptor
- the descriptor whose context information is requested.
ConfigException
- if the descriptors context cannot be found.
public final Set<Class<?>> getPropertySetTypes()
PropertyDescriptorRegistry
getPropertySetTypes
in interface
PropertyDescriptorRegistry
public final Iterator<PropertyDescriptor> iterator()
iterator
in interface
Iterable<PropertyDescriptor>
public final String toString()
toString
in class
Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |