public class XMLFormatter extends java.lang.Object
Constructor and Description |
---|
XMLFormatter() |
Modifier and Type | Method and Description |
---|---|
boolean |
isOmitXMLDeclaration() |
boolean |
isThrowOnError() |
void |
setOmitXMLDeclaration(boolean omitXML) |
void |
setThrowOnError(boolean throwOnError) |
<T> T |
toObject(java.io.InputStream in,
java.lang.Class<T> cls) |
<T> T |
toObject(java.io.InputStream in,
java.lang.Class<T> objectClass,
java.lang.Class<?>... requiredClasses) |
<T> T |
toObject(org.w3c.dom.Node node,
java.lang.Class<T> cls) |
<T> T |
toObject(java.lang.String string,
java.lang.Class<T> cls) |
Response |
toResponse(java.io.InputStream in,
java.lang.Class<?> dataClass) |
java.lang.String |
toString(org.w3c.dom.Document doc) |
java.lang.String |
toString(Response r) |
<T> java.lang.String |
toString(T o) |
public XMLFormatter()
public <T> T toObject(java.lang.String string, java.lang.Class<T> cls) throws java.lang.IllegalArgumentException
string
- cls
- java.lang.IllegalArgumentException
- on bad xmlpublic <T> T toObject(java.io.InputStream in, java.lang.Class<T> cls) throws java.lang.IllegalArgumentException
in
- cls
- java.lang.IllegalArgumentException
- on bad xmlpublic <T> T toObject(java.io.InputStream in, java.lang.Class<T> objectClass, java.lang.Class<?>... requiredClasses) throws java.lang.IllegalArgumentException
in
- objectClass
- class of the object to createrequiredClasses
- additional classes required, note: objectClass is automatically added to requiredClassesjava.lang.IllegalArgumentException
- on bad xmlpublic <T> T toObject(org.w3c.dom.Node node, java.lang.Class<T> cls) throws java.lang.IllegalArgumentException
node
- cls
- java.lang.IllegalArgumentException
- on bad xmlpublic java.lang.String toString(Response r)
r
- annotated xml objectpublic <T> java.lang.String toString(T o)
o
- annotated xml objectpublic java.lang.String toString(org.w3c.dom.Document doc)
doc
- public boolean isOmitXMLDeclaration()
public void setOmitXMLDeclaration(boolean omitXML)
omitXML
- public boolean isThrowOnError()
public void setThrowOnError(boolean throwOnError)
throwOnError
- the throwOnError to setpublic Response toResponse(java.io.InputStream in, java.lang.Class<?> dataClass) throws java.lang.IllegalArgumentException
in
- dataClass
- java.lang.IllegalArgumentException
- on bad xmlCopyright © 2015 Tampere University of Technology, Pori Department.