public interface UnmarshallerHandler extends ContentHandler
应用程序可以使用这个接口来使用他们的API提供商在XML管道组件。例如:
上下文=送送。newInstance(“org。极致。foo”);配置配置为背景。createunmarshaller();unmarshallerhandler unmarshallerhandler = getunmarshallerhandler()配置;工厂newinstance() SPF =工厂;SPF setnamespaceaware(真正的);XmlReader XmlReader = SPF。newsaxparser()。getxmlreader();在setcontenthandler(unmarshallerhandler);XmlReader。解析(新inputsource(新FileInputStream(xml_file)));MyObject MyObject =(unmarshallerhandler getresult() MyObject);
这个界面是可重用的:即使用户没有数据的对象,她/他仍然可以开始新一轮的反。
Unmarshaller.getUnmarshallerHandler()
Modifier and Type | Method and Description |
---|---|
Object |
getResult()
得到它们分散效果。
|
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
Object getResult() throws JAXBException, IllegalStateException
IllegalStateException
这个处理器接收专件事件之前被称为。
JAXBException
-如果有任何反错误。注意,执行是允许把saxexception在分析时发现错误。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.