background image

javaType Binding Declarations

<< Class Binding Declarations | Syntax for the javaType customization >>
<< Class Binding Declarations | Syntax for the javaType customization >>
C
USTOMIZATION
O
VERVIEW
45
<baseType>
<javaType> ... </javaType>
</baseType>
·
name
defines the customization value
propertyName
; it must be a legal
Java identifier.
·
collectionType
defines the customization value
propertyCollection-
Type
, which is the collection type for the property.
propertyCollection-
Type
if specified, can be either
indexed
or any fully-qualified class name
that implements
java.util.List
.
·
fixedAttributeAsConstantProperty
defines the customization value
fixedAttributeAsConstantProperty
. The value can be either
true
,
false
,
1
, or
0
.
·
generateIsSetMethod
defines the customization value of
generateIs-
SetMethod
. The value can be either
true
,
false
,
1
, or
0
.
·
enableFailFastCheck
defines the customization value
enableFail-
FastCheck
. The value can be either
true
,
false
,
1
, or
0
. Please note that
the JAXB implementation does not support failfast validation.
·
<javadoc>
customizes the Javadoc tool annotations for the property's get-
ter method.
<javaType> Binding Declarations
The
<javaType>
declaration provides a way to customize the translation of
XML datatypes to and from Java datatypes. XML provides more datatypes than
Java, and so the
<javaType>
declaration lets you specify custom datatype bind-
ings when the default JAXB binding cannot sufficiently represent your schema.
The target Java datatype can be a Java built-in datatype or an application-specific
Java datatype. If an application-specific datatype is used as the target, your
implementation must also provide parse and print methods for unmarshalling
and marshalling data. To this end, the JAXB specification supports a
parseMethod
and
printMethod
:
· The
parseMethod
is called during unmarshalling to convert a string from
the input document into a value of the target Java datatype.
· The
printMethod
is called during marshalling to convert a value of the tar-
get type into a lexical representation.