org.enhydra.apache.xerces.validators.schema.identity
Class XPathMatcher

java.lang.Object
  |
  +--org.enhydra.apache.xerces.validators.schema.identity.XPathMatcher
Direct Known Subclasses:
Field.Matcher, Selector.Matcher

public class XPathMatcher
extends java.lang.Object

XPath matcher.

Version:
$Id: XPathMatcher.java,v 1.2 2003/03/08 19:25:07 davidli Exp $
Author:
Andy Clark, IBM

Field Summary
protected static boolean DEBUG_ALL
          Compile to true to debug everything.
protected static boolean DEBUG_ANY
          Don't touch this value unless you add more debug constants.
protected static boolean DEBUG_MATCH
          Compile to true to debug match.
protected static boolean DEBUG_METHODS
          Compile to true to debug method callbacks.
protected static boolean DEBUG_METHODS2
          Compile to true to debug important method callbacks.
protected static boolean DEBUG_METHODS3
          Compile to true to debug the really important methods.
protected static boolean DEBUG_STACK
          Compile to true to debug step index stack.
protected  IdentityConstraint fIDConstraint
           
protected  NamespacesScope fNamespacesScope
          Namespace scope.
protected  StringPool fStringPool
          String pool.
 
Constructor Summary
XPathMatcher(XPath xpath)
          Constructs an XPath matcher that implements a document fragment handler.
XPathMatcher(XPath xpath, boolean shouldBufferContent, IdentityConstraint idConstraint)
          Constructs an XPath matcher that implements a document fragment handler.
 
Method Summary
 void characters(char[] ch, int offset, int length)
          Character content.
 void endDocumentFragment()
          The end of the document fragment.
 void endElement(QName element, int eIndex, SchemaGrammar grammar)
          The end of an element.
 IdentityConstraint getIDConstraint()
           
 boolean getIsSelector()
           
 java.lang.String getMatchedString()
          Returns the matched string.
 boolean isMatched()
          Returns true if XPath has been matched.
protected  void matched(java.lang.String content, DatatypeValidator val, boolean isNil)
          This method is called when the XPath handler matches the XPath expression.
 void startDocumentFragment(StringPool stringPool)
          The start of the document fragment.
 void startElement(QName element, XMLAttrList attributes, int handle, int eIndex, SchemaGrammar grammar)
          The start of an element.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG_ALL

protected static final boolean DEBUG_ALL
Compile to true to debug everything.

See Also:
Constant Field Values

DEBUG_METHODS

protected static final boolean DEBUG_METHODS
Compile to true to debug method callbacks.

See Also:
Constant Field Values

DEBUG_METHODS2

protected static final boolean DEBUG_METHODS2
Compile to true to debug important method callbacks.

See Also:
Constant Field Values

DEBUG_METHODS3

protected static final boolean DEBUG_METHODS3
Compile to true to debug the really important methods.

See Also:
Constant Field Values

DEBUG_MATCH

protected static final boolean DEBUG_MATCH
Compile to true to debug match.

See Also:
Constant Field Values

DEBUG_STACK

protected static final boolean DEBUG_STACK
Compile to true to debug step index stack.

See Also:
Constant Field Values

DEBUG_ANY

protected static final boolean DEBUG_ANY
Don't touch this value unless you add more debug constants.

See Also:
Constant Field Values

fStringPool

protected StringPool fStringPool
String pool.


fNamespacesScope

protected NamespacesScope fNamespacesScope
Namespace scope.


fIDConstraint

protected IdentityConstraint fIDConstraint
Constructor Detail

XPathMatcher

public XPathMatcher(XPath xpath)
Constructs an XPath matcher that implements a document fragment handler.

Parameters:
xpath - The xpath.

XPathMatcher

public XPathMatcher(XPath xpath,
                    boolean shouldBufferContent,
                    IdentityConstraint idConstraint)
Constructs an XPath matcher that implements a document fragment handler.

Parameters:
xpath - The xpath.
shouldBufferContent - True if the matcher should buffer the matched content.
Method Detail

isMatched

public boolean isMatched()
Returns true if XPath has been matched.


getIsSelector

public boolean getIsSelector()

getIDConstraint

public IdentityConstraint getIDConstraint()

getMatchedString

public java.lang.String getMatchedString()
Returns the matched string.


matched

protected void matched(java.lang.String content,
                       DatatypeValidator val,
                       boolean isNil)
                throws java.lang.Exception
This method is called when the XPath handler matches the XPath expression. Subclasses can override this method to provide default handling upon a match.

java.lang.Exception

startDocumentFragment

public void startDocumentFragment(StringPool stringPool)
                           throws java.lang.Exception
The start of the document fragment.

Throws:
SAXException - Thrown by handler to signal an error.
java.lang.Exception

startElement

public void startElement(QName element,
                         XMLAttrList attributes,
                         int handle,
                         int eIndex,
                         SchemaGrammar grammar)
                  throws java.lang.Exception
The start of an element. If the document specifies the start element by using an empty tag, then the startElement method will immediately be followed by the endElement method, with no intervening methods.

Parameters:
element - The name of the element.
attributes - The element attributes.
Throws:
SAXException - Thrown by handler to signal an error.
java.lang.Exception

characters

public void characters(char[] ch,
                       int offset,
                       int length)
                throws java.lang.Exception
Character content.

java.lang.Exception

endElement

public void endElement(QName element,
                       int eIndex,
                       SchemaGrammar grammar)
                throws java.lang.Exception
The end of an element.

Parameters:
element - The name of the element.
Throws:
SAXException - Thrown by handler to signal an error.
java.lang.Exception

endDocumentFragment

public void endDocumentFragment()
                         throws java.lang.Exception
The end of the document fragment.

Throws:
SAXException - Thrown by handler to signal an error.
java.lang.Exception

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object


Copyright © 1999 The Apache Software Foundation. All Rights reserved.