JavaTM Platform
Standard Ed. 6

javax.xml.stream.util
인터페이스 XMLEventAllocator



public interface XMLEventAllocator

이 인터페이스는, 지정된 이벤트에 XMLStreamReader 를 할당하는 방법을 사용자가 등록할 수 있도록(듯이)하기 위한 클래스를 정의합니다. XMLEventFactory 구현을 사용하기 위한 구현은 필수가 아닙니다만, 그처럼 하는 것이 추천 되고 있습니다. XMLEventAllocator 는, javax.xml.stream.allocator 프로퍼티을 사용해 XMLInputFactory 로 설정할 수 있습니다.

도입된 버젼:
1.6
관련 항목:
XMLInputFactory , XMLEventFactory

메소드의 개요
 XMLEvent allocate (XMLStreamReader  reader)
          이 메소드는, 지정된 이벤트에 XMLStreamReader 의 현재 상태를 할당합니다.
 void allocate (XMLStreamReader  reader, XMLEventConsumer  consumer)
          이 메소드는, 지정된 이벤트 또는 이벤트 세트에 XMLStreamReader 의 현재 상태를 할당해 건네받은 컨슈머(consumer)에게 그 이벤트 또는 이벤트 세트를 추가합니다.
 XMLEventAllocator newInstance ()
          이 메소드는, XMLEventAllocator 의 인스턴스를 작성합니다.
 

메소드의 상세

newInstance

XMLEventAllocator  newInstance()
이 메소드는, XMLEventAllocator 의 인스턴스를 작성합니다. 이것을 이용해, XMLInputFactory 는 리더 마다 새로운 인스턴스를 할당할 수가 있습니다.


allocate

XMLEvent  allocate(XMLStreamReader  reader)
                  throws XMLStreamException 
이 메소드는, 지정된 이벤트에 XMLStreamReader 의 현재 상태를 할당합니다. 이 XMLEventAllocator 가 리더 상태와 이벤트의 사이에 1 대 1 의 대응 관계를 가지지 않는 경우, 이 메소드는 null 를 돌려줍니다. 이 메소드가 XMLStreamReader 상태를 변경할 것은 없습니다.

파라미터:
reader - 할당원의 XMLStreamReader
반환값:
현재의 리더 상태에 대응하는 이벤트
예외:
XMLStreamException

allocate

void allocate(XMLStreamReader  reader,
              XMLEventConsumer  consumer)
              throws XMLStreamException 
이 메소드는, 지정된 이벤트 또는 이벤트 세트에 XMLStreamReader 의 현재 상태를 할당해 건네받은 컨슈머(consumer)에게 그 이벤트 또는 이벤트 세트를 추가합니다. 이 메소드를 사용해, 리더 상태를 이벤트 상태에 확장 또는 축소할 수 있습니다. 이 메소드는 XMLStreamReader 상태를 변경하는 일이 있습니다.

파라미터:
reader - 할당원의 XMLStreamReader
consumer - 추가처의 XMLEventConsumer
예외:
XMLStreamException

JavaTM Platform
Standard Ed. 6

버그의 보고와 기능의 요청
한층 더 자세한 API 레퍼런스 및 개발자 문서에 대해서는,Java SE 개발자용 문서를 참조해 주세요. 개발자전용의 상세한 해설, 개념의 개요, 용어의 정의, 버그의 회피책, 및 코드 실례가 포함되어 있습니다.

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.