Top Description Inners Fields Constructors Methods
org.apache.xerces.xpointer

pack-priv final Class ElementSchemePointer

extends Object
implements XPointerPart
Class Inheritance
All Implemented Interfaces
org.apache.xerces.xpointer.XPointerPart
Imports
java.util.HashMap, org.apache.xerces.impl.XMLErrorReporter, org.apache.xerces.util.SymbolTable, .XMLChar, org.apache.xerces.xni.Augmentations, .QName, .XMLAttributes, .XNIException, org.apache.xerces.xni.parser.XMLErrorHandler

Implements the XPointerPart interface for element() scheme specific processing.

Version
$Id: ElementSchemePointer.java 603808 2007-12-13 03:44:48Z mrglavas $

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
ElementSchemePointer.Scanner

The XPointer expression scanner.

private class
ElementSchemePointer.Tokens

List of XPointer Framework tokens.

Field Summary

Modifier and TypeField and Description
private int[]
private int
private int
private int[]
protected XMLErrorHandler
protected XMLErrorReporter
pack-priv int
private boolean
private boolean
private boolean
pack-priv boolean
private String
private String
private ShortHandPointer
private String
private SymbolTable
private boolean

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
protected boolean

Returns:

boolean
checkMatch
()

Matches the current position of the element being visited by checking its position and previous elements against the element XPointer expression.

public String
public String
getSchemeName()

Implements org.apache.xerces.xpointer.XPointerPart.getSchemeName.

Returns the scheme name i.e element
protected void
init()

Initializes the element scheme processor

protected void
initErrorReporter()

Initializes error handling objects

public boolean
isChildFragmentResolved()

Implements org.apache.xerces.xpointer.XPointerPart.isChildFragmentResolved.

Returns true if the XPointer expression resolves to a non-element child of the current resource fragment.
public boolean
isFragmentResolved()

Implements org.apache.xerces.xpointer.XPointerPart.isFragmentResolved.

Returns true if the node matches or is a child of a matching element() scheme XPointer.
protected boolean

Returns:

boolean - true if the current element position in the document tree matches theelement position specified in the element XPointer scheme.
matchChildSequence
(QName element, int event)

Matches the current element position in the document tree with the element position specified in the element XPointer scheme.

public void
parseXPointer(String
A String representing the PointerPart or ShortHandPointer.
xpointer
)

Implements org.apache.xerces.xpointer.XPointerPart.parseXPointer.

Parses the XPointer expression and tokenizes it into Strings delimited by whitespace.
protected void
reportError(String key, Object[] arguments)

Reports an XPointer error

public boolean
resolveXPointer(QName
- The name of the element.
element
,
XMLAttributes
- The element attributes.
attributes
,
Augmentations
- Additional information that may include infoset augmentations
augs
,
int
- An integer indicating 0 - The start of an element 1 - The end of an element 2 - An empty element call
event
)

Implements org.apache.xerces.xpointer.XPointerPart.resolveXPointer.

Responsible for resolving the element() scheme XPointer.
public void
setSchemeData(String
A String containing the scheme data of the PointerPart.
schemeData
)

Implements org.apache.xerces.xpointer.XPointerPart.setSchemeData.

Sets the scheme data
public void
setSchemeName(String
A String containing the scheme name of the PointerPart.
schemeName
)

Implements org.apache.xerces.xpointer.XPointerPart.setSchemeName.

Sets the scheme name
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fChildSequenceback to summary
private int[] fChildSequence
fCurrentChildDepthback to summary
private int fCurrentChildDepth
fCurrentChildPositionback to summary
private int fCurrentChildPosition
fCurrentChildSequenceback to summary
private int[] fCurrentChildSequence
fErrorHandlerback to summary
protected XMLErrorHandler fErrorHandler
fErrorReporterback to summary
protected XMLErrorReporter fErrorReporter
fFoundDepthback to summary
pack-priv int fFoundDepth
fIsElementFoundback to summary
private boolean fIsElementFound
fIsFragmentResolvedback to summary
private boolean fIsFragmentResolved
fIsResolveElementback to summary
private boolean fIsResolveElement
fIsShortHandback to summary
pack-priv boolean fIsShortHand
fSchemeDataback to summary
private String fSchemeData
fSchemeNameback to summary
private String fSchemeName
fShortHandPointerback to summary
private ShortHandPointer fShortHandPointer
fShortHandPointerNameback to summary
private String fShortHandPointerName
fSymbolTableback to summary
private SymbolTable fSymbolTable
fWasOnlyEmptyElementFoundback to summary
private boolean fWasOnlyEmptyElementFound

Constructor Detail

