public final class XMLObjectHelper extends Object
| 修飾子とタイプ | メソッドと説明 |
|---|---|
static <T extends XMLObject> |
cloneXMLObject(T originalXMLObject)
Clone an XMLObject by brute force:
1) Marshall the original object if necessary
2) Clone the resulting DOM Element
3) Unmarshall a new XMLObject tree around it.
|
static <T extends XMLObject> |
cloneXMLObject(T originalXMLObject,
boolean rootInNewDocument)
Clone an XMLObject by brute force:
1) Marshall the original object if necessary
2) Clone the resulting DOM Element
3) Unmarshall a new XMLObject tree around it.
|
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.
|
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 clonedMarshallingException - if original object can not be marshalledUnmarshallingException - 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 DocumentMarshallingException - if original object can not be marshalledUnmarshallingException - 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 unmarshallXMLParserException - if there is a problem parsing the input dataUnmarshallingException - 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 unmarshallXMLParserException - if there is a problem parsing the input dataUnmarshallingException - 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 marshallMarshallingException - 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 marshallMarshallingException - 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 marshallMarshallingException - 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 searchpublic static String lookupNamespacePrefix(XMLObject xmlObject, String namespaceURI)
xmlObject - the XMLObject from which to searchnamespaceURI - the namespace URI to searchCopyright © 2012. All Rights Reserved.