-
- All Known Implementing Classes:
- W3CDomHandler
public interface DomHandler<ElementT,ResultT extends Result>
Converts an element (and its descendants) from/to DOM (or similar) representation.Implementations of this interface will be used in conjunction with
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.
- Since:
- JAXB2.0
-
-
Method Summary
Methods Modifier and Type Method and Description ResultT
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 aResult
object.ElementT
getElement(ResultT rt)
Once the portion is sent to theResult
.Source
marshal(ElementT n, ValidationEventHandler errorHandler)
This method is called when a JAXB provider needs to marshal an element to XML.
-
-
-
Method Detail
-
createUnmarshaller
ResultT 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 aResult
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 ofgetElement(Result)
, they must be reported to this handler. The caller must provide a non-null error handler. TheResult
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
ElementT getElement(ResultT rt)
Once the portion is sent to theResult
. 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
Result
object.- Parameters:
rt
- TheResult
object created bycreateUnmarshaller(ValidationEventHandler)
.- Returns:
- null if the operation fails. The error must have been reported to the error handler.
-
marshal
Source marshal(ElementT n, ValidationEventHandler errorHandler)
This method is called when a JAXB provider needs to marshal an element to XML.If non-null, the returned
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:
errorHandler
- Receives any errors happened during the process of converting an element into aSource
. 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.
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
21/11/2024 21:58:09 Cette version de la page est en cache (à la date du 21/11/2024 21:58:09) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 11/06/2005, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/xml/bind/annotation/DomHandler.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.