Logo Search packages:      
Sourcecode: jing-trang version File versions  Download package

com::thaiopensource::xml::tok::Tokenizer Class Reference

List of all members.


Detailed Description

It provides operations on char arrays that represent all or part of a parsed XML entity.

Several methods operate on char subarrays. The subarray is specified by a char array buf and two integers, off and end; off gives the index in buf of the first char of the subarray and end gives the index in buf of the char immediately after the last char.

The main operations provided by Tokenizer are tokenizeProlog, tokenizeContent and tokenizeCdataSection; these are used to divide up an XML entity into tokens. tokenizeProlog is used for the prolog of an XML document as well as for the external subset and parameter entities (except when referenced in an EntityValue); it can also be used for parsing the Misc* that follows the document element. tokenizeContent is used for the document element and for parsed general entities that are referenced in content except for CDATA sections. tokenizeCdataSection is used for CDATA sections, following the <![CDATA[ up to and including the ]]>.

tokenizeAttributeValue and tokenizeEntityValue are used to further divide up tokens returned by tokenizeProlog and tokenizeContent; they are also used to divide up entities referenced in attribute values or entity values.

Definition at line 35 of file Tokenizer.java.


Static Public Member Functions

static String getPublicId (char[] buf, int off, int end) throws InvalidTokenException
static boolean matchesXMLString (char[] buf, int off, int end, String str)
static void movePosition (final char[] buf, int off, int end, Position pos)
static int skipIgnoreSect (char[] buf, int off, int end) throws PartialTokenException, InvalidTokenException
static int skipS (char[] buf, int off, int end)
static int tokenizeAttributeValue (char[] buf, int off, int end, Token token) throws PartialTokenException, InvalidTokenException, EmptyTokenException, ExtensibleTokenException
static int tokenizeCdataSection (char[] buf, int off, int end, Token token) throws EmptyTokenException, PartialTokenException, InvalidTokenException, ExtensibleTokenException
static int tokenizeContent (char[] buf, int off, int end, ContentToken token) throws PartialTokenException, InvalidTokenException, EmptyTokenException, ExtensibleTokenException
static int tokenizeEntityValue (char[] buf, int off, int end, Token token) throws PartialTokenException, InvalidTokenException, EmptyTokenException, ExtensibleTokenException
static int tokenizeProlog (char[] buf, int off, int end, Token token) throws PartialTokenException, InvalidTokenException, EmptyTokenException, ExtensibleTokenException, EndOfPrologException

Static Public Attributes

static final int TOK_ATTRIBUTE_VALUE_S = TOK_COMMENT + 1
static final int TOK_CDATA_SECT_CLOSE = TOK_CDATA_SECT_OPEN + 1
static final int TOK_CDATA_SECT_OPEN = TOK_END_TAG + 1
static final int TOK_CHAR_PAIR_REF = TOK_CHAR_REF + 1
static final int TOK_CHAR_REF = TOK_MAGIC_ENTITY_REF + 1
static final int TOK_CLOSE_BRACKET = TOK_OPEN_BRACKET + 1
static final int TOK_CLOSE_PAREN = TOK_OPEN_PAREN + 1
static final int TOK_CLOSE_PAREN_ASTERISK = TOK_CLOSE_PAREN_QUESTION + 1
static final int TOK_CLOSE_PAREN_PLUS = TOK_CLOSE_PAREN_ASTERISK + 1
static final int TOK_CLOSE_PAREN_QUESTION = TOK_COND_SECT_CLOSE + 1
static final int TOK_COMMA = TOK_CLOSE_PAREN_PLUS + 1
static final int TOK_COMMENT = TOK_XML_DECL + 1
static final int TOK_COND_SECT_CLOSE = TOK_COND_SECT_OPEN + 1
static final int TOK_COND_SECT_OPEN = TOK_NAME_PLUS + 1
static final int TOK_DATA_CHARS = 0
static final int TOK_DATA_NEWLINE = TOK_DATA_CHARS + 1
static final int TOK_DECL_CLOSE = TOK_DECL_OPEN + 1
static final int TOK_DECL_OPEN = TOK_PROLOG_S + 1
static final int TOK_EMPTY_ELEMENT_NO_ATTS = TOK_START_TAG_WITH_ATTS + 1
static final int TOK_EMPTY_ELEMENT_WITH_ATTS = TOK_EMPTY_ELEMENT_NO_ATTS + 1
static final int TOK_END_TAG = TOK_EMPTY_ELEMENT_WITH_ATTS + 1
static final int TOK_ENTITY_REF = TOK_CDATA_SECT_CLOSE + 1
static final int TOK_LITERAL = TOK_CLOSE_BRACKET + 1
static final int TOK_MAGIC_ENTITY_REF = TOK_ENTITY_REF + 1
static final int TOK_NAME = TOK_DECL_CLOSE + 1
static final int TOK_NAME_ASTERISK = TOK_NAME_QUESTION + 1
static final int TOK_NAME_PLUS = TOK_NAME_ASTERISK + 1
static final int TOK_NAME_QUESTION = TOK_LITERAL + 1
static final int TOK_NMTOKEN = TOK_PREFIXED_NAME + 1
static final int TOK_OPEN_BRACKET = TOK_CLOSE_PAREN + 1
static final int TOK_OPEN_PAREN = TOK_PERCENT + 1
static final int TOK_OR = TOK_POUND_NAME + 1
static final int TOK_PARAM_ENTITY_REF = TOK_ATTRIBUTE_VALUE_S + 1
static final int TOK_PERCENT = TOK_OR + 1
static final int TOK_PI = TOK_CHAR_PAIR_REF + 1
static final int TOK_POUND_NAME = TOK_NMTOKEN + 1
static final int TOK_PREFIXED_NAME = TOK_NAME + 1
static final int TOK_PROLOG_S = TOK_PARAM_ENTITY_REF + 1
static final int TOK_START_TAG_NO_ATTS = TOK_DATA_NEWLINE + 1
static final int TOK_START_TAG_WITH_ATTS = TOK_START_TAG_NO_ATTS + 1
static final int TOK_XML_DECL = TOK_PI + 1

