org.apache.myfaces.extensions.validator.core.el
Class ValueBindingExpression

java.lang.Object
  extended by org.apache.myfaces.extensions.validator.core.el.ValueBindingExpression

public class ValueBindingExpression
extends Object

An instance of this class stores the different parts of an expression string and allows an easier usage of value-bindings.

Since:
1.x.1

Constructor Summary
ValueBindingExpression(String expression)
          Creates an instance of a ValueBindingExpression based on a well formed EL expression.
 
Method Summary
static ValueBindingExpression addProperty(ValueBindingExpression valueBindingExpression, String newProperty)
          Adds the property to the given ValueBindingExpression.
 boolean equals(Object target)
           
 ValueBindingExpression getBaseExpression()
           
 String getExpressionString()
          Recreates the expression string from which this valueBindingExpression was build.
 String getPrefix()
           
 String getProperty()
          The (last) property of the expression.
 int hashCode()
           
static ValueBindingExpression replaceOrAddProperty(ValueBindingExpression valueBindingExpression, String newProperty)
          The given property is used as new property of the expression.
static ValueBindingExpression replaceProperty(ValueBindingExpression valueBindingExpression, String newProperty)
          Replace the property in the expression string with the given property.
 void setPrefix(String prefix)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueBindingExpression

public ValueBindingExpression(String expression)
Creates an instance of a ValueBindingExpression based on a well formed EL expression.

Parameters:
expression - The EL expression
Method Detail

replaceOrAddProperty

public static ValueBindingExpression replaceOrAddProperty(ValueBindingExpression valueBindingExpression,
                                                          String newProperty)
The given property is used as new property of the expression. Examples for 'newProperty':
#{bean} -> #{bean.newProperty}

#{bean.property} -> #{bean.newProperty}

Parameters:
valueBindingExpression - The target instance of ValueBindingExpression
newProperty - The property to use.
Returns:
The resulting ValueBindingExpression (with the new property)

replaceProperty

public static ValueBindingExpression replaceProperty(ValueBindingExpression valueBindingExpression,
                                                     String newProperty)
Replace the property in the expression string with the given property.

Parameters:
valueBindingExpression - The valueBindingExpression where we want to replace the property
newProperty - The new property which should replace the existing one.
Returns:
The resulting ValueBindingExpression (with the new property)

addProperty

public static ValueBindingExpression addProperty(ValueBindingExpression valueBindingExpression,
                                                 String newProperty)
Adds the property to the given ValueBindingExpression.

Parameters:
valueBindingExpression - The valueBindingExpression where we want to add the property
newProperty - The property to add.
Returns:
The resulting ValueBindingExpression (with the new property)

getProperty

public String getProperty()
The (last) property of the expression.

Returns:
The (last) property of the expression.

getBaseExpression

public ValueBindingExpression getBaseExpression()

getExpressionString

public String getExpressionString()
Recreates the expression string from which this valueBindingExpression was build. There is no guarantee that the same format is kep, for example {#bean['property']} could become {#bean.property}

Returns:
The expression string equivalent of the valueBindingExpression.

getPrefix

public String getPrefix()

setPrefix

public void setPrefix(String prefix)

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object target)
Overrides:
equals in class Object


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.