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.


Variable Index

 o ActionVector

Vector of this rule's actions.

 o ImportanceAttName
The name of the attribute used to identify the importance of this rule.
 o PatternVector
Vector of this rule's patterns.
 o PriorityAttName
The name of the attribute used to identify the priority of this rule.
 o RegisteredName
The element type name normally used in XML for this sort of element.
 o RootRuleFlag
Is this a (the!) root rule?
 o RuleNumber
This rule's number.

Constructor Index

 o xs_RuleElement()
Construct an XSL rule element with no type and no name.
 o xs_RuleElement(String)
Construct an XSL rule element with a name.

Method Index

 o getActions()
Get the vector of this rule's actions.
 o getPatterns()
Get the vector of this rule's patterns.
 o getRuleNumber()
Get this rule's sequential number (which must be set manually via an external call to setRuleNumber() ).
 o invokeActions(xg_Node)
Invoke this rule's actions on the given source node.
 o isRoot()
Get the flag which indicates whether this is a root rule.
 o matchPattern(xg_Element)
See if any of this rule's patterns match the InputSourceElement.
 o 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).
 o setRuleNumber(int)
Set this rule's sequential number.
 o toString()
Return a string representation of the element (intended for use as debug output).
 o verify()

Verify that this node is correct (ie.

Variables

 o RootRuleFlag
 protected boolean RootRuleFlag
Is this a (the!) root rule?

 o 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.

 o 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.

 o 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.

 o RegisteredName
 public static final String RegisteredName
The element type name normally used in XML for this sort of element.

 o ImportanceAttName
 public static final String ImportanceAttName
The name of the attribute used to identify the importance of this rule.

 o PriorityAttName
 public static final String PriorityAttName
The name of the attribute used to identify the priority of this rule.

Constructors

 o xs_RuleElement
 public xs_RuleElement()
Construct an XSL rule element with no type and no name.

 o xs_RuleElement
 public xs_RuleElement(String InputNodeName)
Construct an XSL rule element with a name.

Parameters:
InputNodeName - The name of the element

Methods

 o 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
 o 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
 o 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
 o 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
 o 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
 o getPatterns
 public Vector getPatterns()
Get the vector of this rule's patterns.

Returns:
The vector of patterns
 o getActions
 public Vector getActions()
Get the vector of this rule's actions.

Returns:
The vector of actions
 o 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
 o 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
 o 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