Class XmlMarshallerUtil
java.lang.Object
net.officefloor.plugin.xml.marshall.tree.XmlMarshallerUtil
Provides utility methods to write XML.
- Author:
- Daniel Sagenschneider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static ObjectgetReturnValue(Object source, Method getMethod) Obtains the return value from the input method on the source object.protected static Class<?>obtainClass(String className) Obtains theClassfrom its class name.protected static MethodobtainMethod(Class object, String methodName) Obtains the Method by its name from the input class.static StringtransformValueForXml(String value) Transforms the input value for XML.protected static voidWrites the xml to the output.
-
Constructor Details
-
XmlMarshallerUtil
public XmlMarshallerUtil()
-
-
Method Details
-
writeXml
Writes the xml to the output.- Parameters:
xmlSnippet- XML snippet to write.output- Output to send XML snippet.- Throws:
XmlMarshallException- If fails to write XML.
-
transformValueForXml
Transforms the input value for XML.- Parameters:
value- Value to transformed.- Returns:
- Value transformed to be utilised in XML.
-
obtainClass
Obtains theClassfrom its class name.- Parameters:
className- Name of the class.- Returns:
Classby the input class name.- Throws:
XmlMarshallException- If fails to obtain theClass.
-
obtainMethod
Obtains the Method by its name from the input class.- Parameters:
object- Class of the object to obtain the method.methodName- Name of the method to obtain.- Returns:
- Method on the input class by the name.
- Throws:
XmlMarshallException- If unable to obtain method.
-
getReturnValue
Obtains the return value from the input method on the source object.- Parameters:
source- Object to source the return value.getMethod- Method to utilise to obtain the value.- Returns:
- Return value of method on source object.
- Throws:
XmlMarshallException- If fails to obtain the return value.
-