All Packages Class Hierarchy This Package Previous Next Index
Class xs.xs_RuleElement
java.lang.Object
|
+----com.sun.java.swing.tree.DefaultMutableTreeNode
|
+----xg.xg_Node
|
+----xg.xg_Element
|
+----xs.xs_RuleElement
- public class xs_RuleElement
- extends xg_Element
An XML element to represent a 'rule' element in an XSL stylesheet.
-
ActionVector
-
Vector of this rule's actions.
-
ImportanceAttName
- The name of the attribute used to identify the importance of this rule.
-
PatternVector
- Vector of this rule's patterns.
-
PriorityAttName
- The name of the attribute used to identify the priority of this rule.
-
RegisteredName
- The element type name normally used in XML for this sort of element.
-
RootRuleFlag
- Is this a (the!) root rule?
-
RuleNumber
- This rule's number.
-
xs_RuleElement()
- Construct an XSL rule element with no type and no name.
-
xs_RuleElement(String)
- Construct an XSL rule element with a name.
-
getActions()
- Get the vector of this rule's actions.
-
getPatterns()
- Get the vector of this rule's patterns.
-
getRuleNumber()
- Get this rule's sequential number (which must be set manually via an
external call to setRuleNumber() ).
-
invokeActions(xg_Node)
- Invoke this rule's actions on the given source node.
-
isRoot()
- Get the flag which indicates whether this is a root rule.
-
matchPattern(xg_Element)
- See if any of this rule's patterns match the InputSourceElement.
-
matchPattern(xs_PatternElement, xg_Element)
- See if any of this rule's patterns match the InputSourceNode, and are a
better match than the InputBestPattern (which may be null).
-
setRuleNumber(int)
- Set this rule's sequential number.
-
toString()
- Return a string representation of the element (intended for use as debug
output).
-
verify()
-
Verify that this node is correct (ie.
RootRuleFlag
protected boolean RootRuleFlag
- Is this a (the!) root rule?
PatternVector
protected Vector PatternVector
- Vector of this rule's patterns. A child is treated as a pattern if it is
an instance of xs_PatternElement.
ActionVector
protected Vector ActionVector
-
Vector of this rule's actions. All of the rule's child elements (that
is, excluding comments, PIs, etc.) after the patterns are treated as actions.
They may be derived from xs_ActionElement (in which case they will be
treated specially), but they may simply be normal xg_Element objects.
Note that we can support multiple actions in a single rule, whereas
it would appear that XSL intends to allow only one.
RuleNumber
protected int RuleNumber
- This rule's number. Each rule is given a sequential number during XML
parsing of the stylesheet, to make it easier to identify. This is for
convenience only, and plays no part whatsoever in the XSL processing
itself.
RegisteredName
public static final String RegisteredName
- The element type name normally used in XML for this sort of element.
ImportanceAttName
public static final String ImportanceAttName
- The name of the attribute used to identify the importance of this rule.
PriorityAttName
public static final String PriorityAttName
- The name of the attribute used to identify the priority of this rule.
xs_RuleElement
public xs_RuleElement()
- Construct an XSL rule element with no type and no name.
xs_RuleElement
public xs_RuleElement(String InputNodeName)
- Construct an XSL rule element with a name.
- Parameters:
- InputNodeName - The name of the element
verify
public void verify() throws xg_VerificationException
-
Verify that this node is correct (ie. internally correct and/or consistent
with other nodes - such as its parent). The node must have one or more
xs_PatternElement children, followed by one or more action children (which
may be xs_ActionElement or plain xg_Element objects). The node may have
a 'root' action - but not more than one.
- Throws: xg_VerificationException
- Description of verification problem
- Overrides:
- verify in class xg_Node
matchPattern
public xs_PatternElement matchPattern(xs_PatternElement InputBestPattern,
xg_Element InputSourceElement) throws xs_StyleException
- See if any of this rule's patterns match the InputSourceNode, and are a
better match than the InputBestPattern (which may be null).
- 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:
- The best pattern after checking this rule: it
will either be InputBestPattern or one of
this rule's patterns
- Throws: xs_StyleException
- An error occurred processing the actions
matchPattern
public xs_PatternElement matchPattern(xg_Element InputSourceElement) throws xs_StyleException
- See if any of this rule's patterns match the InputSourceElement. If so,
pass back the best one.
- Parameters:
- InputSourceElement - The source element to match
- Returns:
- The best pattern in this rule (or null if
none of them matches the InputSourceElement)
- Throws: xs_StyleException
- An error occurred processing the actions
invokeActions
public void invokeActions(xg_Node InputSourceNode) throws xs_StyleException
- Invoke this rule's actions on the given source node.
- Parameters:
- InputSourceNode - The source node
- Throws: xs_StyleException
- An error occurred processing the actions
setRuleNumber
public void setRuleNumber(int InputRuleNumber)
- Set this rule's sequential number. Also set the number of each of this rule's
patterns.
- Parameters:
- The - sequential number given to this rule
getPatterns
public Vector getPatterns()
- Get the vector of this rule's patterns.
- Returns:
- The vector of patterns
getActions
public Vector getActions()
- Get the vector of this rule's actions.
- Returns:
- The vector of actions
isRoot
public boolean isRoot()
- Get the flag which indicates whether this is a root rule.
- Returns:
- true if this is a root rule; false if not
- Overrides:
- isRoot in class DefaultMutableTreeNode
getRuleNumber
public int getRuleNumber()
- Get this rule's sequential number (which must be set manually via an
external call to setRuleNumber() ).
- Returns:
- The sequential number given to this rule
toString
public String toString()
- Return a string representation of the element (intended for use as debug
output).
- Returns:
- String representing the node's name.
- Overrides:
- toString in class xg_Element
All Packages Class Hierarchy This Package Previous Next Index