Package org.gedcomx.atom
Class ExtensibleElement
- java.lang.Object
-
- org.gedcomx.atom.CommonAttributes
-
- org.gedcomx.atom.ExtensibleElement
-
- All Implemented Interfaces:
HasTransientProperties,SupportsExtensionElements
public abstract class ExtensibleElement extends CommonAttributes implements SupportsExtensionElements, HasTransientProperties
- Author:
- Ryan Heaton
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Object>transientProperties
-
Constructor Summary
Constructors Constructor Description ExtensibleElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExtensionElement(Object element)Add an extension element.<E> EfindExtensionOfType(Class<E> clazz)Finds the first extension of a specified type.<E> List<E>findExtensionsOfType(Class<E> clazz)Find the extensions of a specified type.List<Object>getExtensionElements()Custom extension elements.Map<String,Object>getTransientProperties()ObjectgetTransientProperty(String name)Get a transient (non-serialized) property.voidsetExtensionElements(List<Object> extensionElements)Custom extension elements.voidsetTransientProperty(String name, Object value)Set a transient (non-serialized) property.-
Methods inherited from class org.gedcomx.atom.CommonAttributes
getBase, getLang, setBase, setLang
-
-
-
-
Method Detail
-
getExtensionElements
public List<Object> getExtensionElements()
Custom extension elements.- Specified by:
getExtensionElementsin interfaceSupportsExtensionElements- Returns:
- Custom extension elements.
-
setExtensionElements
public void setExtensionElements(List<Object> extensionElements)
Custom extension elements.- Parameters:
extensionElements- Custom extension elements.
-
addExtensionElement
public void addExtensionElement(Object element)
Add an extension element.- Specified by:
addExtensionElementin interfaceSupportsExtensionElements- Parameters:
element- The extension element to add.
-
findExtensionOfType
public <E> E findExtensionOfType(Class<E> clazz)
Finds the first extension of a specified type.- Specified by:
findExtensionOfTypein interfaceSupportsExtensionElements- Parameters:
clazz- The type.- Returns:
- The extension, or null if none found.
-
findExtensionsOfType
public <E> List<E> findExtensionsOfType(Class<E> clazz)
Find the extensions of a specified type.- Specified by:
findExtensionsOfTypein interfaceSupportsExtensionElements- Parameters:
clazz- The type.- Returns:
- The extensions, possibly empty but not null.
-
getTransientProperties
public Map<String,Object> getTransientProperties()
- Specified by:
getTransientPropertiesin interfaceHasTransientProperties
-
getTransientProperty
public Object getTransientProperty(String name)
Get a transient (non-serialized) property.- Specified by:
getTransientPropertyin interfaceHasTransientProperties- Parameters:
name- The name of the property.- Returns:
- The property.
-
setTransientProperty
public void setTransientProperty(String name, Object value)
Set a transient (non-serialized) property.- Specified by:
setTransientPropertyin interfaceHasTransientProperties- Parameters:
name- the name of the property.value- the property value.
-
-