Top Description Fields Methods
org.dom4j.rule

public Interface Pattern

extends NodeFilter
Known Direct Implementers
org.dom4j.rule.pattern.DefaultPattern, org.dom4j.rule.pattern.NodeTypePattern, org.dom4j.xpath.XPathPattern
Imports
org.dom4j.Node, .NodeFilter

Pattern defines the behaviour for pattern in the XSLT processing model.

Author
James Strachan
Version
$Revision: 1.6 $

Field Summary

Modifier and TypeField and Description
public static final short
ANY_NODE

Matches any node

public static final double
DEFAULT_PRIORITY

According to the spec we should return 0.5 if we cannot determine the priority

public static final short
NONE

Matches no nodes

public static final short
NUMBER_OF_TYPES

Count of the number of node types

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the name of the element or attribute this pattern matches or null if this pattern matches any or more than one name.
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

Returns:

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

DOCUMENT ME!

public double

Returns:

DOCUMENT ME!
getPriority
()

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

public Pattern[]

Returns:

an array of the patterns which make up this union pattern or null if this pattern is not a union 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.

public boolean

Returns:

true if the pattern matches the given DOM4J node.
matches
(Node
DOCUMENT ME!
node
)

Redeclares org.dom4j.NodeFilter.matches.

DOCUMENT ME!

Field Detail

ANY_NODEback to summary
public static final short ANY_NODE

Matches any node

DEFAULT_PRIORITYback to summary
public static final double DEFAULT_PRIORITY

According to the spec we should return 0.5 if we cannot determine the priority

NONEback to summary
public static final short NONE

Matches no nodes

NUMBER_OF_TYPESback to summary
public static final short NUMBER_OF_TYPES

Count of the number of node types

Method Detail

getMatchesNodeNameback to summary
public String 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()

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()

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

Returns:double

DOCUMENT ME!

getUnionPatternsback to summary
public 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

matchesback to summary
public boolean matches(Node node)

Redeclares org.dom4j.NodeFilter.matches.

DOCUMENT ME!

Parameters
node:Node

DOCUMENT ME!

Returns:boolean

true if the pattern matches the given DOM4J node.