XML To Java
The XML to Java activity allows you to create an instance of a Java object based on data from an XML document. The XML schema for providing input to the Java object is created from the Java object or Java Schema specified on the Configuration tab of this activity. The specified Java class must meet the following requirements:
-
The Java class must have a public default constructor (that is, a constructor with no arguments).
-
The Java class must be serializable (that is, the class must implement or be a subclass of a class that implements
java.io.Serializable
).
For more information about description of the conversion rules, see Java Schema .
For example, the object has a method declared as
public int getID()
, but there is no method for setting the ID and the data member ID
is not public. In this case, there is an element named ID
in this activity’s input schema, but mapping a value to the element does not result in setting the ID
member of the output Java object because there is no public mechanism for setting the data.Sequenced elements and mapping of enumeration to simple type schemas is supported in the XML to Java activity.
For more information, see Sequenced Elements and Java To XML .