|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
javax.xml.bind.annotation Class W3CDomHandler
java.lang.Objectjavax.xml.bind.annotation.W3CDomHandler
- All Implemented Interfaces:
- DomHandler<Element,DOMResult>
public class W3CDomHandler
- extends Object
- implements DomHandler<Element,DOMResult>
W3C DOM(
org.w3c.dom 包)的 DomHandler 实现。
| since | JAXB2.0 |
DomHandler implementation for W3C DOM (org.w3c.dom package.)
- Since:
- JAXB2.0
- Author:
- Kohsuke Kawaguchi
| Constructor Summary | |
|---|---|
W3CDomHandler()
Default constructor. |
|
W3CDomHandler(DocumentBuilder builder)
Constructor that allows applications to specify which DOM implementation to be used. |
|
| Method Summary | |
|---|---|
DOMResult |
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 Result object. |
DocumentBuilder |
getBuilder()
|
Element |
getElement(DOMResult r)
Once the portion is sent to the Result. |
Source |
marshal(Element element,
ValidationEventHandler errorHandler)
This method is called when a JAXB provider needs to marshal an element to XML. |
void |
setBuilder(DocumentBuilder builder)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public
W3CDomHandler()
默认的构造方法。
它取决于 JAXB 提供者决定使用哪一个 DOM 实现或如何进行配置。
英文文档:
W3CDomHandler
public W3CDomHandler()
- Default constructor.
It is up to a JAXB provider to decide which DOM implementation
to use or how that is configured.
public
W3CDomHandler(javax.xml.parsers.DocumentBuilder builder)
允许应用程序指定使用哪一个 DOM 实现的构造方法。
| builder |
不得为 null。JAXB 使用此 DocumentBuilder 创建新的元素。 |
W3CDomHandler
public W3CDomHandler(DocumentBuilder builder)
- Constructor that allows applications to specify which DOM implementation
to be used.
- Parameters:
builder- must not be null. JAXB uses thisDocumentBuilderto create a new element.
| Method Detail |
|---|
public javax.xml.parsers.DocumentBuilder
getBuilder()
英文文档:
getBuilder
public DocumentBuilder getBuilder()
public void
setBuilder(javax.xml.parsers.DocumentBuilder builder)
英文文档:
setBuilder
public void setBuilder(DocumentBuilder builder)
public javax.xml.transform.dom.DOMResult
createUnmarshaller(ValidationEventHandler errorHandler)
英文文档:
createUnmarshaller
public DOMResult createUnmarshaller(ValidationEventHandler errorHandler)
- Description copied from interface:
DomHandler - When a JAXB provider needs to unmarshal a part of a document into an
infoset representation, it first calls this method to create a
Resultobject.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.
- Specified by:
createUnmarshallerin interfaceDomHandler<Element,DOMResult>
- Parameters:
errorHandler- if any error happens between the invocation of this method and the invocation ofDomHandler.getElement(Result), they must be reported to this handler. The caller must provide a non-null error handler. TheResultobject 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.
public org.w3c.dom.Element
getElement(javax.xml.transform.dom.DOMResult r)
英文文档:
getElement
public Element getElement(DOMResult r)
- Description copied from interface:
DomHandler - Once the portion is sent to the
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
Resultobject. - Specified by:
getElementin interfaceDomHandler<Element,DOMResult>
- Parameters:
r- TheResultobject created byDomHandler.createUnmarshaller(ValidationEventHandler).- Returns:
- null if the operation fails. The error must have been reported to the error handler.
public javax.xml.transform.Source
marshal(org.w3c.dom.Element element, ValidationEventHandler errorHandler)
英文文档:
marshal
public Source marshal(Element element, ValidationEventHandler errorHandler)
- Description copied from interface:
DomHandler - This method is called when a JAXB provider needs to marshal an element
to XML.
If non-null, the returned
Sourcemust contain a whole document rooted at one element, which will then be weaved into a bigger document that the JAXB provider is marshalling. - Specified by:
marshalin interfaceDomHandler<Element,DOMResult>
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.
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!
javax.xml.bind.annotation.W3CDomHandler