|
|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 | ||||||||
javax.xml.bind.annotation Class W3CDomHandler
java.lang.Objectjavax.xml.bind.annotation.W3CDomHandler
- 所有已实现的接口:
- DomHandler<Element,DOMResult>
public class W3CDomHandler
- extends Object
- implements DomHandler<Element,DOMResult>
DomHandler implementation for W3C DOM (org.w3c.dom package.)
- 从以下版本开始:
- JAXB2.0
- 作者:
- Kohsuke Kawaguchi
| 构造器摘要 | |
|---|---|
W3CDomHandler()
Default constructor. |
|
W3CDomHandler(DocumentBuilder builder)
Constructor that allows applications to specify which DOM implementation to be used. |
|
| 方法摘要 | |
|---|---|
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)
|
| 类方法继承 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造器详细信息 |
|---|
W3CDomHandler
public W3CDomHandler()
- Default constructor.
It is up to a JAXB provider to decide which DOM implementation
to use or how that is configured.
W3CDomHandler
public W3CDomHandler(DocumentBuilder builder)
- Constructor that allows applications to specify which DOM implementation
to be used.
- 参数:
builder- must not be null. JAXB uses thisDocumentBuilderto create a new element.
| 方法详细信息 |
|---|
getBuilder
public DocumentBuilder getBuilder()
setBuilder
public void setBuilder(DocumentBuilder builder)
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.
- 规范说明:
createUnmarshallerin interfaceDomHandler<Element,DOMResult>
- 参数:
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.- 返回:
- null if the operation fails. The error must have been reported to the error handler.
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. - 规范说明:
getElementin interfaceDomHandler<Element,DOMResult>
- 参数:
r- TheResultobject created byDomHandler.createUnmarshaller(ValidationEventHandler).- 返回:
- null if the operation fails. The error must have been reported to the error handler.
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. - 规范说明:
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.- 返回:
- null if there was an error. The error should have been reported to the handler.
|
|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 | ||||||||
提交错误或意见
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.
javax.xml.bind.annotation.W3CDomHandler