|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.xml.scanner.AbstractScanner | +--org.apache.batik.xml.scanner.DocumentScanner
This class represents a low-level lexical scanner for XML documents. It scans the input and returns raw tokens, without entity or character references management.
Field Summary | |
static int |
ATTLIST_CONTEXT
The ATTLIST context. |
static int |
CDATA_SECTION_CONTEXT
The CDATA section context. |
protected boolean |
cdataEndRead
A CDATA section end is the next token |
static int |
CONTENT_CONTEXT
The content context. |
protected int |
context
The current scanning context. |
protected int |
depth
The depth in the xml tree. |
static int |
DOCTYPE_CONTEXT
The doctype context. |
static int |
DOCUMENT_START_CONTEXT
The document start context. |
static int |
DQUOTED_ATTRIBUTE_CONTEXT
The double quoted attribute context. |
static int |
DQUOTED_ENTITY_VALUE_CONTEXT
The double quoted entity value context. |
static int |
DTD_DECLARATIONS_CONTEXT
The DTD declarations context. |
static int |
ELEMENT_DECLARATION_CONTEXT
The element declaration context. |
static int |
END_TAG_CONTEXT
The end tag context. |
static int |
ENTITY_CONTEXT
The entity context. |
static int |
ENUMERATION_CONTEXT
The enumeration context. |
protected boolean |
inDTD
The scanner is in the internal DTD. |
static int |
NOTATION_CONTEXT
The notation context. |
static int |
NOTATION_TYPE_CONTEXT
The notation type context. |
static int |
PI_CONTEXT
The processing instruction context. |
protected boolean |
piEndRead
A PI end has been previously read. |
static int |
SQUOTED_ATTRIBUTE_CONTEXT
The single quoted attribute context. |
static int |
SQUOTED_ENTITY_VALUE_CONTEXT
The single quoted entity value context. |
static int |
START_TAG_CONTEXT
The start tag context. |
protected char |
stringDelimiter
The last attribute delimiter encountered. |
static int |
TOP_LEVEL_CONTEXT
The top level context. |
static int |
XML_DECL_CONTEXT
The XML declaration context. |
Fields inherited from class org.apache.batik.xml.scanner.AbstractScanner |
buffer, BUNDLE_CLASSNAME, inputBuffer, lastFragment, localizableSupport, type, value |
Constructor Summary | |
DocumentScanner(java.io.Reader r)
Creates a new DocumentScanner object. |
Method Summary | |
char[] |
currentValue()
Returns the current lexical unit value. |
int |
getContext()
Returns the current context. |
int |
getDepth()
Returns the current depth in the XML tree. |
char |
getStringDelimiter()
Returns the last attribute delimiter encountered. |
int |
next()
Advances to the next lexical unit. |
int |
next(int context)
Advances to the next lexical unit. |
protected int |
nextInAttList()
Returns the next lexical unit in the context of an attribute list. |
protected int |
nextInAttributeValue(char sd)
Returns the next lexical unit in the context of an attribute value. |
protected int |
nextInCDATASection()
Returns the next lexical unit in the context of a CDATA section. |
protected int |
nextInContent()
Returns the next lexical unit in the context of an element content. |
protected int |
nextInDoctype()
Returns the next lexical unit in the context of a doctype. |
protected int |
nextInDocumentStart()
Reads the first token in the stream. |
protected int |
nextInDTDDeclarations()
Returns the next lexical unit in the context dtd declarations. |
protected int |
nextInElementDeclaration()
Returns the next lexical unit in the context of a element declaration. |
protected int |
nextInEndTag()
Returns the next lexical unit in the context of a end tag. |
protected int |
nextInEntity()
Returns the next lexical unit in the context of an entity. |
protected int |
nextInEntityValue(char sd)
Returns the next lexical unit in the context of an entity value. |
protected int |
nextInEnumeration()
Returns the next lexical unit in the context of an enumeration. |
protected int |
nextInNotation()
Returns the next lexical unit in the context of a notation. |
protected int |
nextInNotationType()
Returns the next lexical unit in the context of a notation type. |
protected int |
nextInPI()
Returns the next lexical unit in the context of a processing instruction. |
protected int |
nextInStartTag()
Returns the next lexical unit in the context of a start tag. |
protected int |
nextInTopLevel()
Advances to the next lexical unit in the top level context. |
protected int |
nextInXMLDecl()
Returns the next lexical unit in the context of an XML declaration. |
void |
setContext(int c)
Sets the current context. |
void |
setDepth(int i)
Sets the current depth in the XML tree. |
Methods inherited from class org.apache.batik.xml.scanner.AbstractScanner |
createException, currentType, formatMessage, getInputBuffer, getLocale, readComment, readIdentifier, readName, readNmtoken, readPEReference, readPIStart, readReference, readString, setLocale |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DTD_DECLARATIONS_CONTEXT
public static final int DQUOTED_ATTRIBUTE_CONTEXT
public static final int SQUOTED_ATTRIBUTE_CONTEXT
public static final int DQUOTED_ENTITY_VALUE_CONTEXT
public static final int SQUOTED_ENTITY_VALUE_CONTEXT
public static final int ELEMENT_DECLARATION_CONTEXT
public static final int ENTITY_CONTEXT
public static final int NOTATION_CONTEXT
public static final int ATTLIST_CONTEXT
public static final int DOCUMENT_START_CONTEXT
public static final int TOP_LEVEL_CONTEXT
public static final int PI_CONTEXT
public static final int START_TAG_CONTEXT
public static final int DOCTYPE_CONTEXT
public static final int XML_DECL_CONTEXT
public static final int CONTENT_CONTEXT
public static final int CDATA_SECTION_CONTEXT
public static final int END_TAG_CONTEXT
public static final int NOTATION_TYPE_CONTEXT
public static final int ENUMERATION_CONTEXT
protected int context
protected int depth
protected boolean piEndRead
protected boolean cdataEndRead
protected boolean inDTD
protected char stringDelimiter
Constructor Detail |
public DocumentScanner(java.io.Reader r) throws LexicalException
r
- The reader to scan.Method Detail |
public void setDepth(int i)
public int getDepth()
public void setContext(int c)
public int getContext()
public char getStringDelimiter()
public char[] currentValue()
LexicalUnits.START_TAG token value is returned without the leading '<'. LexicalUnits.COMMENT token value is returned without the leading ''. LexicalUnits.STRING value is returned without quotes. LexicalUnits.STRING_FRAGMENT value is returned without quotes.
public int next() throws LexicalException
public int next(int context) throws LexicalException
context
- The context to use for scanning.protected int nextInElementDeclaration() throws java.io.IOException, LexicalException
protected int nextInAttList() throws java.io.IOException, LexicalException
protected int nextInNotationType() throws java.io.IOException, LexicalException
protected int nextInEnumeration() throws java.io.IOException, LexicalException
protected int nextInNotation() throws java.io.IOException, LexicalException
protected int nextInEntity() throws java.io.IOException, LexicalException
protected int nextInEntityValue(char sd) throws java.io.IOException, LexicalException
sd
- The current string delimiter.protected int nextInDocumentStart() throws java.io.IOException, LexicalException
protected int nextInTopLevel() throws java.io.IOException, LexicalException
protected int nextInPI() throws java.io.IOException, LexicalException
protected int nextInStartTag() throws java.io.IOException, LexicalException
protected int nextInAttributeValue(char sd) throws java.io.IOException, LexicalException
sd
- The current string delimiter.protected int nextInContent() throws java.io.IOException, LexicalException
protected int nextInEndTag() throws java.io.IOException, LexicalException
protected int nextInCDATASection() throws java.io.IOException, LexicalException
protected int nextInXMLDecl() throws java.io.IOException, LexicalException
protected int nextInDoctype() throws java.io.IOException, LexicalException
protected int nextInDTDDeclarations() throws java.io.IOException, LexicalException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |