|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 | |||||||||
public interface UnmarshallerHandler
SAX ContentHandler 로서 구현된 Unmarshaller.
어플리케이션은, 이 인터페이스를 사용해 그 JAXB 프로바이더를 XML 파이프라인의 컴퍼넌트로서 사용할 수 있습니다. 다음에 예를 나타냅니다.
JAXBContext context = JAXBContext.newInstance( "org.acme.foo" );
Unmarshaller unmarshaller = context.createUnmarshaller();
UnmarshallerHandler unmarshallerHandler = unmarshaller.getUnmarshallerHandler();
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setNamespaceAware( true );
XMLReader xmlReader = spf.newSAXParser(). getXMLReader();
xmlReader.setContentHandler( unmarshallerHandler );
xmlReader.parse(new InputSource( new FileInputStream( XML_FILE ) ) );
MyObject myObject= (MyObject) unmarshallerHandler.getResult();
이 인터페이스는 재사용 가능합니다. 사용자가 객체를 비정렬화할 수 없었던 경우에서도, 비정렬화의 새로운 라운드를 개시할 수가 있습니다.
Unmarshaller.getUnmarshallerHandler() | 메소드의 개요 | |
|---|---|
Object |
getResult ()
비정렬화 된 결과를 가져옵니다. |
| 인터페이스 org.xml.sax. ContentHandler 로부터 상속된 메소드 |
|---|
characters , endDocument , endElement , endPrefixMapping , ignorableWhitespace , processingInstruction , setDocumentLocator , skippedEntity , startDocument , startElement , startPrefixMapping |
| 메소드의 상세 |
|---|
Object getResult()
throws JAXBException ,
IllegalStateException
IllegalStateException - 이 핸들러가 endDocument 이벤트를 받기 전에
이 메소드가 불려 갔을 경우
JAXBException - 비정렬화 에러가 존재하는 경우.
이 구현은, 구문 분석중에 에러를 검출했을 경우, SAXException 를
throw 하는 것을 허가되고 있다
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 | |||||||||
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.