org.opensaml.xml.io
Class UnmarshallerFactory

java.lang.Object
  extended by org.opensaml.xml.io.UnmarshallerFactory

public class UnmarshallerFactory
extends java.lang.Object

This thread-safe factory creates Unmarshallers that can be used to convert W3C DOM elements into XMLObjects. Unmarshallers are stored and retrieved by a QName key. This key is either the XML Schema Type or element QName of the XML element being unmarshalled.


Constructor Summary
UnmarshallerFactory()
          Constructor.
 
Method Summary
 Unmarshaller deregisterUnmarshaller(javax.xml.namespace.QName key)
          Deregisters the unmarshaller for the given element.
 Unmarshaller getUnmarshaller(org.w3c.dom.Element domElement)
          Retrieves the unmarshaller for the given element.
 Unmarshaller getUnmarshaller(javax.xml.namespace.QName key)
          Gets the Unmarshaller for a particular element or null if no unmarshaller is registered for an element.
 java.util.Map<javax.xml.namespace.QName,Unmarshaller> getUnmarshallers()
          Gets an immutable listing of all the Unarshallers currently registered.
 void registerUnmarshaller(javax.xml.namespace.QName key, Unmarshaller unmarshaller)
          Registers an Unmarshaller with this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnmarshallerFactory

public UnmarshallerFactory()
Constructor.

Method Detail

getUnmarshaller

public Unmarshaller getUnmarshaller(javax.xml.namespace.QName key)
Gets the Unmarshaller for a particular element or null if no unmarshaller is registered for an element.

Parameters:
key - the key the unmarshaller was registered under
Returns:
the Unmarshaller

getUnmarshaller

public Unmarshaller getUnmarshaller(org.w3c.dom.Element domElement)
Retrieves the unmarshaller for the given element. The schema type, if present, is tried first as the key with the element QName used if no schema type is present or does not have a unmarshaller registered under it.

Parameters:
domElement - the element to retrieve the unmarshaller for
Returns:
the unmarshaller for the XMLObject the given element can be unmarshalled into

getUnmarshallers

public java.util.Map<javax.xml.namespace.QName,Unmarshaller> getUnmarshallers()
Gets an immutable listing of all the Unarshallers currently registered.

Returns:
a listing of all the Unmarshallers currently registered

registerUnmarshaller

public void registerUnmarshaller(javax.xml.namespace.QName key,
                                 Unmarshaller unmarshaller)
Registers an Unmarshaller with this factory. If an Unmarshaller exist for the Qname given it is replaced with the given unmarshaller.

Parameters:
key - the key the unmarshaller was registered under
unmarshaller - the Unmarshaller

deregisterUnmarshaller

public Unmarshaller deregisterUnmarshaller(javax.xml.namespace.QName key)
Deregisters the unmarshaller for the given element.

Parameters:
key - the key the unmarshaller was registered under
Returns:
the Unmarshaller previously registered or null


Copyright © 2006-2012 Internet2. All Rights Reserved.