org.codehaus.xfire.util.stax
Class DOMStreamReader

java.lang.Object
  extended by org.codehaus.xfire.util.stax.DOMStreamReader
All Implemented Interfaces:
javax.xml.stream.XMLStreamConstants, javax.xml.stream.XMLStreamReader
Direct Known Subclasses:
JDOMStreamReader, W3CDOMStreamReader

public abstract class DOMStreamReader
extends Object
implements javax.xml.stream.XMLStreamReader

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

Author:
Tomasz Sztelak

Nested Class Summary
static class DOMStreamReader.ElementFrame
           
 
Field Summary
protected  int currentEvent
           
 Map properties
           
 
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
DOMStreamReader(DOMStreamReader.ElementFrame frame)
           
 
Method Summary
 void close()
           
protected  void endElement()
           
 String getCharacterEncodingScheme()
           
protected abstract  int getChildCount()
           
protected abstract  DOMStreamReader.ElementFrame getChildFrame(int currentChild)
           
protected  DOMStreamReader.ElementFrame getCurrentFrame()
           
abstract  String getElementText()
           
 int getEventType()
           
 javax.xml.stream.Location getLocation()
           
abstract  String getNamespaceURI(String prefix)
           
 Object getProperty(String key)
           
 int getTextCharacters(int sourceStart, char[] target, int targetStart, int length)
           
 String getVersion()
           
 boolean hasName()
           
 boolean hasNext()
           
 boolean hasText()
           
 boolean isCharacters()
           
 boolean isEndElement()
           
 boolean isStandalone()
           
 boolean isStartElement()
           
 boolean isWhiteSpace()
           
protected abstract  int moveToChild(int currentChild)
           
protected  void newFrame(DOMStreamReader.ElementFrame newFrame)
           
 int next()
           
 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

properties

public Map properties

currentEvent

protected int currentEvent
Constructor Detail

DOMStreamReader

public DOMStreamReader(DOMStreamReader.ElementFrame frame)
Parameters:
element -
Method Detail

getCurrentFrame

protected DOMStreamReader.ElementFrame getCurrentFrame()

getProperty

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

next

public int next()
         throws javax.xml.stream.XMLStreamException
Specified by:
next in interface javax.xml.stream.XMLStreamReader
Throws:
javax.xml.stream.XMLStreamException

newFrame

protected void newFrame(DOMStreamReader.ElementFrame newFrame)

endElement

protected void endElement()

moveToChild

protected abstract int moveToChild(int currentChild)

getChildFrame

protected abstract DOMStreamReader.ElementFrame getChildFrame(int currentChild)

getChildCount

protected abstract int getChildCount()

require

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

getElementText

public abstract String getElementText()
                               throws javax.xml.stream.XMLStreamException
Specified by:
getElementText in interface javax.xml.stream.XMLStreamReader
Throws:
javax.xml.stream.XMLStreamException

nextTag

public int nextTag()
            throws javax.xml.stream.XMLStreamException
Specified by:
nextTag in interface javax.xml.stream.XMLStreamReader
Throws:
javax.xml.stream.XMLStreamException

hasNext

public boolean hasNext()
                throws javax.xml.stream.XMLStreamException
Specified by:
hasNext in interface javax.xml.stream.XMLStreamReader
Throws:
javax.xml.stream.XMLStreamException

close

public void close()
           throws javax.xml.stream.XMLStreamException
Specified by:
close in interface javax.xml.stream.XMLStreamReader
Throws:
javax.xml.stream.XMLStreamException

getNamespaceURI

public abstract String getNamespaceURI(String prefix)
Specified by:
getNamespaceURI in interface javax.xml.stream.XMLStreamReader

isStartElement

public boolean isStartElement()
Specified by:
isStartElement in interface javax.xml.stream.XMLStreamReader

isEndElement

public boolean isEndElement()
Specified by:
isEndElement in interface javax.xml.stream.XMLStreamReader

isCharacters

public boolean isCharacters()
Specified by:
isCharacters in interface javax.xml.stream.XMLStreamReader

isWhiteSpace

public boolean isWhiteSpace()
Specified by:
isWhiteSpace in interface javax.xml.stream.XMLStreamReader

getEventType

public int getEventType()
Specified by:
getEventType in interface javax.xml.stream.XMLStreamReader

getTextCharacters

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

hasText

public boolean hasText()
Specified by:
hasText in interface javax.xml.stream.XMLStreamReader

getLocation

public javax.xml.stream.Location getLocation()
Specified by:
getLocation in interface javax.xml.stream.XMLStreamReader

hasName

public boolean hasName()
Specified by:
hasName in interface javax.xml.stream.XMLStreamReader

getVersion

public String getVersion()
Specified by:
getVersion in interface javax.xml.stream.XMLStreamReader

isStandalone

public boolean isStandalone()
Specified by:
isStandalone in interface javax.xml.stream.XMLStreamReader

standaloneSet

public boolean standaloneSet()
Specified by:
standaloneSet in interface javax.xml.stream.XMLStreamReader

getCharacterEncodingScheme

public String getCharacterEncodingScheme()
Specified by:
getCharacterEncodingScheme in interface javax.xml.stream.XMLStreamReader


Copyright © 2004-2013. All Rights Reserved.