10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Customizing Generated Classes and <strong>Java</strong> Program Elements<br />

498<br />

TABLE 17–6 JAXB Annotations Associated with <strong>Java</strong> Properties and Fields (Continued)<br />

Annotation Description and Default Setting<br />

@XmlMixed Marks a <strong>Java</strong>Beans multi-valued property to support mixed content. Default<br />

Settings:<br />

None<br />

@XmlMimeType Associates the MIME type that controls the XML representation of the property.<br />

Default Settings:<br />

None<br />

@XmlAttachmentRef Marks a field/property that its XML form is a URI reference to mime content.<br />

Default Settings:<br />

None<br />

@XmlInlineBinaryData Disables consideration of XOP encoding for data types that are bound to<br />

base64-encoded binary data in XML. Default Settings:<br />

None<br />

Table 17–7 summarizes the JAXB annotation that can be used with object factories.<br />

TABLE 17–7 JAXB Annotations Associated with Object Factories<br />

Annotation Description and Default Setting<br />

@XmlElementDecl Maps a factory method to an XML element. Default Settings:<br />

@XmlElementDecl (<br />

scope = GLOBAL.class,<br />

namespace = "##default",<br />

substitutionHeadNamespace = "##default",<br />

substitutionHeadName = ""<br />

)<br />

Table 17–8 summarizes JAXB annotations that can be used with adapters.<br />

TABLE 17–8 JAXB Annotations Associated with Adapters<br />

Annotation Description and Default Setting<br />

@Xml<strong>Java</strong>TypeAdapter Use the adapter that implements the @XmlAdapter annotation for custom<br />

marshalling. Default Settings:<br />

<strong>The</strong> <strong>Java</strong> <strong>EE</strong> 5<strong>Tutorial</strong> • June 2010<br />

@Xml<strong>Java</strong>TypeAdapter ( type = DEFAULT.class )

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!