org.apache.struts2.util
Class ComponentUtils

java.lang.Object
  extended by org.apache.struts2.util.ComponentUtils

public class ComponentUtils
extends Object

Various static methods used with components


Constructor Summary
ComponentUtils()
           
 
Method Summary
static boolean altSyntax(ValueStack stack)
          Is the altSyntax enabled? [TRUE]
static boolean isExpression(Object value)
          Check if object is expression base on altSyntax
static String stripExpressionIfAltSyntax(ValueStack stack, String expr)
          If altSyntax (%{...}) is applied, simply strip the "%{" and "}" off.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentUtils

public ComponentUtils()
Method Detail

stripExpressionIfAltSyntax

public static String stripExpressionIfAltSyntax(ValueStack stack,
                                                String expr)
If altSyntax (%{...}) is applied, simply strip the "%{" and "}" off.

Parameters:
stack - the ValueStack where the context value is searched for.
expr - the expression (must be not null)
Returns:
the stripped expression if altSyntax is enabled. Otherwise the parameter expression is returned as is.

altSyntax

public static boolean altSyntax(ValueStack stack)
Is the altSyntax enabled? [TRUE]

Parameters:
stack - the ValueStack where the context value is searched for.
Returns:
true if altSyntax is activated. False otherwise. See struts.properties where the altSyntax flag is defined.

isExpression

public static boolean isExpression(Object value)
Check if object is expression base on altSyntax

Parameters:
value - to treat as an expression
Returns:
true if it is an expression


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.