test.org.benow.web.extension.counter
Class CounterExtension

java.lang.Object
  extended by org.benow.web.extension.Extension
      extended by test.org.benow.web.extension.counter.CounterExtension

public class CounterExtension
extends Extension

A simple XSL counter extension.

Author:
andy

Nested Class Summary
 
Nested classes/interfaces inherited from class org.benow.web.extension.Extension
Extension.IsElement
 
Field Summary
 
Fields inherited from class org.benow.web.extension.Extension
context, extElem
 
Constructor Summary
CounterExtension()
           
 
Method Summary
 void incr(java.lang.String name)
          Increment the counter
 void init(java.lang.String name, int val)
          Set the starting value of the counter
 int read(java.lang.String name)
           
 void reset(java.lang.String name)
          Reset the counter to zero
 
Methods inherited from class org.benow.web.extension.Extension
getChildElementsByTagName, getTextContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CounterExtension

public CounterExtension()
Method Detail

reset

public void reset(java.lang.String name)
Reset the counter to zero


init

public void init(java.lang.String name,
                 int val)
Set the starting value of the counter

Parameters:
val -

read

public int read(java.lang.String name)
Returns:
the value of the counter

incr

public void incr(java.lang.String name)
Increment the counter