public final class ConnectorXmlUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
dump(Object obj)
Logs a JAXB object as an XML String Debug logging needs to be activated
|
static String |
flatten(String xml)
Removes tabs, line feeds and whitespaces between elements.
|
static String |
format(String unformattedXml)
Method to format/indent a XML string
|
static String |
format(String unformattedXml,
Source xslt)
Method to format/indent a XML String and applying an XSLT tranformation.
|
static DocumentBuilder |
getDocumentBuilder() |
static Element |
getFirstChildElement(Node node) |
static Element |
getFirstElementByTagNameNS(Element node,
String namespaceURI,
String localName) |
static String |
sanitizePartId(String contentId) |
static byte[] |
toByteArray(Node node)
Parse the node to an byte[]
|
static byte[] |
toByteArray(Object obj)
Parse the object to an byte[]
|
static Document |
toDocument(byte[] data) |
static Document |
toDocument(Object obj)
Parse the JAXB object to a
Document |
static Document |
toDocument(Source source) |
static Document |
toDocument(String xml)
|
static Element |
toElement(byte[] data)
To
Element based on a byte[] |
static <T> T |
toObject(byte[] in,
Class<T> clazz) |
static <T> T |
toObject(InputStream in,
Class<T> clazz)
Convert an InputStream to the given JAXB Element.
|
static <T> T |
toObject(String xml,
Class<T> clazz)
Convert a xml String to the given JAXB Element.
|
static String |
toString(Node node)
To string based on a
Node |
static String |
toString(Object obj)
To string based on a JAXB object
|
static String |
toString(Source source)
To string based on a
Source |
static String |
xslt(Source doc,
Source xslt)
Method to format/indent a XML and applying an XSLT tranformation.
|
public static DocumentBuilder getDocumentBuilder()
public static Element getFirstElementByTagNameNS(Element node, String namespaceURI, String localName)
public static void dump(Object obj)
obj
- the object to logpublic static byte[] toByteArray(Node node)
public static byte[] toByteArray(Object obj)
obj
- the object to parsepublic static Document toDocument(byte[] data) throws TechnicalConnectorException
data
- TechnicalConnectorException
public static Document toDocument(Source source) throws TechnicalConnectorException
TechnicalConnectorException
public static Document toDocument(String xml) throws TechnicalConnectorException
TechnicalConnectorException
public static Element toElement(byte[] data) throws TechnicalConnectorException
Element
based on a byte[]TechnicalConnectorException
public static <T> T toObject(InputStream in, Class<T> clazz)
public static <T> T toObject(byte[] in, Class<T> clazz)
public static <T> T toObject(String xml, Class<T> clazz)
public static String toString(Node node) throws TechnicalConnectorException
Node
TechnicalConnectorException
public static String toString(Source source) throws TechnicalConnectorException
Source
TechnicalConnectorException
public static String flatten(String xml)
public static String format(String unformattedXml)
unformattedXml
- public static String format(String unformattedXml, Source xslt)
unformattedXml
- xslt
- public static String xslt(Source doc, Source xslt)
Connector Packaging TRUSSMAKER 4.1.2 API
Copyright © {inceptionYear}-2022 eHealth. All Rights Reserved.