public final class XmlExtensions extends Object
XmlExtensions.| Modifier and Type | Method and Description |
|---|---|
static InputSource |
getInputSource(String xmlString)
Gets the input source from the given xml string.
|
static <T> T |
loadObject(File xmlFile)
Load from the given file name that should represent an xml file and transform it to the
generic type object.
|
static <T> T |
loadObject(String xmlFileName)
Load from the given file name that should represent an xml file and transform it to the
generic type object.
|
static String |
newTag(String tagname,
String value,
Map<String,String> attributes)
Creates a tag from the given string values.
|
static String |
toJson(String xmlString)
Creates from the given xml string a json string.
|
static String |
toJson(String xmlString,
Map<String,Class<?>> aliases)
Creates from the given xml string a json string.
|
static <T> T |
toObjectWithXMLDecoder(String xmlString)
Creates from the given xml string an java object.
|
static <T> T |
toObjectWithXStream(String xmlString)
Creates from the given xml string an java object.
|
static <T> T |
toObjectWithXStream(String xmlString,
Map<String,Class<?>> aliases)
Creates from the given xml string an Object.
|
static <T> T |
toObjectWithXStream(com.thoughtworks.xstream.XStream xstream,
String xmlString)
Creates from the given xml string an java object.
|
static <T> T |
toObjectWithXStream(com.thoughtworks.xstream.XStream xstream,
String xmlString,
Map<String,Class<?>> aliases)
Creates from the given xml string an java object.
|
static <T> String |
toXmlWithXMLEncoder(T obj)
Creates from the given Object an xml string.
|
static <T> String |
toXmlWithXStream(T objectToXML)
Creates from the given Object an xml string.
|
static <T> String |
toXmlWithXStream(T objectToXML,
Map<String,Class<?>> aliases)
Creates from the given Object an xml string.
|
static <T> String |
toXmlWithXStream(com.thoughtworks.xstream.XStream xstream,
T objectToXML)
Creates from the given Object an xml string.
|
static <T> String |
toXmlWithXStream(com.thoughtworks.xstream.XStream xstream,
T objectToXML,
Map<String,Class<?>> aliases)
Creates from the given Object an xml string.
|
public static InputSource getInputSource(String xmlString)
xmlString - the xml as string objectpublic static <T> T loadObject(File xmlFile) throws IOException
T - the generic typexmlFile - the xml fileIOException - Signals that an I/O exception has occurred.public static <T> T loadObject(String xmlFileName)
T - the generic typexmlFileName - the xml file namepublic static String newTag(String tagname, String value, Map<String,String> attributes)
tagname - the tag namevalue - the value from the tagattributes - a map with the attributespublic static String toJson(String xmlString)
xmlString - the xml as string objectpublic static String toJson(String xmlString, Map<String,Class<?>> aliases)
xmlString - the xml as string objectaliases - the aliasespublic static <T> T toObjectWithXMLDecoder(String xmlString)
T - the generic typexmlString - the xml string to transform to an java object.public static <T> T toObjectWithXStream(String xmlString)
T - the generic type of the return typexmlString - the xml as string objectpublic static <T> T toObjectWithXStream(String xmlString, Map<String,Class<?>> aliases)
T - the generic type of the return typexmlString - the xml as string objectaliases - the aliasespublic static <T> T toObjectWithXStream(com.thoughtworks.xstream.XStream xstream,
String xmlString)
T - the generic type of the return typexstream - the xstream object.xmlString - the xml as string objectpublic static <T> T toObjectWithXStream(com.thoughtworks.xstream.XStream xstream,
String xmlString,
Map<String,Class<?>> aliases)
T - the generic type of the return typexstream - the xstream object.xmlString - the xmlaliases - the aliasespublic static <T> String toXmlWithXMLEncoder(T obj)
T - the generic type of the return typeobj - the obj to transform to an xml string.public static <T> String toXmlWithXStream(T objectToXML)
T - the generic type of the return typeobjectToXML - the object to xmlpublic static <T> String toXmlWithXStream(T objectToXML, Map<String,Class<?>> aliases)
T - the generic type of the object that will be transformed to xmlobjectToXML - the object to xmlaliases - the aliasespublic static <T> String toXmlWithXStream(com.thoughtworks.xstream.XStream xstream, T objectToXML)
T - the generic type of the object that will be transformed to xmlxstream - the xstream object.objectToXML - the object to xmlpublic static <T> String toXmlWithXStream(com.thoughtworks.xstream.XStream xstream, T objectToXML, Map<String,Class<?>> aliases)
T - the generic type of the return typexstream - the xstreamobjectToXML - the object to xmlaliases - the aliasesCopyright © 2015–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.