ElementSchemePointerback to summary
public ElementSchemePointer()
ElementSchemePointerback to summary
public ElementSchemePointer(SymbolTable symbolTable)
ElementSchemePointerback to summary
public ElementSchemePointer(SymbolTable symbolTable, XMLErrorReporter errorReporter)

Method Detail

checkMatchback to summary
protected boolean checkMatch()

Matches the current position of the element being visited by checking its position and previous elements against the element XPointer expression. If a match is found it return true else false.

Returns:boolean

boolean

getSchemeDataback to summary
public String getSchemeData()

Implements org.apache.xerces.xpointer.XPointerPart.getSchemeData.

Returns the scheme data

Returns:String

Doc from org.apache.xerces.xpointer.XPointerPart.getSchemeData.

A String containing the scheme data of the PointerPart.

See Also
org.apache.xerces.xpointer.XPointerPart#getSchemeData()
getSchemeNameback to summary
public String getSchemeName()

Implements org.apache.xerces.xpointer.XPointerPart.getSchemeName.

Returns the scheme name i.e element

Returns:String

Doc from org.apache.xerces.xpointer.XPointerPart.getSchemeName.

A String containing the scheme name of the PointerPart.

See Also
org.apache.xerces.xpointer.XPointerPart#getSchemeName()
initback to summary
protected void init()

Initializes the element scheme processor

initErrorReporterback to summary
protected void initErrorReporter()

Initializes error handling objects

isChildFragmentResolvedback to summary
public boolean isChildFragmentResolved()

Implements org.apache.xerces.xpointer.XPointerPart.isChildFragmentResolved.

Returns true if the XPointer expression resolves to a non-element child of the current resource fragment.

Returns:boolean

Doc from org.apache.xerces.xpointer.XPointerPart.isChildFragmentResolved.

True if the XPointer expression resolves to a non-element child of the current resource fragment.

See Also
org.apache.xerces.xpointer.XPointerPart#isChildFragmentResolved()
isFragmentResolvedback to summary
public boolean isFragmentResolved() throws XNIException

Implements org.apache.xerces.xpointer.XPointerPart.isFragmentResolved.

Returns true if the node matches or is a child of a matching element() scheme XPointer.

Returns:boolean

Doc from org.apache.xerces.xpointer.XPointerPart.isFragmentResolved.

True if the xpointer expression matches a fragment in the resource else returns false.

Exceptions
XNIException:

Doc from org.apache.xerces.xpointer.XPointerPart.isFragmentResolved.

Thrown to signal an error

See Also
org.apache.xerces.xpointer.XPointerProcessor#isFragmentResolved()
matchChildSequenceback to summary
protected boolean matchChildSequence(QName element, int event) throws XNIException

Matches the current element position in the document tree with the element position specified in the element XPointer scheme.

Returns:boolean

boolean - true if the current element position in the document tree matches theelement position specified in the element XPointer scheme.

parseXPointerback to summary
public void parseXPointer(String xpointer) throws XNIException

Implements org.apache.xerces.xpointer.XPointerPart.parseXPointer.

Parses the XPointer expression and tokenizes it into Strings delimited by whitespace.

Parameters
xpointer:String

Doc from org.apache.xerces.xpointer.XPointerPart.parseXPointer.

A String representing the PointerPart or ShortHandPointer.

Exceptions
XNIException:

Doc from org.apache.xerces.xpointer.XPointerPart.parseXPointer.

Thrown if the PointerPart string does not conform to the syntax defined by its scheme.

See Also
org.apache.xerces.xpointer.XPointerProcessor#parseXPointer(java.lang.String)
reportErrorback to summary
protected void reportError(String key, Object[] arguments) throws XNIException

Reports an XPointer error

resolveXPointerback to summary
public boolean resolveXPointer(QName element, XMLAttributes attributes, Augmentations augs, int event) throws XNIException

Implements org.apache.xerces.xpointer.XPointerPart.resolveXPointer.

Responsible for resolving the element() scheme XPointer. If a ShortHand Pointer is present and it is successfully resolved and if a child sequence is present, the child sequence is resolved relative to it.

Parameters
element:QName

Doc from org.apache.xerces.xpointer.XPointerPart.resolveXPointer.

- The name of the element.

attributes:XMLAttributes

Doc from org.apache.xerces.xpointer.XPointerPart.resolveXPointer.

- The element attributes.

augs:Augmentations

Doc from org.apache.xerces.xpointer.XPointerPart.resolveXPointer.

- Additional information that may include infoset augmentations

event:int

Doc from org.apache.xerces.xpointer.XPointerPart.resolveXPointer.

