de.smartics.properties.spi.core.metadata
Class PropertyMetaDataParser

Package class diagram package PropertyMetaDataParser
java.lang.Object
  extended by de.smartics.properties.spi.core.metadata.PropertyMetaDataParser

public final class PropertyMetaDataParser
     
     
extends Object

Parses runtime annotations to create property metadata.


Method Summary
static PropertyMetaDataParser create(PropertiesContext context)
          Convenience constructor to generate property descriptors with access to property comments.
static PropertyMetaDataParser createWithoutContextAccess()
          Convenience constructor to generate property descriptors without comments.
 PropertyDescriptor readDescriptor(Method method)
          Reads the property descriptor information from the method.
 List<PropertyDescriptor> readDescriptors(Class<?> propertySetType)
          Reads the property descriptor information from the type.
 PropertyKey readKey(Method method)
          Reads the property key information from the method.
 String readPropertySetName(Class<?> type)
          Reads the property set name of the type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createWithoutContextAccess

public static PropertyMetaDataParser createWithoutContextAccess()
Convenience constructor to generate property descriptors without comments.

Returns:
the created parser instance.

create

public static PropertyMetaDataParser create(PropertiesContext context)
                                     throws NullPointerException
Convenience constructor to generate property descriptors with access to property comments.

Parameters:
context - the context to access comment information for properties.
Returns:
the created parser instance.
Throws:
NullPointerException - if context is null.

readDescriptors

public List<PropertyDescriptor> readDescriptors(Class<?> propertySetType)
                                         throws NullPointerException,
                                                IllegalArgumentException
Reads the property descriptor information from the type.

Parameters:
propertySetType - the type to read the property descriptor.
Returns:
the property descriptor provided by the methods of the type.
Throws:
NullPointerException - if propertySetType is null.
IllegalArgumentException - if propertySetType is not annotated with PropertySet.

readDescriptor

public PropertyDescriptor readDescriptor(Method method)
                                  throws NullPointerException
Reads the property descriptor information from the method.

Parameters:
method - the method to read the property descriptor.
Returns:
the property descriptor provided by this method.
Throws:
NullPointerException - if method is null.

readKey

public PropertyKey readKey(Method method)
Reads the property key information from the method.

Parameters:
method - the method to read the property key.
Returns:
the property key provided by this method.

readPropertySetName

public String readPropertySetName(Class<?> type)
Reads the property set name of the type.

Parameters:
type - the type to read the property set name.
Returns:
the property name as specified of defaulted.


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