BEA Systems, Inc.

WebLogic Server 6.1 API Reference

weblogic.apache.xalan.transformer
Class StackGuard

java.lang.Object
  |
  +--weblogic.apache.xalan.transformer.StackGuard

public class StackGuard
extends java.lang.Object

Class to guard against recursion getting too deep.

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.


Field Summary
static int m_recursionLimit
          Used for infinite loop check.
 
Constructor Summary
StackGuard()
          Constructor StackGuard
StackGuard(ElemTemplateElement xslTemplate, org.w3c.dom.Node sourceXML)
          Constructor StackGuard
 
Method Summary
 void checkForInfinateLoop(StackGuard guard)
          Check if we are in an infinite loop
 boolean equals(java.lang.Object obj)
          Overide equal method for StackGuard objects
 int getRecursionLimit()
          Get the recursion limit.
 void pop()
          Pop out Stack of StackGuard objects
 void print(java.io.PrintWriter pw)
          Output diagnostics if in an infinite loop
 void push(ElemTemplateElement xslTemplate, org.w3c.dom.Node sourceXML)
          Push in a StackGuard object mathing given template
 void setRecursionLimit(int limit)
          Set the recursion limit.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_recursionLimit

public static int m_recursionLimit
Used for infinite loop check. If the value is -1, do not check for infinite loops. Anyone who wants to enable that check should change the value of this variable to be the level of recursion that they want to check. Be careful setting this variable, if the number is too low, it may report an infinite loop situation, when there is none. Post version 1.0.0, we'll make this a runtime feature.
Constructor Detail

StackGuard

public StackGuard()
Constructor StackGuard

StackGuard

public StackGuard(ElemTemplateElement xslTemplate,
                  org.w3c.dom.Node sourceXML)
Constructor StackGuard

Parameters:
xslTemplate - Current template node
sourceXML - Source Node
Method Detail

getRecursionLimit

public int getRecursionLimit()
Get the recursion limit. Used for infinite loop check. If the value is -1, do not check for infinite loops. Anyone who wants to enable that check should change the value of this variable to be the level of recursion that they want to check. Be careful setting this variable, if the number is too low, it may report an infinite loop situation, when there is none. Post version 1.0.0, we'll make this a runtime feature.

Returns:
The recursion limit.

setRecursionLimit

public void setRecursionLimit(int limit)
Set the recursion limit. Used for infinite loop check. If the value is -1, do not check for infinite loops. Anyone who wants to enable that check should change the value of this variable to be the level of recursion that they want to check. Be careful setting this variable, if the number is too low, it may report an infinite loop situation, when there is none. Post version 1.0.0, we'll make this a runtime feature.

Parameters:
limit - The recursion limit.

equals

public boolean equals(java.lang.Object obj)
Overide equal method for StackGuard objects

Parameters:
obj - StackGuard object to compare
Returns:
True if the given object matches this StackGuard object
Overrides:
equals in class java.lang.Object

print

public void print(java.io.PrintWriter pw)
Output diagnostics if in an infinite loop

Parameters:
pw - Non-null PrintWriter instance to use

checkForInfinateLoop

public void checkForInfinateLoop(StackGuard guard)
                          throws javax.xml.transform.TransformerException
Check if we are in an infinite loop

Parameters:
guard - Current StackGuard object (matching current template)
Throws:
javax.xml.transform.TransformerException -  

push

public void push(ElemTemplateElement xslTemplate,
                 org.w3c.dom.Node sourceXML)
          throws javax.xml.transform.TransformerException
Push in a StackGuard object mathing given template

Parameters:
xslTemplate - Current template being processed
sourceXML - Current Source Node
Throws:
javax.xml.transform.TransformerException -  

pop

public void pop()
Pop out Stack of StackGuard objects

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs61

WebLogic classes and methods that do not appear in this reference are not public and are not supported.