org.apache.tuscany.sdo.util.resource
Class RecordedEventXMLStreamReader

java.lang.Object
  extended by org.apache.tuscany.sdo.util.resource.RecordedEventXMLStreamReader
All Implemented Interfaces:
javax.xml.stream.XMLStreamConstants, javax.xml.stream.XMLStreamReader

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

This special purpose XMLStreamReader is used to produce a StAX event stream corresponding to a list of events recorded earlier. The recorded events are generated by the inner class RecordedEventXMLStreamReader.Tag, which records the events in either of 2 ways: 1) in conjunction with class SDOXMLLoadImpl, it records events corresponding to the SAX events being handled by the SDOXMLLoadImpl when loading XML using SDOXMLResourceImpl. 2) when Tag.record() is called (see class ChangeSummaryStreamDeserializer), it walks through and records the StAX events produced by another XMLStreamReader. This class is used by the SDO StAX-based ChangeSummaryType-property loader, class ChangeSummaryStreamDeserializer, which is inoked by and uses (for loading deleted object XML fragments) the SAX-based loader class XMLResourceImpl.


Nested Class Summary
protected static class RecordedEventXMLStreamReader.AttributeEvent
           
protected static class RecordedEventXMLStreamReader.NameSpaceEvent
           
protected static class RecordedEventXMLStreamReader.Reference
           
protected static class RecordedEventXMLStreamReader.StartElement
           
static class RecordedEventXMLStreamReader.Tag
           
 
Field Summary
protected  StringBuffer buffer
           
protected  int next
           
 
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
protected RecordedEventXMLStreamReader(RecordedEventXMLStreamReader.Tag tag)
           
 
Method Summary
protected  boolean areWhiteSpace()
           
protected  org.apache.tuscany.sdo.util.resource.RecordedEventXMLStreamReader.AttributeList attributes()
           
 int getAttributeCount()
           
 String getAttributeLocalName(int index)
           
 javax.xml.namespace.QName getAttributeName(int index)
           
 String getAttributeNamespace(int index)
           
 String getAttributePrefix(int index)
           
 String getAttributeType(int index)
           
 String getAttributeValue(int index)
           
 String getAttributeValue(String nameSpace, String name)
           
 String getElementText()
           
 int getEventType()
           
 String getLocalName()
           
 javax.xml.stream.Location getLocation()
           
 javax.xml.namespace.QName getName()
           
protected  org.apache.tuscany.sdo.util.resource.RecordedEventXMLStreamReader.NameSpace getNameSpace(int index)
           
 javax.xml.namespace.NamespaceContext getNamespaceContext()
           
 int getNamespaceCount()
           
 String getNamespacePrefix(int index)
           
 String getNamespaceURI()
           
 String getNamespaceURI(int index)
           
 String getNamespaceURI(String prefix)
           
 String getPIData()
           
 String getPITarget()
           
 String getPrefix()
           
 String getText()
           
 char[] getTextCharacters()
           
 int getTextCharacters(int sourceStart, char[] target, int targetStart, int length)
           
 int getTextLength()
           
 int getTextStart()
           
 boolean hasName()
           
 boolean hasNext()
           
 boolean hasText()
           
 boolean isAttributeSpecified(int index)
           
 boolean isCharacters()
           
 boolean isEndElement()
           
 boolean isStartElement()
           
 boolean isWhiteSpace()
           
 int next()
           
 int nextTag()
           
protected static String prefix(String qName, String nameSpace)
           
 void require(int type, String nameSpace, String name)
           
protected  void throwXMLStreamException(String message)
           
 
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
close, getCharacterEncodingScheme, getEncoding, getProperty, getVersion, isStandalone, standaloneSet
 

Field Detail

buffer

protected StringBuffer buffer

next

protected int next
Constructor Detail

RecordedEventXMLStreamReader

protected RecordedEventXMLStreamReader(RecordedEventXMLStreamReader.Tag tag)
Method Detail

prefix

protected static String prefix(String qName,
                               String nameSpace)

getAttributeCount

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

attributes

protected final org.apache.tuscany.sdo.util.resource.RecordedEventXMLStreamReader.AttributeList attributes()

getAttributeLocalName

public String getAttributeLocalName(int index)
Specified by:
getAttributeLocalName in interface javax.xml.stream.XMLStreamReader

getAttributeName

public javax.xml.namespace.QName getAttributeName(int index)
Specified by:
getAttributeName in interface javax.xml.stream.XMLStreamReader

getAttributeNamespace

public String getAttributeNamespace(int index)
Specified by:
getAttributeNamespace in interface javax.xml.stream.XMLStreamReader

getAttributePrefix

public String getAttributePrefix(int index)
Specified by:
getAttributePrefix in interface javax.xml.stream.XMLStreamReader

getAttributeType

public String getAttributeType(int index)
Specified by:
getAttributeType in interface javax.xml.stream.XMLStreamReader

getAttributeValue

public String getAttributeValue(int index)
Specified by:
getAttributeValue in interface javax.xml.stream.XMLStreamReader

isAttributeSpecified

public boolean isAttributeSpecified(int index)
Specified by:
isAttributeSpecified in interface javax.xml.stream.XMLStreamReader

getAttributeValue

public String getAttributeValue(String nameSpace,
                                String name)
Specified by:
getAttributeValue in interface javax.xml.stream.XMLStreamReader

getElementText

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

getEventType

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

getLocalName

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

getLocation

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

getName

public javax.xml.namespace.QName getName()
Specified by:
getName in interface javax.xml.stream.XMLStreamReader

getNamespaceContext

public final javax.xml.namespace.NamespaceContext getNamespaceContext()
Specified by:
getNamespaceContext in interface javax.xml.stream.XMLStreamReader

getNamespaceCount

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

getNameSpace

protected final org.apache.tuscany.sdo.util.resource.RecordedEventXMLStreamReader.NameSpace getNameSpace(int index)

getNamespacePrefix

public String getNamespacePrefix(int index)
Specified by:
getNamespacePrefix in interface javax.xml.stream.XMLStreamReader

getNamespaceURI

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

getNamespaceURI

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

getNamespaceURI

public String getNamespaceURI(int index)
Specified by:
getNamespaceURI in interface javax.xml.stream.XMLStreamReader

getPIData

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

getPITarget

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

getPrefix

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

getText

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

getTextCharacters

public final char[] getTextCharacters()
Specified by:
getTextCharacters in interface javax.xml.stream.XMLStreamReader

getTextCharacters

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

getTextLength

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

getTextStart

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

hasName

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

hasNext

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

hasText

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

isCharacters

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

isEndElement

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

isStartElement

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

areWhiteSpace

protected final boolean areWhiteSpace()

isWhiteSpace

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

next

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

throwXMLStreamException

protected final void throwXMLStreamException(String message)
                                      throws javax.xml.stream.XMLStreamException
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

require

public void require(int type,
                    String nameSpace,
                    String name)
             throws javax.xml.stream.XMLStreamException
Specified by:
require in interface javax.xml.stream.XMLStreamReader
Throws:
javax.xml.stream.XMLStreamException


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.