Top Description Fields Constructors Methods
org.codehaus.stax2.ri.evt

public Class DTDEventImpl

extends BaseEventImpl
implements DTD2
Class Inheritance
All Implemented Interfaces
org.codehaus.stax2.evt.DTD2, javax.xml.stream.events.DTD, javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants
Imports
java.io.IOException, .StringWriter, .Writer, java.util.*, javax.xml.stream.*, javax.xml.stream.events.DTD, .EntityDeclaration, .NotationDeclaration, org.codehaus.stax2.XMLStreamWriter2, org.codehaus.stax2.evt.DTD2

Vanilla implementation of a DTD event. Note that as is, it is not really complete, since there is no way to access declared notations and entities, because Stax 1.0 has no method for dispatching calls. As such, it is expected that actual implementations would usually extend this class, instead of using it as is.

Field Summary

Modifier and TypeField and Description
protected final Object
protected String
mFullText

Full textual presentation of the DOCTYPE event; usually only constructed when needed, but sometimes (when using 'broken' older StAX interfaces), may be the only piece that's actually passed.

protected final String
protected final String
protected final String
protected final String
Inherited from org.codehaus.stax2.ri.evt.BaseEventImpl:
mLocation

Constructor Summary

AccessConstructor and Description
public
DTDEventImpl(Location loc, String rootName, String sysId, String pubId, String intSubset, Object dtd)

public
DTDEventImpl(Location loc, String rootName, String intSubset)

Constructor used when only partial information is available.

public
DTDEventImpl(Location loc, String fullText)

Method Summary

Modifier and TypeMethod and Description
protected String
public boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.equals.

Declared abstract to force redefinition by sub-classes
public String
getDocumentTypeDeclaration()

Implements javax.xml.stream.events.DTD.getDocumentTypeDeclaration.

Returns the entire Document Type Declaration as a string, including the internal DTD subset.
public List<EntityDeclaration>
getEntities()

Implements javax.xml.stream.events.DTD.getEntities.

Return a List containing the general entities, both external and internal, declared in the DTD.
public int
getEventType()

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.getEventType.

Implements javax.xml.stream.events.XMLEvent.getEventType.

Returns an integer code for this event.
public String
public List<NotationDeclaration>
getNotations()

Implements javax.xml.stream.events.DTD.getNotations.

Return a List containing the notations declared in the DTD.
public Object
getProcessedDTD()

Implements javax.xml.stream.events.DTD.getProcessedDTD.

Returns an implementation defined representation of the DTD.
public String
public String
public String
public int
hashCode()

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.hashCode.

Declared abstract to force redefinition by sub-classes
public void
writeAsEncodedUnicode(Writer
The writer that will output the data
w
)

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.writeAsEncodedUnicode.

Implements javax.xml.stream.events.XMLEvent.writeAsEncodedUnicode.

This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
public void
Inherited from org.codehaus.stax2.ri.evt.BaseEventImpl:
addHashasCharactersasEndElementasStartElementgetLocationgetSchemaTypeisAttributeisCharactersisEndDocumentisEndElementisEntityReferenceisNamespaceisProcessingInstructionisStartDocumentisStartElementiteratedEqualsstringsWithNullsEqualthrowFromIOEtoString

Field Detail

mDTDback to summary
protected final Object mDTD
mFullTextback to summary
protected String mFullText

Full textual presentation of the DOCTYPE event; usually only constructed when needed, but sometimes (when using 'broken' older StAX interfaces), may be the only piece that's actually passed.

mInternalSubsetback to summary
protected final String mInternalSubset
mPublicIdback to summary
protected final String mPublicId
mRootNameback to summary
protected final String mRootName
mSystemIdback to summary
protected final String mSystemId

Constructor Detail

DTDEventImplback to summary
public DTDEventImpl(Location loc, String rootName, String sysId, String pubId, String intSubset, Object dtd)
DTDEventImplback to summary
public DTDEventImpl(Location loc, String rootName, String intSubset)

Constructor used when only partial information is available.

DTDEventImplback to summary
public DTDEventImpl(Location loc, String fullText)

