org.apache.xalan.transformer

Class StackGuard

public class StackGuard extends Object

Class to guard against recursion getting too deep.
Constructor Summary
StackGuard(TransformerImpl transformerImpl)
Constructor StackGuard
Method Summary
voidcheckForInfinateLoop()
Check if we are in an infinite loop
intcountLikeTemplates(ElemTemplate templ, int pos)
Overide equal method for StackGuard objects
intgetRecursionLimit()
Get the recursion limit.
voidsetRecursionLimit(int limit)
Set the recursion limit.

Constructor Detail

StackGuard

public StackGuard(TransformerImpl transformerImpl)
Constructor StackGuard

Method Detail

checkForInfinateLoop

public void checkForInfinateLoop()
Check if we are in an infinite loop

Throws: TransformerException

countLikeTemplates

public int countLikeTemplates(ElemTemplate templ, int pos)
Overide equal method for StackGuard objects

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.

Copyright © 2005 Apache XML Project. All Rights Reserved.