This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.xml.bind.annotation
interface DomHandler

All Known Implementing Classes:
W3CDomHandler

public interface DomHandler

Converts an element (and its descendants) from/to DOM (or similar) representation.

Implementations of this interface will be used in conjunction with {@link XmlAnyElement} annotation to map an element of XML into a representation of infoset such as W3C DOM.

Implementations hide how a portion of XML is converted into/from such DOM-like representation, allowing JAXB providers to work with arbitrary such library.

This interface is intended to be implemented by library writers and consumed by JAXB providers. None of those methods are intended to be called from applications.


Method Summary
 Result

          When a JAXB provider needs to unmarshal a part of a document into an infoset representation, it first calls this method to create a javax.xml.transform.Result object.
 Object

          Once the portion is sent to the javax.xml.transform.Result.
 Source

          This method is called when a JAXB provider needs to marshal an element to XML.
 

Method Detail

createUnmarshaller

public Result createUnmarshaller(ValidationEventHandler errorHandler)
When a JAXB provider needs to unmarshal a part of a document into an infoset representation, it first calls this method to create a {@link Result} object.

A JAXB provider will then send a portion of the XML into the given result. Such a portion always form a subtree of the whole XML document rooted at an element.

Parameters:
errorHandler - if any error happens between the invocation of this method and the invocation of {@link #getElement(Result)}, they must be reported to this handler. The caller must provide a non-null error handler. The {@link Result} object created from this method may hold a reference to this error handler.
Returns:
null if the operation fails. The error must have been reported to the error handler.

getElement

public Object getElement(Result rt)
Once the portion is sent to the {@link Result}. This method is called by a JAXB provider to obtain the unmarshalled element representation.

Multiple invocations of this method may return different objects. This method can be invoked only when the whole sub-tree are fed to the {@link Result} object.

Parameters:
rt - The {@link Result} object created by {@link #createUnmarshaller(ValidationEventHandler)}.
Returns:
null if the operation fails. The error must have been reported to the error handler.

marshal

public Source marshal(Object n,
                      ValidationEventHandler errorHandler)
This method is called when a JAXB provider needs to marshal an element to XML.

If non-null, the returned {@link Source} must contain a whole document rooted at one element, which will then be weaved into a bigger document that the JAXB provider is marshalling.

Parameters:
n
errorHandler - Receives any errors happened during the process of converting an element into a {@link Source}. The caller must provide a non-null error handler.
Returns:
null if there was an error. The error should have been reported to the handler.


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.