Java Schema
The Java Schema shared configuration resource allows you to specify a Java class that is used to configure a Java To XML or XML To Java activity.
The Java class is converted to an XML schema using the following rules:
-
Only the public data members of the Java class are mapped to XML elements. Private and protected members are not included.
-
The Java class member public variable name is mapped to an XML element with the same name. For example, a Java class member variable declared as
public int ZipCode
is mapped to an XML element namedZipCode
. -
Java Bean accessors and modifiers are mapped to appropriate XML element names. For example, a Java class method
public int getBalance()
orpublic void setBalance(int Balance)
are mapped to an XML element namedBalance
. -
Only one XML element is created regardless of how many members of the Java class share the same name. For example, there may be an attribute named
MySalary
and accessors namedgetMySalary()
andsetMySalary()
. This translates to one element namedMySalary
in the resulting XML document. -
Conversion is case-sensitive. For example, if you have a data member declared as
public int zipCode
and an accessor method declaredpublic void setZipCode(int NewZipCode)
, there are two elements in the resulting XML schema,zipCode
(for the data member) andZipCode
(for the accessor). You must make sure to use the correct element when using the resulting XML in input mappings of subsequent activities. -
All Java primitive types are supported. Datatypes that extend
java.util.Collections
are also supported (for example,List
,ArrayList
,andVectors
). Arrays (for example,int[]
andstring[]
) are also supported. -
The datatype
java.util.Map
or any types that extendjava.util.Map
are not supported. For example,HashMap
is not supported.