org.biojava.bio
Class BeanAsAnnotation
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojava.bio.AbstractAnnotation
org.biojava.bio.BeanAsAnnotation
- All Implemented Interfaces:
- Serializable, Annotation, Changeable
public class BeanAsAnnotation
- extends AbstractAnnotation
Create an Annotation with properties matching those of a JavaBean instance.
Note: this class is experimental and only partialy implemented.
- Since:
- 1.3
- Author:
- Matthew Pocock
- See Also:
- Serialized Form
Method Summary |
protected Map |
getProperties()
Implement this to return the Map delegate. |
protected boolean |
propertiesAllocated()
A convenience method to see if we have allocated the properties
Map. |
BeanAsAnnotation
public BeanAsAnnotation(Object bean)
throws IntrospectionException
- Create a new BeanAsAnnotation for a bean.
- Parameters:
bean
- the JavaBean to view
- Throws:
IntrospectionException
- if the bean could not be introspected
getProperties
protected final Map getProperties()
- Description copied from class:
AbstractAnnotation
- Implement this to return the Map delegate. Modifying this return value will
modify the properties associated with this annotation.
From code in the 1.2 version of AbstractAnnotation
This is required for the implementation of an Annotation that
extends AbstractAnnotation. Where possible implementations
should be backed with a
LinkedHashMap
or similar so properties are iterated in the order
they were added.
- Specified by:
getProperties
in class AbstractAnnotation
- Returns:
- a Map containing all properties
propertiesAllocated
protected final boolean propertiesAllocated()
- Description copied from class:
AbstractAnnotation
- A convenience method to see if we have allocated the properties
Map.
This is required for the implementation of an Annotation that
extends AbstractAnnotation.
- Specified by:
propertiesAllocated
in class AbstractAnnotation
- Returns:
- true if the properties have been allocated, false otherwise