Static Package Functions

 [static initializer]
static int charType (char c)

Static Package Attributes

static final byte[] asciiTypeTable
static final int CT_AMP = CT_LT - 1
static final int CT_APOS = CT_QUOT + 1
static final int CT_AST = CT_RPAR + 1
static final int CT_COLON = CT_NMSTRT + 1
static final int CT_COMMA = CT_PLUS + 1
static final int CT_CR = CT_RSQB - 1
static final int CT_EQUALS = CT_APOS + 1
static final int CT_EXCL = CT_QUEST + 1
static final int CT_GT = 0
static final int CT_LEAD2 = -2
static final int CT_LF = CT_CR - 1
static final int CT_LPAR = CT_PERCNT + 1
static final int CT_LSQB = CT_NUM + 1
static final int CT_LT = CT_MALFORM - 1
static final int CT_MALFORM = CT_NONXML - 1
static final int CT_MINUS = CT_NAME + 1
static final int CT_NAME = CT_COLON + 1
static final int CT_NMSTRT = CT_S + 1
static final int CT_NONXML = CT_LEAD2 - 1
static final int CT_NUM = CT_SEMI + 1
static final int CT_OTHER = CT_MINUS + 1
static final int CT_PERCNT = CT_OTHER + 1
static final int CT_PLUS = CT_AST + 1
static final int CT_QUEST = CT_EQUALS + 1
static final int CT_QUOT = CT_GT + 1
static final int CT_RPAR = CT_LPAR + 1
static final int CT_RSQB = CT_AMP - 1
static final int CT_S = CT_LSQB + 1
static final int CT_SEMI = CT_SOL + 1
static final int CT_SOL = CT_EXCL + 1
static final int CT_VERBAR = CT_COMMA + 1

Static Private Member Functions

static int charType2 (char[] buf, int off)
static void check2 (char[] buf, int off) throws InvalidTokenException
static void checkCharMatches (char[] buf, int off, char c) throws InvalidTokenException
static int extendCdata (final char[] buf, int off, final int end) throws InvalidTokenException
static int extendData (final char[] buf, int off, final int end) throws InvalidTokenException
static boolean isMagicEntityRef (char[] buf, int off, int end, Token token)
static boolean isNameChar2 (char[] buf, int off)
static int scanAtts (int nameStart, char[] buf, int off, int end, ContentToken token) throws PartialTokenException, InvalidTokenException
static int scanCdataSection (char[] buf, int off, int end, Token token) throws PartialTokenException, InvalidTokenException
static int scanCharRef (char[] buf, int off, int end, Token token) throws PartialTokenException, InvalidTokenException
static int scanComment (char[] buf, int off, int end, Token token) throws InvalidTokenException, PartialTokenException
static int scanDecl (char[] buf, int off, int end, Token token) throws InvalidTokenException, PartialTokenException
static int scanEndTag (char[] buf, int off, int end, Token token) throws PartialTokenException, InvalidTokenException
static int scanHexCharRef (char[] buf, int off, int end, Token token) throws PartialTokenException, InvalidTokenException
static int scanLit (int open, char[] buf, int off, int end, Token token) throws PartialTokenException, InvalidTokenException, ExtensibleTokenException
static int scanLt (char[] buf, int off, int end, ContentToken token) throws PartialTokenException, InvalidTokenException
static int scanPercent (char[] buf, int off, int end, Token token) throws PartialTokenException, InvalidTokenException
static int scanPi (char[] buf, int off, int end, Token token) throws PartialTokenException, InvalidTokenException
static int scanPoundName (char[] buf, int off, int end, Token token) throws PartialTokenException, InvalidTokenException, ExtensibleTokenException
static int scanRef (char[] buf, int off, int end, Token token) throws PartialTokenException, InvalidTokenException
static void setCharType (char min, char max, int type)
static void setCharType (char c, int type)
static int setRefChar (int num, Token token) throws InvalidTokenException
static boolean targetIsXml (char[] buf, int off, int end) throws InvalidTokenException

Static Private Attributes

static final String CDATA = "CDATA["
static final byte[][] charTypeTable
static final String nameRanges
static final String nameSingles
static final String nameStartRanges
static final String nameStartSingles

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index