com.ctc.wstx.ent
Class EntityDecl

java.lang.Object
  extended by com.ctc.wstx.evt.WEvent
      extended by com.ctc.wstx.evt.WEntityDeclaration
          extended by com.ctc.wstx.ent.EntityDecl
All Implemented Interfaces:
javax.xml.stream.events.EntityDeclaration, javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants, XMLEvent2
Direct Known Subclasses:
ExtEntity, IntEntity

public abstract class EntityDecl
extends WEntityDeclaration

Abstract base class for various entity declarations DTD reader has parsed from DTD subsets.


Field Summary
protected  boolean mDeclaredExternally
          Flag that can be set to indicate that the declaration was in the external DTD subset.
 
Fields inherited from class com.ctc.wstx.evt.WEvent
mLocation
 
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
EntityDecl(javax.xml.stream.Location loc, java.lang.String name, java.net.URL ctxt)
           
 
Method Summary
abstract  WstxInputSource expand(WstxInputSource parent, javax.xml.stream.XMLResolver res, ReaderConfig cfg, int xmlVersion)
          Method called to create the new input source through which expansion value of the entity can be read.
 java.lang.String getBaseURI()
           
 javax.xml.stream.Location getLocation()
           
 java.lang.String getName()
           
abstract  java.lang.String getNotationName()
           
abstract  java.lang.String getPublicId()
           
abstract  char[] getReplacementChars()
           
abstract  java.lang.String getReplacementText()
           
abstract  int getReplacementText(java.io.Writer w)
           
 int getReplacementTextLength()
           
abstract  java.lang.String getSystemId()
           
abstract  boolean isExternal()
           
abstract  boolean isParsed()
           
 void markAsExternallyDeclared()
           
 boolean wasDeclaredExternally()
           
abstract  void writeEnc(java.io.Writer w)
           
 
Methods inherited from class com.ctc.wstx.evt.WEntityDeclaration
getEventType, writeAsEncodedUnicode, writeUsing
 
Methods inherited from class com.ctc.wstx.evt.WEvent
asCharacters, asEndElement, asStartElement, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, throwFromIOE, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.xml.stream.events.XMLEvent
asCharacters, asEndElement, asStartElement, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement
 

Field Detail

mDeclaredExternally

protected boolean mDeclaredExternally
Flag that can be set to indicate that the declaration was in the external DTD subset. Default is false.

Constructor Detail

EntityDecl

public EntityDecl(javax.xml.stream.Location loc,
                  java.lang.String name,
                  java.net.URL ctxt)
Method Detail

markAsExternallyDeclared

public void markAsExternallyDeclared()

getBaseURI

public final java.lang.String getBaseURI()
Specified by:
getBaseURI in interface javax.xml.stream.events.EntityDeclaration
Specified by:
getBaseURI in class WEntityDeclaration

getName

public final java.lang.String getName()
Specified by:
getName in interface javax.xml.stream.events.EntityDeclaration
Specified by:
getName in class WEntityDeclaration

getLocation

public final javax.xml.stream.Location getLocation()
Specified by:
getLocation in interface javax.xml.stream.events.XMLEvent
Overrides:
getLocation in class WEvent

getNotationName

public abstract java.lang.String getNotationName()
Specified by:
getNotationName in interface javax.xml.stream.events.EntityDeclaration
Specified by:
getNotationName in class WEntityDeclaration

getPublicId

public abstract java.lang.String getPublicId()
Specified by:
getPublicId in interface javax.xml.stream.events.EntityDeclaration
Specified by:
getPublicId in class WEntityDeclaration

getReplacementText

public abstract java.lang.String getReplacementText()
Specified by:
getReplacementText in interface javax.xml.stream.events.EntityDeclaration
Specified by:
getReplacementText in class WEntityDeclaration

getReplacementText

public abstract int getReplacementText(java.io.Writer w)
                                throws java.io.IOException
Throws:
java.io.IOException

getSystemId

public abstract java.lang.String getSystemId()
Specified by:
getSystemId in interface javax.xml.stream.events.EntityDeclaration
Specified by:
getSystemId in class WEntityDeclaration

wasDeclaredExternally

public boolean wasDeclaredExternally()
Returns:
True, if the declaration occured in the external DTD subset; false if not (internal subset, custom declaration)

writeEnc

public abstract void writeEnc(java.io.Writer w)
                       throws java.io.IOException
Specified by:
writeEnc in class WEntityDeclaration
Throws:
java.io.IOException

getReplacementChars

public abstract char[] getReplacementChars()

getReplacementTextLength

public final int getReplacementTextLength()

isExternal

public abstract boolean isExternal()

isParsed

public abstract boolean isParsed()

expand

public abstract WstxInputSource expand(WstxInputSource parent,
                                       javax.xml.stream.XMLResolver res,
                                       ReaderConfig cfg,
                                       int xmlVersion)
                                throws java.io.IOException,
                                       javax.xml.stream.XMLStreamException
Method called to create the new input source through which expansion value of the entity can be read.

Throws:
java.io.IOException
javax.xml.stream.XMLStreamException