com.cc.framework.ui.model.value
Class DeferredValue

java.lang.Object
  extended bycom.cc.framework.ui.model.value.DeferredValue
All Implemented Interfaces:
java.io.Serializable

public class DeferredValue
extends java.lang.Object
implements java.io.Serializable

This is the value wrapper class for deferred EL expressions

Version:
$Revision: 1.12 $
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
private static java.lang.String EL_DEFERRED_INDICATOR
          This is the indicator the framework uses to distinguish a deferred EL expression
private static java.lang.String EL_INDICATOR
          The standard EL markup
private  java.lang.String expression
          Expression (-> literal is null)
static DeferredValue FALSE
          Boolean literal TRUE
private  java.lang.Object literal
          Literal value (-> expression is null)
static DeferredValue NEG
          Integer literal for -1
private static long serialVersionUID
          Serial Version UID
static DeferredValue TRUE
          Boolean literal FALSE
 
Constructor Summary
DeferredValue()
          Constructor
DeferredValue(boolean value)
          Constructor for an literal boolean value
DeferredValue(int value)
          Constructor for an literal int value
DeferredValue(java.lang.Object value)
          Constructor for an literal String value
 
Method Summary
private static java.lang.String convertEL(java.lang.String deferredExpression)
          This method converts an expression in the frameworks deferred syntax (with "@{") to a valid EL expression that can be executed by an EL expression Parser.
private  java.lang.Object evaluate(DeferredEnvironment env)
          Method to evaluate a EL expression
static java.lang.Object evaluate(java.lang.String value, DeferredEnvironment env)
          Evaluates the given String value to an object
static java.lang.String evaluateToString(java.lang.String value, DeferredEnvironment env)
          Evaluates the given String value to a String object
static DeferredValue fromLiteral(java.lang.Object value)
          Creates a literal deferred value
private static boolean isExpression(java.lang.String value)
          Checks if the given string is a deferred expression.
static DeferredValue parseAlignment(java.lang.String value)
          Parses a Alignment expression
static DeferredValue parseBoolean(java.lang.String value)
          Parses a boolean expression
static DeferredValue parseImage(java.lang.String value)
          Parses a Image expression
static DeferredValue parseInt(java.lang.String value)
          Parses a integer expression
static DeferredValue parseJoinMode(java.lang.String value)
          Parses a JoinMode expression
static DeferredValue parsePermission(java.lang.String value)
          Parses a Permission expression
 AlignmentType toAlignment(DeferredEnvironment env)
          Converts the deferred value to a AlignmentType object
static AlignmentType toAlignment(DeferredValue value, DeferredEnvironment env)
          Converts the given deferred value to a AlignmentType object
 boolean toBoolean(DeferredEnvironment env)
          Converts the deferred value to a boolean value
 ImageModel toImage(DeferredEnvironment env)
          Converts the deferred value to a ImageModel object
static ImageModel toImage(DeferredValue value, DeferredEnvironment env)
          Converts the given deferred value to a ImageModel object
 int toInt(DeferredEnvironment env)
          Converts the deferred value to a integer value
 JoinMode toJoinMode(DeferredEnvironment env)
          Converts the deferred value to a JoinMode object
static JoinMode toJoinMode(DeferredValue value, DeferredEnvironment env)
          Converts the given deferred value to a JoinMode object
 Permission toPermission(DeferredEnvironment env)
          Converts the deferred value to a Permission object
static Permission toPermission(DeferredValue value, DeferredEnvironment env)
          Converts the given deferred value to a Permission object
 java.lang.String toString(DeferredEnvironment env)
          Converts the deferred value to a String object
static java.lang.String toString(DeferredValue value, DeferredEnvironment env)
          Converts the given deferred value to a String object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

FALSE

public static final DeferredValue FALSE
Boolean literal TRUE


TRUE

public static final DeferredValue TRUE
Boolean literal FALSE


NEG

public static final DeferredValue NEG
Integer literal for -1


EL_DEFERRED_INDICATOR

private static final java.lang.String EL_DEFERRED_INDICATOR
This is the indicator the framework uses to distinguish a deferred EL expression

See Also:
Constant Field Values

EL_INDICATOR

private static final java.lang.String EL_INDICATOR
The standard EL markup

See Also:
Constant Field Values

literal

private java.lang.Object literal
Literal value (-> expression is null)


expression

private java.lang.String expression
Expression (-> literal is null)

Constructor Detail

DeferredValue

public DeferredValue()
Constructor


DeferredValue

public DeferredValue(boolean value)
Constructor for an literal boolean value

Parameters:
value - literal boolean value

DeferredValue

public DeferredValue(int value)
Constructor for an literal int value

Parameters:
value - literal int value

DeferredValue

public DeferredValue(java.lang.Object value)
Constructor for an literal String value

Parameters:
value - literal String value
Method Detail

convertEL

private static java.lang.String convertEL(java.lang.String deferredExpression)
This method converts an expression in the frameworks deferred syntax (with "@{") to a valid EL expression that can be executed by an EL expression Parser.

Parameters:
deferredExpression - The expression in deferred syntax
Returns:
the expression in valid EL syntax

isExpression

