org.apache.batik.xml
public class XMLScanner extends Object implements Localizable
Field Summary | |
---|---|
static int | ATTLIST_CONTEXT
The ATTLIST context. |
static int | ATTRIBUTE_VALUE_CONTEXT
The attribute value context. |
protected char | attrDelimiter
The last attribute delimiter encountered. |
protected char[] | buffer
The recording buffer. |
protected static String | BUNDLE_CLASSNAME
The default resource bundle base name. |
protected boolean | cdataEndRead
A CDATA section end is the next token |
protected int | context
The current scanning context. |
protected int | current
The current char. |
static int | CDATA_SECTION_CONTEXT
The CDATA section context. |
static int | CONTENT_CONTEXT
The content 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 | DTD_DECLARATIONS_CONTEXT
The DTD declarations context. |
protected int | end
The end offset of the last lexical unit. |
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 | ENTITY_VALUE_CONTEXT
The entity value context. |
static int | ENUMERATION_CONTEXT
The enumeration context. |
protected boolean | inDTD
The scanner is in the internal DTD. |
protected LocalizableSupport | localizableSupport
The localizable support. |
static int | NOTATION_CONTEXT
The notation context. |
static int | NOTATION_TYPE_CONTEXT
The notation type context. |
protected boolean | piEndRead
A PI end has been previously read. |
protected int | position
The current position in the buffer. |
static int | PI_CONTEXT
The processing instruction context. |
protected NormalizingReader | reader
The reader. |
protected int | start
The start offset of the last lexical unit. |
static int | START_TAG_CONTEXT
The start tag context. |
protected int | type
The type of the current lexical unit. |
static int | TOP_LEVEL_CONTEXT
The top level context. |
static int | XML_DECL_CONTEXT
The XML declaration context. |
Constructor Summary | |
---|---|
XMLScanner(Reader r)
Creates a new XML scanner. | |
XMLScanner(InputStream is, String enc)
Creates a new XML scanner. | |
XMLScanner(String s)
Creates a new XML scanner. |
Method Summary | |
---|---|
void | clearBuffer()
Clears the buffer. |
protected XMLException | createXMLException(String message)
Returns an XMLException initialized with the given message key. |
String | formatMessage(String key, Object[] args)
Implements {@link
org.apache.batik.i18n.Localizable#formatMessage(String,Object[])}. |
char[] | getBuffer()
Returns the buffer used to store the chars. |
int | getColumn()
Returns the current column. |
int | getContext()
Returns the current context. |
int | getDepth()
Returns the current depth in the XML tree. |
int | getEnd()
Returns the end offset of the last lexical unit. |
int | getEndOffset()
Returns the end offset of the current lexical unit. |
int | getLine()
Returns the current line. |
Locale | getLocale()
Implements {@link org.apache.batik.i18n.Localizable#getLocale()}. |
int | getStart()
Returns the start offset of the last lexical unit. |
int | getStartOffset()
Returns the start offset of the current lexical unit. |
char | getStringDelimiter()
Returns the last encountered string delimiter. |
int | getType()
The current lexical unit type like defined in LexicalUnits. |
int | next()
Advances to the next lexical unit. |
int | next(int ctx)
Advances to the next lexical unit. |
protected int | nextChar()
Sets the value of the current char to the next character or -1 if the
end of stream has been reached. |
protected int | nextInAttList()
Returns the next lexical unit in the context of an attribute list. |
protected int | nextInAttributeValue()
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()
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. |
protected int | readComment()
Reads a comment. |
protected int | readIdentifier(String s, int type, int ntype)
Reads the given identifier. |
protected int | readName(int type)
Reads a name. |
protected int | readNmtoken()
Reads a Nmtoken. |
protected int | readPEReference()
Reads a parameter entity reference. |
protected int | readPIStart()
Reads a processing instruction start. |
protected int | readReference()
Reads an entity or character reference. |
protected int | readString()
Reads a simple string, like the ones used for version, encoding,
public/system identifiers...
|
void | setContext(int c)
Sets the current context. |
void | setDepth(int i)
Sets the current depth in the XML tree. |
void | setLocale(Locale l)
Implements {@link org.apache.batik.i18n.Localizable#setLocale(Locale)}. |
Parameters: r The reader to scan.
Parameters: is The input stream to scan. enc The character encoding to use.
Parameters: s The string to parse.
Returns: The type of the lexical unit like defined in LexicalUnits.
Parameters: ctx The context to use for scanning.
Returns: The type of the lexical unit like defined in LexicalUnits.
Returns: The type of the lexical unit like defined in LexicalUnits.
Parameters: s The portion of the identifier to read. type The lexical unit type of the identifier. ntype The lexical unit type to set if the identifier do not match or -1 if an error must be signaled.
Parameters: type The lexical unit type to set.
Returns: type.
Returns: LexicalUnits.NMTOKEN.
Returns: type.
Returns: type.
Returns: type.
Returns: type.