jd.xml.xslt.pattern
Class PatternClassifier
java.lang.Object
jd.xml.xslt.pattern.PatternClassifier
- All Implemented Interfaces:
- NodeTestVisitor, PatternVisitor
- public class PatternClassifier
- extends Object
- implements PatternVisitor, NodeTestVisitor
A PatternClassifier classifies which nodes a pattern can match.
Method Summary |
PatternClassifier.Match |
classify(Pattern pattern)
|
static PatternClassifier.Match |
classifyPattern(Pattern pattern)
|
void |
composedPattern(Pattern pattern,
Pattern lhs,
Pattern rhs,
boolean composeDirect)
|
void |
idPattern(Pattern pattern,
String id)
|
void |
keyPattern(Pattern pattern,
String keyName,
String keyValue)
|
void |
numberCountPattern(Pattern pattern,
XPathNode node,
NodeNameTest nameTest)
|
void |
orPattern(Pattern pattern,
Pattern[] patterns)
|
void |
rootPattern(Pattern pattern)
|
void |
stepPattern(Pattern pattern,
int principalType,
NodeTest nodeTest,
Expression[] predicates,
int lastSizePredicate,
int lastNumericPredicate)
|
void |
testNodeName(NodeName name,
String namespaceUri,
String localName)
Called by a visited NodeNameTest. |
void |
testNodeType(NodeTypeTest test,
String parameter)
Called by a visited NodeTypeTest. |
void |
testNodeUnion(NodeTest test1,
NodeTest test2)
Called by a visited NodeTestUnion. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PatternClassifier
public PatternClassifier()
classifyPattern
public static PatternClassifier.Match classifyPattern(Pattern pattern)
classify
public PatternClassifier.Match classify(Pattern pattern)
composedPattern
public void composedPattern(Pattern pattern,
Pattern lhs,
Pattern rhs,
boolean composeDirect)
- Specified by:
composedPattern
in interface PatternVisitor
idPattern
public void idPattern(Pattern pattern,
String id)
- Specified by:
idPattern
in interface PatternVisitor
keyPattern
public void keyPattern(Pattern pattern,
String keyName,
String keyValue)
- Specified by:
keyPattern
in interface PatternVisitor
numberCountPattern
public void numberCountPattern(Pattern pattern,
XPathNode node,
NodeNameTest nameTest)
- Specified by:
numberCountPattern
in interface PatternVisitor
orPattern
public void orPattern(Pattern pattern,
Pattern[] patterns)
- Specified by:
orPattern
in interface PatternVisitor
rootPattern
public void rootPattern(Pattern pattern)
- Specified by:
rootPattern
in interface PatternVisitor
stepPattern
public void stepPattern(Pattern pattern,
int principalType,
NodeTest nodeTest,
Expression[] predicates,
int lastSizePredicate,
int lastNumericPredicate)
- Specified by:
stepPattern
in interface PatternVisitor
testNodeType
public void testNodeType(NodeTypeTest test,
String parameter)
- Description copied from interface:
NodeTestVisitor
- Called by a visited NodeTypeTest. Use NodeTypeTest.accept(int) to
explore the types accepted by the test.
- Specified by:
testNodeType
in interface NodeTestVisitor
- Parameters:
test
- the NodeTypeTestparameter
- the optional parameter if it is a processing-instruction test
or null else- See Also:
NodeTypeTest.accept(int)
testNodeUnion
public void testNodeUnion(NodeTest test1,
NodeTest test2)
- Description copied from interface:
NodeTestVisitor
- Called by a visited NodeTestUnion.
- Specified by:
testNodeUnion
in interface NodeTestVisitor
testNodeName
public void testNodeName(NodeName name,
String namespaceUri,
String localName)
- Description copied from interface:
NodeTestVisitor
- Called by a visited NodeNameTest.
- Specified by:
testNodeName
in interface NodeTestVisitor
- Parameters:
name
- the NodeName if the test uses a NodeNamePool, or null if not.namespaceUri
- the tested namespaceUri or null if all node names are acceptedlocalName
- the tested localName or null if all node local names are accepted