de.fhhannover.inform.trust.ifmapj.identifier
Interface IdentifierHandler<T extends Identifier>


public interface IdentifierHandler<T extends Identifier>

Provides generic access to marshal and unmarshal a Identifier implementation from or to Element representation.

Author:
aw

Method Summary
 T fromElement(Element el)
          Create a Identifier instance from the given Element.
 Class<T> handles()
           
 Element toElement(Identifier i, Document doc)
          Create a Element instance representing the given Identifier.
 

Method Detail

toElement

Element toElement(Identifier i,
                  Document doc)
                  throws MarshalException
Create a Element instance representing the given Identifier.

Parameters:
i - the Identifier
doc - the root Document where the element is to be added. An implementation must not add the element to the given Document.
Returns:
the Element representation of the given Identifier.
Throws:
MarshalException - If some constraints for the Identifier are not fullfilled.

fromElement

T fromElement(Element el)
                                 throws UnmarshalException
Create a Identifier instance from the given Element.

Parameters:
el - the Element instance
Returns:
an Identifier instance representation of the given Element, or null if this IdentifierHandler was not able to parse the given Element.
Throws:
UnmarshalException - If some constraint of the Identifier was not fulfilled. Note, if this handler is not responsible for the given XML, null has to be returned.

handles

Class<T> handles()
Returns:
the Class object for the Identifier implementation this implementation is able to handle.


Copyright © 2012 Trust@FHH. All Rights Reserved.