org.jboss.services.deployment
Class ContextHelper

java.lang.Object
  extended byorg.jboss.services.deployment.ContextHelper

public final class ContextHelper
extends java.lang.Object

Helper class to pass in to velocity templates and do things that are more easily performed in java code.


Constructor Summary
ContextHelper()
          Default CTOR
 
Method Summary
static boolean isDefined(java.lang.Object obj)
          Convenience method to find out if a variable is defined (not null).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextHelper

public ContextHelper()
Default CTOR

Method Detail

isDefined

public static boolean isDefined(java.lang.Object obj)
Convenience method to find out if a variable is defined (not null). This helps particularly to check if a Boolean variable has been passed to the velocity context, since the #if( $boolean ) construct is only satisfied, if the value both exists and is true.

Parameters:
obj - any object
Returns:
true if the object is not null, false otherwise