|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensaml.xml.util.XMLObjectHelper
public final class XMLObjectHelper
A helper class for working with XMLObjects.
| Method Summary | ||
|---|---|---|
static
|
cloneXMLObject(T originalXMLObject)
Clone an XMLObject by brute force: |
|
static
|
cloneXMLObject(T originalXMLObject,
boolean rootInNewDocument)
Clone an XMLObject by brute force: |
|
static java.lang.String |
lookupNamespacePrefix(XMLObject xmlObject,
java.lang.String namespaceURI)
Get the prefix bound to the specified namespace URI within the scope of the specified XMLObject. |
|
static java.lang.String |
lookupNamespaceURI(XMLObject xmlObject,
java.lang.String prefix)
Get the namespace URI bound to the specified prefix within the scope of the specified XMLObject. |
|
static org.w3c.dom.Element |
marshall(XMLObject xmlObject)
Marshall an XMLObject. |
|
static void |
marshallToOutputStream(XMLObject xmlObject,
java.io.OutputStream outputStream)
Marshall an XMLObject to an OutputStream. |
|
static void |
marshallToWriter(XMLObject xmlObject,
java.io.Writer writer)
Marshall an XMLObject to a Writer. |
|
static XMLObject |
unmarshallFromInputStream(ParserPool parserPool,
java.io.InputStream inputStream)
Unmarshall a Document from an InputSteam. |
|
static XMLObject |
unmarshallFromReader(ParserPool parserPool,
java.io.Reader reader)
Unmarshall a Document from a Reader. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T extends XMLObject> T cloneXMLObject(T originalXMLObject)
throws MarshallingException,
UnmarshallingException
1) Marshall the original object if necessary 2) Clone the resulting DOM Element 3) Unmarshall a new XMLObject tree around it.
This method variant is equivalent to cloneXMLObject(originalXMLObject, false).
T - the type of object being clonedoriginalXMLObject - the object to be cloned
MarshallingException - if original object can not be marshalled
UnmarshallingException - if cloned object tree can not be unmarshalled
public static <T extends XMLObject> T cloneXMLObject(T originalXMLObject,
boolean rootInNewDocument)
throws MarshallingException,
UnmarshallingException
1) Marshall the original object if necessary 2) Clone the resulting DOM Element 3) Unmarshall a new XMLObject tree around it.
T - the type of object being clonedoriginalXMLObject - the object to be clonedrootInNewDocument - if true the cloned object's cached DOM will be rooted
in a new Document; if false, the original object's underlying DOM is cloned,
but the cloned copy remains unrooted and owned by the original Document
MarshallingException - if original object can not be marshalled
UnmarshallingException - if cloned object tree can not be unmarshalled
public static XMLObject unmarshallFromInputStream(ParserPool parserPool,
java.io.InputStream inputStream)
throws XMLParserException,
UnmarshallingException
parserPool - the ParserPool instance to useinputStream - the InputStream to unmarshall
XMLParserException - if there is a problem parsing the input data
UnmarshallingException - if there is a problem unmarshalling the parsed DOM
public static XMLObject unmarshallFromReader(ParserPool parserPool,
java.io.Reader reader)
throws XMLParserException,
UnmarshallingException
parserPool - the ParserPool instance to usereader - the Reader to unmarshall
XMLParserException - if there is a problem parsing the input data
UnmarshallingException - if there is a problem unmarshalling the parsed DOM
public static org.w3c.dom.Element marshall(XMLObject xmlObject)
throws MarshallingException
XMLObject.getDOM(),
that Element will be returned. Otherwise the object will be fully marshalled and that Element returned.
xmlObject - the XMLObject to marshall
MarshallingException - if there is a problem marshalling the XMLObject
public static void marshallToOutputStream(XMLObject xmlObject,
java.io.OutputStream outputStream)
throws MarshallingException
xmlObject - the XMLObject to marshalloutputStream - the OutputStream to which to marshall
MarshallingException - if there is a problem marshalling the object
public static void marshallToWriter(XMLObject xmlObject,
java.io.Writer writer)
throws MarshallingException
xmlObject - the XMLObject to marshallwriter - the Writer to which to marshall
MarshallingException - if there is a problem marshalling the object
public static java.lang.String lookupNamespaceURI(XMLObject xmlObject,
java.lang.String prefix)
xmlObject - the XMLObject from which to searchprefix - the prefix to search
public static java.lang.String lookupNamespacePrefix(XMLObject xmlObject,
java.lang.String namespaceURI)
xmlObject - the XMLObject from which to searchnamespaceURI - the namespace URI to search
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||