org.jaxen.pattern
Class UnionPattern
java.lang.Object
|
+--org.jaxen.pattern.Pattern
|
+--org.jaxen.pattern.UnionPattern
- public class UnionPattern
- extends Pattern
UnionPattern
represents a union pattern.
- Version:
- $Revision: 1.5 $
- Author:
- James Strachan
Fields inherited from class org.jaxen.pattern.Pattern |
ANY_NODE, ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, MAX_NODE_TYPE, NAMESPACE_NODE, NO_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, UNKNOWN_NODE |
UnionPattern
public UnionPattern()
UnionPattern
public UnionPattern(Pattern lhs,
Pattern rhs)
getLHS
public Pattern getLHS()
setLHS
public void setLHS(Pattern lhs)
getRHS
public Pattern getRHS()
setRHS
public void setRHS(Pattern rhs)
matches
public boolean matches(Object node,
Context context)
throws JaxenException
- Overrides:
matches
in class Pattern
- Returns:
- true if the pattern matches the given node
getUnionPatterns
public Pattern[] getUnionPatterns()
- Description copied from class:
Pattern
- 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.
- Overrides:
getUnionPatterns
in class Pattern
- Following copied from class:
org.jaxen.pattern.Pattern
- Returns:
- an array of the patterns which make up this union pattern
or null if this pattern is not a union pattern
getMatchType
public short getMatchType()
- Overrides:
getMatchType
in class Pattern
- Following copied from class:
org.jaxen.pattern.Pattern
- Returns:
- the type of node the pattern matches
which by default should return ANY_NODE if it can
match any kind of node.
getMatchesNodeName
public String getMatchesNodeName()
- Description copied from class:
Pattern
- 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.
- Overrides:
getMatchesNodeName
in class Pattern
- Following copied from class:
org.jaxen.pattern.Pattern
- Returns:
- the name of the element or attribute this pattern matches
or null if this pattern matches any or more than one name.
simplify
public Pattern simplify()
- Overrides:
simplify
in class Pattern
getText
public String getText()
- Description copied from class:
Pattern
- Returns a textual representation of this pattern
- Overrides:
getText
in class Pattern
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2002 bob mcwhirter & James Strachan. All Rights Reserved. Hosted by