- An integer indicating 0 - The start of an element 1 - The end of an element 2 - An empty element call

Exceptions
XNIException:

Doc from org.apache.xerces.xpointer.XPointerPart.resolveXPointer.

Thrown to signal an error

See Also
org.apache.xerces.xpointer.XPointerProcessor#resolveXPointer(org.apache.xerces.xni.QName, org.apache.xerces.xni.XMLAttributes, org.apache.xerces.xni.Augmentations, int event)
setSchemeDataback to summary
public void setSchemeData(String schemeData)

Implements org.apache.xerces.xpointer.XPointerPart.setSchemeData.

Sets the scheme data

Parameters
schemeData:String

Doc from org.apache.xerces.xpointer.XPointerPart.setSchemeData.

A String containing the scheme data of the PointerPart.

See Also
org.apache.xerces.xpointer.XPointerPart#setSchemeData(java.lang.String)
setSchemeNameback to summary
public void setSchemeName(String schemeName)

Implements org.apache.xerces.xpointer.XPointerPart.setSchemeName.

Sets the scheme name

Parameters
schemeName:String

Doc from org.apache.xerces.xpointer.XPointerPart.setSchemeName.

A String containing the scheme name of the PointerPart.

See Also
org.apache.xerces.xpointer.XPointerPart#setSchemeName(java.lang.String)
org.apache.xerces.xpointer back to summary

private Class ElementSchemePointer.Scanner

extends Object
Class Inheritance

The XPointer expression scanner. Scans the XPointer framework expression.
Version
$Id: ElementSchemePointer.java 603808 2007-12-13 03:44:48Z mrglavas $

Field Summary

Modifier and TypeField and Description
private static final byte
CHARTYPE_DIGIT

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

private static final byte
CHARTYPE_INVALID

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

private static final byte
CHARTYPE_LETTER

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

private static final byte
CHARTYPE_MINUS

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

private static final byte
CHARTYPE_NONASCII

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

private static final byte
CHARTYPE_OTHER

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

private static final byte
CHARTYPE_PERIOD

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

private static final byte
CHARTYPE_SLASH

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

private static final byte
CHARTYPE_UNDERSCORE

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

private final byte[]
private SymbolTable
fSymbolTable

Symbol table.

Constructor Summary

AccessConstructor and Description
private
Scanner(SymbolTable
SymbolTable
symbolTable
)

Constructs an XPath expression scanner.

Method Summary

Modifier and TypeMethod and Description
protected void
addToken(ElementSchemePointer.Tokens tokens, int token)

This method adds the specified token to the token list.

private boolean
scanExpr(SymbolTable symbolTable, ElementSchemePointer.Tokens tokens, String data, int currentOffset, int endOffset)

Scans the XPointer Expression

private int
scanNCName(String
A String containing the XPointer expression
data
,
int
The int XPointer expression length
endOffset
,
int
An int representing the current position of the XPointer expression pointer
currentOffset
)

Scans a NCName.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CHARTYPE_DIGITback to summary
private static final byte CHARTYPE_DIGIT

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

CHARTYPE_INVALIDback to summary
private static final byte CHARTYPE_INVALID

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

CHARTYPE_LETTERback to summary
private static final byte CHARTYPE_LETTER

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

CHARTYPE_MINUSback to summary
private static final byte CHARTYPE_MINUS

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

CHARTYPE_NONASCIIback to summary
private static final byte CHARTYPE_NONASCII

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

CHARTYPE_OTHERback to summary
private static final byte CHARTYPE_OTHER

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

CHARTYPE_PERIODback to summary
private static final byte CHARTYPE_PERIOD

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

CHARTYPE_SLASHback to summary
private static final byte CHARTYPE_SLASH

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

CHARTYPE_UNDERSCOREback to summary
private static final byte CHARTYPE_UNDERSCORE

7-bit ASCII subset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, HT, LF, 0, 0, CR, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 SP, !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, :, ;, <, =, >, ?, // 3

fASCIICharMapback to summary
private final byte[] fASCIICharMap
fSymbolTableback to summary
private SymbolTable fSymbolTable

Symbol table.

Constructor Detail

Scannerback to summary
private Scanner(SymbolTable symbolTable)

Constructs an XPath expression scanner.

Parameters
symbolTable:SymbolTable

SymbolTable

Method Detail

addTokenback to summary
protected void addToken(ElementSchemePointer.Tokens tokens, int token) throws XNIException

This method adds the specified token to the token list. By default, this method allows all tokens. However, subclasses of the XPathExprScanner can override this method in order to disallow certain tokens from being used in the scanned XPath expression. This is a convenient way of allowing only a subset of XPath.

