|
XMLTooling-J 1.3.2-redhat-4 | |||||||||
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 String |
lookupNamespacePrefix(XMLObject xmlObject,
String namespaceURI)
Get the prefix bound to the specified namespace URI within the scope of the specified XMLObject. |
|
static String |
lookupNamespaceURI(XMLObject xmlObject,
String prefix)
Get the namespace URI bound to the specified prefix within the scope of the specified XMLObject. |
|
static Element |
marshall(XMLObject xmlObject)
Marshall an XMLObject. |
|
static void |
marshallToOutputStream(XMLObject xmlObject,
OutputStream outputStream)
Marshall an XMLObject to an OutputStream. |
|
static void |
marshallToWriter(XMLObject xmlObject,
Writer writer)
Marshall an XMLObject to a Writer. |
|
static XMLObject |
unmarshallFromInputStream(ParserPool parserPool,
InputStream inputStream)
Unmarshall a Document from an InputSteam. |
|
static XMLObject |
unmarshallFromReader(ParserPool parserPool,
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 unmarshalledpublic 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 unmarshalledpublic static XMLObject unmarshallFromInputStream(ParserPool parserPool, 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 DOMpublic static XMLObject unmarshallFromReader(ParserPool parserPool, 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 DOMpublic static 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 XMLObjectpublic static void marshallToOutputStream(XMLObject xmlObject, OutputStream outputStream) throws MarshallingException
xmlObject
- the XMLObject to marshalloutputStream
- the OutputStream to which to marshall
MarshallingException
- if there is a problem marshalling the objectpublic static void marshallToWriter(XMLObject xmlObject, Writer writer) throws MarshallingException
xmlObject
- the XMLObject to marshallwriter
- the Writer to which to marshall
MarshallingException
- if there is a problem marshalling the objectpublic static String lookupNamespaceURI(XMLObject xmlObject, String prefix)
xmlObject
- the XMLObject from which to searchprefix
- the prefix to search
public static String lookupNamespacePrefix(XMLObject xmlObject, String namespaceURI)
xmlObject
- the XMLObject from which to searchnamespaceURI
- the namespace URI to search
|
XMLTooling-J 1.3.2-redhat-4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |