Use of JCP site is subject to the
JCP Terms of Use and the
Oracle Privacy Policy
|
javax.xml.stream
|
Field Summary | |
static int |
COMMENT
Indicates an event is a comment. |
static int |
END_DTD
Indicates an event is the end of a DTD. |
static int |
ENTITY_DECLARATION
Indicates an event is a parsed entity declaration. |
static int |
NOTATION_DECLARATION
Indicates an event is a notation declaration. |
static int |
PROCESSING_INSTRUCTION
Indicates an event is a processing instruction. |
static int |
START_DTD
Indicates an event is the start of a DTD. |
static int |
UNPARSED_ENTITY_DECLARATION
Indicates an event is an unparsed entity declaration. |
Method Summary | |
void |
close()
Terminates DTD processing, skipping all DTD related events up to END_DTD . |
int |
getEventType()
Returns an integer code that indicates the type of the event at the current cursor location. |
Location |
getLocation()
Returns the current location of the processor. |
String |
getNotationName()
Returns the notation name. |
String |
getPIData()
Returns the data section of a processing instruction. |
String |
getPITarget()
Returns the target of a processing instruction. |
String |
getPublicIdentifier()
Returns the public identifier. |
String |
getQualifiedName()
Returns the qualified name. |
String |
getSystemIdentifier()
Returns the system identifier. |
String |
getText()
Returns the current value of the parse event as a string. |
char[] |
getTextCharacters()
Returns an array which contains the characters from this event. |
int |
getTextLength()
Returns the length of the sequence of characters for the current event within the text character array. |
int |
getTextStart()
Returns the offset into the text character array at which the first character of the data for the current event is located. |
boolean |
hasNext()
Returns true if there are more parsing events and
false if there are no more events. |
int |
next()
Returns next DTD parsing event. |
Field Detail |
public static final int START_DTD
getQualifiedName
returns the root element's
qualified name, and methods
getPublicIdentifier
and
getSystemIdentifier
return the document's
public and system identifiers.
public static final int END_DTD
hasNext
returns false
,
and method getEventType
returns
END_DTD
. This event marks the end of the valid
lifecycle of the DTDStreamReader instance, so any
method call other than next
, hasNext
,
getEventType
, close
,
or getLocation
on this interface will
throw java.lang.IllegalStateException.
public static final int ENTITY_DECLARATION
If
the getTextLength
method returns a negative
value, the event represents an external parsed entity:
methods getPublicIdentifier
and
getSystemIdentifier
return the
entity's public and system identifiers, and methods
getText
and getTextCharacters
return null and empty array, respectively.
If the getTextLength
method returns a positive
value, then the event represents an internal parsed entity:
methods getText
or
getTextCharacters
return the replacement
text of an internal parsed entity, and methods
getPublicIdentifier
and
getSystemIdentifier
return null.
public static final int UNPARSED_ENTITY_DECLARATION
getQualifiedName
returns the unparsed
entity name, methods getPublicIdentifier
and getSystemIdentifier
return
the public identifier and the system identifier of an unparsed entity,
and the
method getNotationName
returns the name of
the notation which identifies the format of the unparsed entity.
public static final int NOTATION_DECLARATION
getQualifiedName
returns the notation name,
the methods getPublicIdentifier
and getSystemIdentifier
return the
public identifier and the system identifier of the notation.
public static final int PROCESSING_INSTRUCTION
getPITarget
returns the processing instruction
target and the method getPIData
returns the
processing instruction data section.
public static final int COMMENT
getText
or
getTextCharacters
return the character
data of the comment, and
the methods getTextStart
and
getTextLength
return the index of the
first character
and the number of characters in the character array returned by
the getTextCharacters
method.
Method Detail |
public int next()
throws XMLStreamException
NoSuchElementException
- if this is called when
hasNext()
returns false
XMLStreamException
- if there is an error processing the
underlying DTD sourcepublic boolean hasNext()
throws XMLStreamException
true
if there are more parsing events and
false
if there are no more events. This method will return
false
if the current state of the DTDStreamReader is
END_DTD
true
if there are more events, false
otherwise
XMLStreamException
- if there is a fatal error detecting the next
statepublic int getEventType()
public String getText()
COMMENT
or the replacement
value for an ENTITY_DECLARATION
. This
method returns null
if there is no text available.
null
if there is no text available
IllegalStateException
- if this state is not a valid
text state.public char[] getTextCharacters()
IllegalStateException
- if this state is not a valid
text state.public int getTextStart()
IllegalStateException
- if this state is not a valid
text state.public int getTextLength()
-1
if there is no text available.
-1
IllegalStateException
- if this state is not a valid
text state.public Location getLocation()
Location
that returns -1
for the
location and null
for each of the publicId and systemId.
The location information is only valid until next()
is
called.
Location
objectpublic String getPITarget()
null
IllegalStateException
- if this method is not valid in
the current state.public String getPIData()
null
IllegalStateException
- if this method is not valid in
the current state.public String getQualifiedName()
IllegalStateException
- if this state is not a valid
text state.public String getPublicIdentifier()
IllegalStateException
- if this method is not valid in
the current state.public String getSystemIdentifier()
IllegalStateException
- if this method is not valid in
the current state.public String getNotationName()
IllegalStateException
- if this method is not valid in
the current state.public void close()
throws XMLStreamException
END_DTD
. This method does not close the
underlying input source.
If this method is called when current state is already
END_DTD
, this method does nothing.
Once this method has been invoked,
method hasNext()
returns false
,
method getEventType()
returns
END_DTD
and any other method call except
next()
on this interface generates an
java.lang.IllegalStateException
.
XMLStreamException
- if there is an error processing the
underlying DTD source
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
_______________________________________________________________________ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.