All Packages Class Hierarchy This Package Previous Next Index
Class xs.xs_PatternElement
java.lang.Object
|
+----com.sun.java.swing.tree.DefaultMutableTreeNode
|
+----xg.xg_Node
|
+----xg.xg_Element
|
+----xs.xs_PatternElement
- public class xs_PatternElement
- extends xg_Element
An XML element representing a pattern within an XSL rule.
-
ClassAttName
- The name of the attribute used to identify the class of this pattern.
-
IdAttName
- The name of the attribute used to identify the ID of this pattern.
-
PatternNumberString
- This pattern's number in the form of a string.
-
xs_PatternElement()
- Construct a pattern element with no type and no name.
-
xs_PatternElement(String)
- Construct a pattern element with a name.
-
addMatchLevelsOfChildren()
- Add to this pattern's match level the match level of each of our children.
-
calcMatchLevel()
- Calculate this pattern's match level, which includes figuring out the
value of each of the match level's constituents.
-
compareMatchLevelTo(xs_PatternElement)
- Compare the match level of this pattern against that of the InputPatternElement.
-
getMatchLevel()
- Get this pattern's match level: the values which are used in determining
which pattern to use in a given circumstance.
-
getPatternNumberString()
- Get this patterns's sequential number (which must be set manually via an
external call to setPatternNumber() ).
-
isBestMatch(xs_PatternElement, xg_Element)
- See if this pattern matches the InputSourceElement, and is a better match
than the InputBestPattern (which may be null).
-
isMatch(xg_Element)
- See if this pattern matches the InputSourceElement.
-
setRuleNumber(int, int)
- Set this pattern's identification number string (of the form "r.p", where
r is the InputRuleNumber and p is the InputPatternNumber).
-
toString()
- Return a string representation of the element (intended for use as debug
output).
PatternNumberString
protected String PatternNumberString
- This pattern's number in the form of a string. Each pattern is given a
sequential number within the rule it belongs to. This number is tagged
on to the sequential number allocated to the rule, to yield a string of
the form "r.p". This numbering is performed during XML parsing of the
This number string is used purely to assist identification for a human
user, and plays no part whatsoever in the XSL processing itself.
IdAttName
public static final String IdAttName
- The name of the attribute used to identify the ID of this pattern.
ClassAttName
public static final String ClassAttName
- The name of the attribute used to identify the class of this pattern.
xs_PatternElement
public xs_PatternElement()
- Construct a pattern element with no type and no name.
xs_PatternElement
public xs_PatternElement(String InputNodeName)
- Construct a pattern element with a name.
- Parameters:
- InputNodeName - The name of the element
isBestMatch
public boolean isBestMatch(xs_PatternElement InputBestPattern,
xg_Element InputSourceElement) throws xs_StyleException
- See if this pattern matches the InputSourceElement, and is a better match
than the InputBestPattern (which may be null). If so, return true;
otherwise return false.
- Parameters:
- InputBestPattern - The best pattern found in previous rules
(or null if no match has so far been found)
- InputSourceElement - The source element to match
- Returns:
- true if this is now the best match; false
if not
- Throws: xs_StyleException
- An error occurred processing the actions
isMatch
public boolean isMatch(xg_Element InputSourceElement) throws xs_StyleException
- See if this pattern matches the InputSourceElement. If so, return true.
We expect this to be overridden in derived classes - because this version
always returns false.
- Parameters:
- InputSourceElement - The source node to match
- Returns:
- The best pattern after checking this one: it
will either be InputBestPattern or this
- Throws: xs_StyleException
- An error occurred
compareMatchLevelTo
public int compareMatchLevelTo(xs_PatternElement InputPatternElement)
- Compare the match level of this pattern against that of the InputPatternElement.
- Parameters:
- InputPatternElement - The pattern to compare against
- Returns:
- 0 if this pattern's match level is equal to the
InputPatternElement's match level; less than 0
if this pattern's match level is less than the
InputPatternElement; greater than 0 if this
pattern's match level is greater than the
InputMatchLevel.
calcMatchLevel
public void calcMatchLevel()
- Calculate this pattern's match level, which includes figuring out the
value of each of the match level's constituents.
addMatchLevelsOfChildren
public void addMatchLevelsOfChildren()
- Add to this pattern's match level the match level of each of our children.
We assume each child's match level has already correctly calculated its own
match level (including taking into account its own children).
setRuleNumber
public void setRuleNumber(int InputRuleNumber,
int InputPatternNumber)
- Set this pattern's identification number string (of the form "r.p", where
r is the InputRuleNumber and p is the InputPatternNumber).
- Parameters:
- InputRuleNumber - The sequential number given to the rule to which
this pattern belongs
- InputPatternNumber - The sequential number given to this pattern
within its rule
getMatchLevel
public xs_PatternMatchLevel getMatchLevel()
- Get this pattern's match level: the values which are used in determining
which pattern to use in a given circumstance.
- Returns:
- This pattern's match level
getPatternNumberString
public String getPatternNumberString()
- Get this patterns's sequential number (which must be set manually via an
external call to setPatternNumber() ).
- Returns:
- A string representation of the identification number given to this
pattern
toString
public String toString()
- Return a string representation of the element (intended for use as debug
output).
- Returns:
- String representing the node name and its type.
- Overrides:
- toString in class xg_Element
All Packages Class Hierarchy This Package Previous Next Index