Package org.gedcomx.common
Class ExtensibleData
java.lang.Object
org.gedcomx.common.ExtensibleData
- All Implemented Interfaces:
HasTransientProperties,SupportsExtensionElements
- Direct Known Subclasses:
Address,Attribution,Date,DisplayProperties,HypermediaEnabledData,NameForm,NamePart,OnlineAccount,PlaceDisplayProperties,PlaceReference
public abstract class ExtensibleData
extends Object
implements SupportsExtensionElements, HasTransientProperties
A set of data that supports extension elements.
- Author:
- Ryan Heaton
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtensionElement(Object element) Add an extension element.protected voidembed(ExtensibleData data) extensionElement(Object element) <E> EfindExtensionOfType(Class<E> clazz) Finds the first extension of a specified type.<E> EfindExtensionOfType(Class<E> clazz, String name, String namespace) Finds the first extension of a specified type in the given name and namespace.<E> List<E>findExtensionsOfType(Class<E> clazz) Find the extensions of a specified type.<E> List<E>findExtensionsOfType(Class<E> clazz, String name, String namespace) Find the extension elements of a specified type in the given name and namespace.Custom extension elements for a conclusion.getId()A local, context-specific id for the data.Get the transient properties.getTransientProperty(String name) Get a transient (non-serialized) property.Build up this object with an id.<E> List<E>removeExtensionElements(Class<E> clazz) Remove extension elements of a given type.voidsetExtensionElement(Object element) Sets an extension element by first removing all previous elements of the same type, then adding it to the list.voidsetExtensionElements(List<Object> extensionElements) Custom extension elements for a conclusion.voidA local, context-specific id for the data.voidsetTransientProperty(String name, Object value) Set a transient (non-serialized) property.toString()Provide a simple toString() method.
-
Field Details
-
extensionElements
-
transientProperties
-
-
Constructor Details
-
ExtensibleData
protected ExtensibleData() -
ExtensibleData
-
-
Method Details
-
getId
A local, context-specific id for the data.- Returns:
- A local, context-specific id for the data.
-
setId
A local, context-specific id for the data.- Parameters:
id- A local, context-specific id for the data.
-
id
Build up this object with an id.- Parameters:
id- The id.- Returns:
- this.
-
getExtensionElements
Custom extension elements for a conclusion.- Specified by:
getExtensionElementsin interfaceSupportsExtensionElements- Returns:
- Custom extension elements for a conclusion.
-
setExtensionElements
Custom extension elements for a conclusion.- Parameters:
extensionElements- Custom extension elements for a conclusion.
-
addExtensionElement
Add an extension element.- Specified by:
addExtensionElementin interfaceSupportsExtensionElements- Parameters:
element- The extension element to add.
-
extensionElement
-
removeExtensionElements
Remove extension elements of a given type.- Type Parameters:
E- The type of extension elements.- Parameters:
clazz- The type of extension element to remove.- Returns:
- The removed extension elements.
-
setExtensionElement
Sets an extension element by first removing all previous elements of the same type, then adding it to the list.- Parameters:
element- The element to set.
-
findExtensionOfType
Finds the first extension of a specified type.- Specified by:
findExtensionOfTypein interfaceSupportsExtensionElements- Type Parameters:
E- The type of extension elements.- Parameters:
clazz- The type.- Returns:
- The extension, or null if none found.
-
findExtensionsOfType
Find the extensions of a specified type.- Specified by:
findExtensionsOfTypein interfaceSupportsExtensionElements- Type Parameters:
E- The type.- Parameters:
clazz- The type.- Returns:
- The extensions, possibly empty but not null.
-
findExtensionOfType
Finds the first extension of a specified type in the given name and namespace.- Type Parameters:
E- The type of extension elements.- Parameters:
clazz- The type.name- The name of the extension element.namespace- The namespace of the extension element.- Returns:
- The extension, or null if none found.
-
findExtensionsOfType
Find the extension elements of a specified type in the given name and namespace.- Type Parameters:
E- The type of extension elements.- Parameters:
clazz- The type of the extension element.name- The name of the extension element.namespace- The namespace of the extension element.- Returns:
- The extensions, possibly empty but not null.
-
getTransientProperties
Get the transient properties.- Specified by:
getTransientPropertiesin interfaceHasTransientProperties- Returns:
- the transient properties.
-
getTransientProperty
Get a transient (non-serialized) property.- Specified by:
getTransientPropertyin interfaceHasTransientProperties- Parameters:
name- The name of the property.- Returns:
- The property.
-
setTransientProperty
Set a transient (non-serialized) property.- Specified by:
setTransientPropertyin interfaceHasTransientProperties- Parameters:
name- the name of the property.value- the property value.
-
embed
-
toString
Provide a simple toString() method.
-