org.gedcomx.atom
Class ExtensibleElement

java.lang.Object
  extended by org.gedcomx.atom.CommonAttributes
      extended by org.gedcomx.atom.ExtensibleElement
All Implemented Interfaces:
HasTransientProperties, SupportsExtensionElements
Direct Known Subclasses:
Entry, Feed, Person

public abstract class ExtensibleElement
extends CommonAttributes
implements SupportsExtensionElements, HasTransientProperties

Author:
Ryan Heaton

Field Summary
protected  Map<String,Object> transientProperties
           
 
Constructor Summary
ExtensibleElement()
           
 
Method Summary
 void addExtensionElement(Object element)
          Add an extension element.
<E> E
findExtensionOfType(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()
           
 Object getTransientProperty(String name)
          Get a transient (non-serialized) property.
 void setExtensionElements(List<Object> extensionElements)
          Custom extension elements.
 void setTransientProperty(String name, Object value)
          Set a transient (non-serialized) property.
 
Methods inherited from class org.gedcomx.atom.CommonAttributes
getBase, getLang, setBase, setLang
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transientProperties

protected final Map<String,Object> transientProperties
Constructor Detail

ExtensibleElement

public ExtensibleElement()
Method Detail

getExtensionElements

public List<Object> getExtensionElements()
Custom extension elements.

Specified by:
getExtensionElements in interface SupportsExtensionElements
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:
addExtensionElement in interface SupportsExtensionElements
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:
findExtensionOfType in interface SupportsExtensionElements
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:
findExtensionsOfType in interface SupportsExtensionElements
Parameters:
clazz - The type.
Returns:
The extensions, possibly empty but not null.

getTransientProperties

public Map<String,Object> getTransientProperties()
Specified by:
getTransientProperties in interface HasTransientProperties

getTransientProperty

public Object getTransientProperty(String name)
Get a transient (non-serialized) property.

Specified by:
getTransientProperty in interface HasTransientProperties
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:
setTransientProperty in interface HasTransientProperties
Parameters:
name - the name of the property.
value - the property value.


Copyright © 2016. All rights reserved.