Top Description Fields Constructors Methods
org.dom4j.xpath

public Class XPathPattern

extends Object
implements Pattern
Class Inheritance
All Implemented Interfaces
org.dom4j.rule.Pattern, org.dom4j.NodeFilter
Imports
java.util.ArrayList, .Collections, org.dom4j.InvalidXPathException, .Node, .XPathException, org.jaxen.Context, .ContextSupport, .JaxenException, .SimpleNamespaceContext, .SimpleVariableContext, .VariableContext, .XPathFunctionContext, org.jaxen.dom4j.DocumentNavigator, org.jaxen.pattern.Pattern, .PatternParser, org.jaxen.saxpath.SAXPathException

XPathPattern is an implementation of Pattern which uses an XPath xpath.

Author
James Strachan
Version
$Revision: 1.18 $

Field Summary

Modifier and TypeField and Description
private Context
private Pattern
private String

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
protected ContextSupport
public String
getMatchesNodeName()

Implements org.dom4j.rule.Pattern.getMatchesNodeName.

For patterns which only match an ATTRIBUTE_NODE or an ELEMENT_NODE then this pattern may return the name of the element or attribute it matches.
public short
public double
getPriority()

Implements org.dom4j.rule.Pattern.getPriority.

Returns the default resolution policy of the pattern according to the XSLT conflict resolution spec .
public String
public Pattern[]
getUnionPatterns()

Implements org.dom4j.rule.Pattern.getUnionPatterns.

If this pattern is a union pattern then this method should return an array of patterns which describe the union pattern, which should contain more than one pattern.
protected void
public boolean
matches(Node
DOCUMENT ME!
node
)

Implements org.dom4j.rule.Pattern.matches.

DOCUMENT ME!
public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

contextback to summary
private Context context
patternback to summary
private Pattern pattern
textback to summary
private String text

Constructor Detail

XPathPatternback to summary
public XPathPattern(Pattern pattern)
XPathPatternback to summary
public XPathPattern(String text)

Method Detail

getContextSupportback to summary
protected ContextSupport getContextSupport()
getMatchesNodeNameback to summary
public String getMatchesNodeName()

Implements org.dom4j.rule.Pattern.getMatchesNodeName.

Doc from org.dom4j.rule.Pattern.getMatchesNodeName.

For patterns which only match an ATTRIBUTE_NODE or an ELEMENT_NODE then this pattern may return the name of the element or attribute it matches. This allows a more efficient rule matching algorithm to be performed, rather than a brute force approach of evaluating every pattern for a given Node.

Returns:String

the name of the element or attribute this pattern matches or null if this pattern matches any or more than one name.

getMatchTypeback to summary
public short getMatchType()

Implements org.dom4j.rule.Pattern.getMatchType.

Doc from org.dom4j.rule.Pattern.getMatchType.

DOCUMENT ME!

Returns:short

the type of node the pattern matches which by default should return ANY_NODE if it can match any kind of node.

getPriorityback to summary
public double getPriority()

Implements org.dom4j.rule.Pattern.getPriority.

Doc from org.dom4j.rule.Pattern.getPriority.

Returns the default resolution policy of the pattern according to the XSLT conflict resolution spec .

Returns:double

DOCUMENT ME!

getTextback to summary
public String getText()
getUnionPatternsback to summary
public Pattern[] getUnionPatterns()

Implements org.dom4j.rule.Pattern.getUnionPatterns.

Doc from org.dom4j.rule.Pattern.getUnionPatterns.

If this pattern is a union pattern then this method should return an array of patterns which describe the union pattern, which should contain more than one pattern. Otherwise this method should return null.

Returns:Pattern[]

an array of the patterns which make up this union pattern or null if this pattern is not a union pattern

handleJaxenExceptionback to summary
protected void handleJaxenException(JaxenException exception) throws XPathException
matchesback to summary
public boolean matches(Node node)

Implements org.dom4j.rule.Pattern.matches.

Doc from org.dom4j.rule.Pattern.matches.

DOCUMENT ME!

Parameters
node:Node

DOCUMENT ME!

Returns:boolean

true if the pattern matches the given DOM4J node.

setVariableContextback to summary
public void setVariableContext(VariableContext variableContext)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.