private static boolean isExpression(java.lang.String value)
Checks if the given string is a deferred expression. This is the case when the character sequence "@{" or "${" is part of the string

Parameters:
value - string to test
Returns:
returns true if the string is an expression

fromLiteral

public static DeferredValue fromLiteral(java.lang.Object value)
Creates a literal deferred value

Parameters:
value - literal value
Returns:
Deferred value

parseBoolean

public static DeferredValue parseBoolean(java.lang.String value)
Parses a boolean expression

Parameters:
value - string to parse
Returns:
Deferred value

parseInt

public static DeferredValue parseInt(java.lang.String value)
Parses a integer expression

Parameters:
value - string to parse
Returns:
Deferred value

parsePermission

public static DeferredValue parsePermission(java.lang.String value)
Parses a Permission expression

Parameters:
value - string to parse
Returns:
Deferred value

parseImage

public static DeferredValue parseImage(java.lang.String value)
Parses a Image expression

Parameters:
value - string to parse
Returns:
Deferred value

parseAlignment

public static DeferredValue parseAlignment(java.lang.String value)
Parses a Alignment expression

Parameters:
value - string to parse
Returns:
Deferred value

parseJoinMode

public static DeferredValue parseJoinMode(java.lang.String value)
Parses a JoinMode expression

Parameters:
value - string to parse
Returns:
Deferred value

toPermission

public static Permission toPermission(DeferredValue value,
                                      DeferredEnvironment env)
Converts the given deferred value to a Permission object

Parameters:
value - The deferred value to convert or null
env - The expression environment that gives access to the EL Parser an the (row-)bean
Returns:
Evaluated expression or null

toImage

public static ImageModel toImage(DeferredValue value,
                                 DeferredEnvironment env)
Converts the given deferred value to a ImageModel object

Parameters:
value - The deferred value to convert or null
env - The expression environment that gives access to the EL Parser an the (row-)bean
Returns:
Evaluated expression or null

toAlignment

public static AlignmentType toAlignment(DeferredValue value,
                                        DeferredEnvironment env)
Converts the given deferred value to a AlignmentType object

Parameters:
value - The deferred value to convert or null
env - The expression environment that gives access to the EL Parser an the (row-)bean
Returns:
Evaluated expression or null

toJoinMode

public static JoinMode toJoinMode(DeferredValue value,
                                  DeferredEnvironment env)
Converts the given deferred value to a JoinMode object

Parameters:
value - The deferred value to convert or null
env - The expression environment that gives access to the EL Parser an the (row-)bean
Returns:
Evaluated expression or null

toString

public static java.lang.String toString(DeferredValue value,
                                        DeferredEnvironment env)
Converts the given deferred value to a String object

Parameters:
value - The deferred value to convert or null
env - The expression environment that gives access to the EL Parser an the (row-)bean
Returns:
Evaluated expression or null

evaluateToString

public static java.lang.String evaluateToString(java.lang.String value,
                                                DeferredEnvironment env)
Evaluates the given String value to a String object

Parameters:
value - The Expression source code or null
env - The expression environment that gives access to the EL Parser an the (row-)bean
Returns:
Evaluated expression or null

evaluate

public static java.lang.Object evaluate(java.lang.String value,
                                        DeferredEnvironment env)
Evaluates the given String value to an object

Parameters:
value - The Expression source code or null
env - The expression environment that gives access to the EL Parser an the (row-)bean
Returns:
Evaluated expression or null

toString

public java.lang.String toString(DeferredEnvironment env)
Converts the deferred value to a String object

Parameters:
env - The expression environment that gives access to the EL Parser an the (row-)bean
Returns:
Evaluated expression or null

toImage

public ImageModel toImage(DeferredEnvironment env)
Converts the deferred value to a ImageModel object

Parameters:
env - The expression environment that gives access to the EL Parser an the (row-)bean
Returns:
Evaluated expression or null

toAlignment

public AlignmentType toAlignment(DeferredEnvironment env)
Converts the deferred value to a AlignmentType object

Parameters:
env - The expression environment that gives access to the EL Parser an the (row-)bean
Returns:
Evaluated expression or null

toJoinMode

public JoinMode toJoinMode(DeferredEnvironment env)
Converts the deferred value to a JoinMode object

Parameters:
env - The expression environment that gives access to the EL Parser an the (row-)bean
Returns:
Evaluated expression or null

toPermission

public Permission toPermission(DeferredEnvironment env)
Converts the deferred value to a Permission object

Parameters:
env - The expression environment that gives access to the EL Parser an the (row-)bean
Returns:
Evaluated expression or null

toBoolean

public boolean toBoolean(DeferredEnvironment env)
Converts the deferred value to a boolean value

Parameters:
env - The expression environment that gives access to the EL Parser an the (row-)bean
Returns:
Evaluated expression

toInt

public int toInt(DeferredEnvironment env)
Converts the deferred value to a integer value

Parameters:
env - The expression environment that gives access to the EL Parser an the (row-)bean
Returns:
Evaluated expression

evaluate

private java.lang.Object evaluate(DeferredEnvironment env)
Method to evaluate a EL expression

Parameters:
env - The expression environment that gives access to the EL Parser an the (row-)bean
Returns:
The Result of the EL evaluation


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.