scanExprback to summary
private boolean scanExpr(SymbolTable symbolTable, ElementSchemePointer.Tokens tokens, String data, int currentOffset, int endOffset) throws XNIException

Scans the XPointer Expression

scanNCNameback to summary
private int scanNCName(String data, int endOffset, int currentOffset)

Scans a NCName. From Namespaces in XML [5] NCName ::= (Letter | '_') (NCNameChar)* [6] NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender

Parameters
data:String

A String containing the XPointer expression

endOffset:int

The int XPointer expression length

currentOffset:int

An int representing the current position of the XPointer expression pointer

org.apache.xerces.xpointer back to summary

private final Class ElementSchemePointer.Tokens

extends Object
Class Inheritance

List of XPointer Framework tokens.
Author
Neil Delima, IBM
Version
$Id: ElementSchemePointer.java 603808 2007-12-13 03:44:48Z mrglavas $

Field Summary

Modifier and TypeField and Description
private int
private final String[]
private SymbolTable
private int
private HashMap<K, V>
private int[]
private static final int
private static final int
private static final int
XPTRTOKEN_ELEM_NCNAME

XPointer element() scheme [1] ElementSchemeData ::= (NCName ChildSequence?) | ChildSequence [2] ChildSequence ::= ('/' [1-9] [0-9]*)+

Constructor Summary

AccessConstructor and Description
private
Tokens(SymbolTable
SymbolTable
symbolTable
)

Constructor

Method Summary

Modifier and TypeMethod and Description
private void
addToken(String
The token string
tokenStr
)

Add the specified string as a token

private void
addToken(int
The int specifying the token
token
)

Add the specified int token

private Integer

Returns:

String The token string
getToken
(int
The index of the token
token
)

Returns the token String

private int
getTokenCount()

Returns the number of tokens.

private String
getTokenString(int token)

private boolean
hasMore()

Returns true if the getNextToken() method returns a valid token.

private int
nextToken()

Obtains the token at the current position, then advance the current position by one.

private String
nextTokenAsString()

Obtains the token at the current position as a String.

private int
peekToken()

Obtains the token at the current position, without advancing the current position.

private void
rewind()

Resets the current position to the head of the token list.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fCurrentTokenIndexback to summary
private int fCurrentTokenIndex
fgTokenNamesback to summary
private final String[] fgTokenNames
fSymbolTableback to summary
private SymbolTable fSymbolTable
fTokenCountback to summary
private int fTokenCount
fTokenNamesback to summary
private HashMap<K, V> fTokenNames
fTokensback to summary
private int[] fTokens
INITIAL_TOKEN_COUNTback to summary
private static final int INITIAL_TOKEN_COUNT
XPTRTOKEN_ELEM_CHILDback to summary
private static final int XPTRTOKEN_ELEM_CHILD
XPTRTOKEN_ELEM_NCNAMEback to summary
private static final int XPTRTOKEN_ELEM_NCNAME

XPointer element() scheme [1] ElementSchemeData ::= (NCName ChildSequence?) | ChildSequence [2] ChildSequence ::= ('/' [1-9] [0-9]*)+

Constructor Detail

Tokensback to summary
private Tokens(SymbolTable symbolTable)

Constructor

Parameters
symbolTable:SymbolTable

SymbolTable

Method Detail

addTokenback to summary
private void addToken(String tokenStr)

Add the specified string as a token

Parameters
tokenStr:String

The token string

addTokenback to summary
private void addToken(int token)

Add the specified int token

Parameters
token:int

The int specifying the token

getTokenback to summary
private Integer getToken(int token)

Returns the token String

Parameters
token:int

The index of the token

Returns:Integer

String The token string

getTokenCountback to summary
private int getTokenCount()

Returns the number of tokens.

getTokenStringback to summary
private String getTokenString(int token)
hasMoreback to summary
private boolean hasMore()

Returns true if the getNextToken() method returns a valid token.

nextTokenback to summary
private int nextToken() throws XNIException

Obtains the token at the current position, then advance the current position by one. If there's no such next token, this method throws new XNIException("InvalidXPointerExpression");.

nextTokenAsStringback to summary
private String nextTokenAsString() throws XNIException

Obtains the token at the current position as a String. If there's no current token or if the current token is not a string token, this method throws If there's no such next token, this method throws new XNIException("InvalidXPointerExpression");.

peekTokenback to summary
private int peekToken() throws XNIException

Obtains the token at the current position, without advancing the current position. If there's no such next token, this method throws new XNIException("InvalidXPointerExpression");.

rewindback to summary
private void rewind()

Resets the current position to the head of the token list.