Apache CXF API

org.apache.cxf.staxutils
Class AbstractDOMStreamReader<T,I>

java.lang.Object
  extended by org.apache.cxf.staxutils.AbstractDOMStreamReader<T,I>
All Implemented Interfaces:
XMLStreamConstants, XMLStreamReader
Direct Known Subclasses:
JDOMStreamReader, W3CDOMStreamReader

public abstract class AbstractDOMStreamReader<T,I>
extends Object
implements XMLStreamReader

Abstract logic for creating XMLStreamReader from DOM documents. Its works using adapters for Element, Node and Attribute (

Author:
Tomasz Sztelak
See Also:
}

Nested Class Summary
static class AbstractDOMStreamReader.ElementFrame<T,I>
           
 
Field Summary
protected  int currentEvent
           
 
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
 
Constructor Summary
AbstractDOMStreamReader(AbstractDOMStreamReader.ElementFrame<T,I> frame)
           
 
Method Summary
 void close()
           
 void consumeFrame()
           
protected  void endElement()
           
 String getCharacterEncodingScheme()
           
protected abstract  AbstractDOMStreamReader.ElementFrame<T,I> getChildFrame()
           
protected  AbstractDOMStreamReader.ElementFrame<T,I> getCurrentFrame()
           
abstract  String getElementText()
           
 int getEventType()
           
 Location getLocation()
           
abstract  String getNamespaceURI(String prefix)
           
 Object getProperty(String key)
           
 String getPublicId()
           
 String getSystemId()
           
 int getTextCharacters(int sourceStart, char[] target, int targetStart, int length)
           
 String getVersion()
           
protected abstract  boolean hasMoreChildren()
           
 boolean hasName()
           
 boolean hasNext()
           
 boolean hasText()
           
 boolean isCharacters()
           
 boolean isEndElement()
           
 boolean isStandalone()
           
 boolean isStartElement()
           
 boolean isWhiteSpace()
           
protected  void newFrame(AbstractDOMStreamReader.ElementFrame<T,I> newFrame)
           
 int next()
           
protected abstract  int nextChild()
           
 int nextTag()
           
 void require(int arg0, String arg1, String arg2)
           
 boolean standaloneSet()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.xml.stream.XMLStreamReader
getAttributeCount, getAttributeLocalName, getAttributeName, getAttributeNamespace, getAttributePrefix, getAttributeType, getAttributeValue, getAttributeValue, getEncoding, getLocalName, getName, getNamespaceContext, getNamespaceCount, getNamespacePrefix, getNamespaceURI, getNamespaceURI, getPIData, getPITarget, getPrefix, getText, getTextCharacters, getTextLength, getTextStart, isAttributeSpecified
 

Field Detail

currentEvent

protected int currentEvent
Constructor Detail

AbstractDOMStreamReader

public AbstractDOMStreamReader(AbstractDOMStreamReader.ElementFrame<T,I> frame)
Parameters:
element -
Method Detail

getCurrentFrame

protected AbstractDOMStreamReader.ElementFrame<T,I> getCurrentFrame()

getProperty

public Object getProperty(String key)
                   throws IllegalArgumentException
Specified by:
getProperty in interface XMLStreamReader
Throws:
IllegalArgumentException

next

public int next()
         throws XMLStreamException
Specified by:
next in interface XMLStreamReader
Throws:
XMLStreamException

newFrame

protected void newFrame(AbstractDOMStreamReader.ElementFrame<T,I> newFrame)

endElement

protected void endElement()

hasMoreChildren

protected abstract boolean hasMoreChildren()

nextChild

protected abstract int nextChild()

getChildFrame

protected abstract AbstractDOMStreamReader.ElementFrame<T,I> getChildFrame()

require

public void require(int arg0,
                    String arg1,
                    String arg2)
             throws XMLStreamException
Specified by:
require in interface XMLStreamReader
Throws:
XMLStreamException

getElementText

public abstract String getElementText()
                               throws XMLStreamException
Specified by:
getElementText in interface XMLStreamReader
Throws:
XMLStreamException

consumeFrame

public void consumeFrame()

nextTag

public int nextTag()
            throws XMLStreamException
Specified by:
nextTag in interface XMLStreamReader
Throws:
XMLStreamException

hasNext

public boolean hasNext()
                throws XMLStreamException
Specified by:
hasNext in interface XMLStreamReader
Throws:
XMLStreamException

close

public void close()
           throws XMLStreamException
Specified by:
close in interface XMLStreamReader
Throws:
XMLStreamException

getNamespaceURI

public abstract String getNamespaceURI(String prefix)
Specified by:
getNamespaceURI in interface XMLStreamReader

isStartElement

public boolean isStartElement()
Specified by:
isStartElement in interface XMLStreamReader

isEndElement

public boolean isEndElement()
Specified by:
isEndElement in interface XMLStreamReader

isCharacters

public boolean isCharacters()
Specified by:
isCharacters in interface XMLStreamReader

isWhiteSpace

public boolean isWhiteSpace()
Specified by:
isWhiteSpace in interface XMLStreamReader

getEventType

public int getEventType()
Specified by:
getEventType in interface XMLStreamReader

getTextCharacters

public int getTextCharacters(int sourceStart,
                             char[] target,
                             int targetStart,
                             int length)
                      throws XMLStreamException
Specified by:
getTextCharacters in interface XMLStreamReader
Throws:
XMLStreamException

hasText

public boolean hasText()
Specified by:
hasText in interface XMLStreamReader

getSystemId

public String getSystemId()

getPublicId

public String getPublicId()

getLocation

public Location getLocation()
Specified by:
getLocation in interface XMLStreamReader

hasName

public boolean hasName()
Specified by:
hasName in interface XMLStreamReader

getVersion

public String getVersion()
Specified by:
getVersion in interface XMLStreamReader

isStandalone

public boolean isStandalone()
Specified by:
isStandalone in interface XMLStreamReader

standaloneSet

public boolean standaloneSet()
Specified by:
standaloneSet in interface XMLStreamReader

getCharacterEncodingScheme

public String getCharacterEncodingScheme()
Specified by:
getCharacterEncodingScheme in interface XMLStreamReader

Apache CXF API

Apache CXF