org.jaxen
Class XPathSyntaxException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--org.saxpath.SAXPathException
                    |
                    +--org.jaxen.JaxenException
                          |
                          +--org.jaxen.XPathSyntaxException
All Implemented Interfaces:
Serializable

public class XPathSyntaxException
extends JaxenException

Indicates an error during parsing of an XPath expression.

Author:
bob mcwhirter, James Strachan
See Also:
XPath, Serialized Form

Constructor Summary
XPathSyntaxException(String xpath, int position, String message)
          Construct.
 
Method Summary
 String getMultilineMessage()
          Retrieve the friendly multi-line error message.
 int getPosition()
          Retrieve the position of the error.
 String getPositionMarker()
          Retrieve a string useful for denoting where the error occured.
 String getXPath()
          Retrieve the expression containing the error.
 
Methods inherited from class org.jaxen.JaxenException
getRootCause
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XPathSyntaxException

public XPathSyntaxException(String xpath,
                            int position,
                            String message)
Construct.
Parameters:
xpath - The erroneous xpath.
position - The position of the error.
message - The error message.
Method Detail

getPosition

public int getPosition()
Retrieve the position of the error.
Returns:
The position of the error.

getXPath

public String getXPath()
Retrieve the expression containing the error.
Returns:
The erroneous expression.

getPositionMarker

public String getPositionMarker()
Retrieve a string useful for denoting where the error occured.

This is a string composed of whitespace and a marker at the position (see getPosition()) of the error. This is useful for creating friendly multi-line error displays.

Returns:
The error position marker.

getMultilineMessage

public String getMultilineMessage()
Retrieve the friendly multi-line error message.

This returns a multi-line string that contains the original erroneous xpath expression with a marker underneath indicating exactly where the error occurred.

Returns:
The multi-line error message.


Copyright © 2002 bob mcwhirter & James Strachan. All Rights Reserved. Hosted by

SourceForge Logo