com.novell.xsl.process
Class ElementMatch

java.lang.Object
  extended bycom.novell.xsl.process.ElementMatch
All Implemented Interfaces:
Comparable

public class ElementMatch
extends Object
implements Comparable

This class is used for matching element names for the purpose of whitespace stripping.


Constructor Summary
ElementMatch(WildcardName name, boolean strip, int importance, int number)
          Construct an ElementMatch object for the passed name
 
Method Summary
 int compareTo(Object obj)
          Compares this ElementMatch with another ElementMatch for conflict resolution order.
 void dump(PrintWriter out, int indent)
          Dumps this object to the specified output stream.
 int getNumber()
          Return this ElementMatch's sequence number
 boolean isStrip()
          Return true if this match object is from a strip-space element
 boolean matches(Element element)
          Return true if the passed element matches the name represented by this ElementMatch object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementMatch

public ElementMatch(WildcardName name,
                    boolean strip,
                    int importance,
                    int number)
Construct an ElementMatch object for the passed name

Parameters:
name - The name or wildcard name of the element(s) to match
strip - True if this is from a strip-space element, false if this is from a preserve-space element.
importance - The import precedence of this match (The import precedence of the xsl:strip-space or xsl-preserve-space element that contains the element WildcardName item).
number - The relative position of this in the stylesheet
Method Detail

matches

public boolean matches(Element element)
Return true if the passed element matches the name represented by this ElementMatch object.

Parameters:
element - The element to match
Returns:
True if the element matches, false otherwise.

isStrip

public boolean isStrip()
Return true if this match object is from a strip-space element

Returns:
True if this match object is from a strip-space element

compareTo

public int compareTo(Object obj)
Compares this ElementMatch with another ElementMatch for conflict resolution order.

Specified by:
compareTo in interface Comparable
Parameters:
obj - the other ElementMatch to compare with; it is declared as an Object to conform with the Comparable interface
Returns:
a negative integer, zero, or a positive integer depending on whether conflict resolution would prefer this rule, neither rule (a tie), or the other rule
Throws:
ClassCastException - if the specified object is not a ElementMatch

getNumber

public int getNumber()
Return this ElementMatch's sequence number

Returns:
The sequence number

dump

public void dump(PrintWriter out,
                 int indent)
Dumps this object to the specified output stream.

Parameters:
out - the output stream to write to
indent - number of tabs to indent