Method Detail

doGetDocumentTypeDeclarationback to summary
protected String doGetDocumentTypeDeclaration() throws XMLStreamException
equalsback to summary
public boolean equals(Object o)

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.equals.

Doc from org.codehaus.stax2.ri.evt.BaseEventImpl.equals.

Declared abstract to force redefinition by sub-classes

Parameters
o:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getDocumentTypeDeclarationback to summary
public String getDocumentTypeDeclaration()

Implements javax.xml.stream.events.DTD.getDocumentTypeDeclaration.

Doc from javax.xml.stream.events.DTD.getDocumentTypeDeclaration.

Returns the entire Document Type Declaration as a string, including the internal DTD subset. This may be null if there is not an internal subset. If it is not null it must return the entire Document Type Declaration which matches the doctypedecl production in the XML 1.0 specification

Returns:String

the Document Type Declaration

Annotations
@Override
getEntitiesback to summary
public List<EntityDeclaration> getEntities()

Implements javax.xml.stream.events.DTD.getEntities.

Doc from javax.xml.stream.events.DTD.getEntities.

Return a List containing the general entities, both external and internal, declared in the DTD. This list must contain EntityDeclaration events.

Returns:List<EntityDeclaration>

an unordered list of EntityDeclaration events

Annotations
@Override
getEventTypeback to summary
public int getEventType()

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.getEventType.

Implements javax.xml.stream.events.XMLEvent.getEventType.

Doc from javax.xml.stream.events.XMLEvent.getEventType.

Returns an integer code for this event.

Returns:int

the event type

Annotations
@Override
getInternalSubsetback to summary
public String getInternalSubset()

Implements org.codehaus.stax2.evt.DTD2.getInternalSubset.

Annotations
@Override
getNotationsback to summary
public List<NotationDeclaration> getNotations()

Implements javax.xml.stream.events.DTD.getNotations.

Doc from javax.xml.stream.events.DTD.getNotations.

Return a List containing the notations declared in the DTD. This list must contain NotationDeclaration events.

Returns:List<NotationDeclaration>

an unordered list of NotationDeclaration events

Annotations
@Override
getProcessedDTDback to summary
public Object getProcessedDTD()

Implements javax.xml.stream.events.DTD.getProcessedDTD.

Doc from javax.xml.stream.events.DTD.getProcessedDTD.

Returns an implementation defined representation of the DTD. This method may return null if no representation is available.

Returns:Object

the representation of the DTD

Annotations
@Override
getPublicIdback to summary
public String getPublicId()

Implements org.codehaus.stax2.evt.DTD2.getPublicId.

Annotations
@Override
getRootNameback to summary
public String getRootName()

Implements org.codehaus.stax2.evt.DTD2.getRootName.

Annotations
@Override
getSystemIdback to summary
public String getSystemId()

Implements org.codehaus.stax2.evt.DTD2.getSystemId.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.hashCode.

Doc from org.codehaus.stax2.ri.evt.BaseEventImpl.hashCode.

Declared abstract to force redefinition by sub-classes

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
writeAsEncodedUnicodeback to summary
public void writeAsEncodedUnicode(Writer w) throws XMLStreamException

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.writeAsEncodedUnicode.

Implements javax.xml.stream.events.XMLEvent.writeAsEncodedUnicode.

Doc from javax.xml.stream.events.XMLEvent.writeAsEncodedUnicode.

This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters. No indentation or whitespace should be outputted. Any user defined event type SHALL have this method called when being written to on an output stream. Built in Event types MUST implement this method, but implementations MAY choose not call these methods for optimizations reasons when writing out built in Events to an output stream. The output generated MUST be equivalent in terms of the infoset expressed.

Parameters
w:Writer

The writer that will output the data

Annotations
@Override
Exceptions
XMLStreamException:
if there is a fatal error writing the event
writeUsingback to summary
public void writeUsing(XMLStreamWriter2 w) throws XMLStreamException

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.writeUsing.

Implements org.codehaus.stax2.evt.XMLEvent2.writeUsing.

Annotations
@Override