Package org.jboss.dmr
Class ValueExpression
- java.lang.Object
-
- org.jboss.dmr.ValueExpression
-
- All Implemented Interfaces:
Externalizable,Serializable
public final class ValueExpression extends Object implements Externalizable
A value expression.- Author:
- David M. Lloyd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ValueExpression(String expressionString)Construct a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)Determine whether this object is equal to another.booleanequals(ValueExpression other)Determine whether this object is equal to another.StringgetExpressionString()Get the raw expression string.inthashCode()Get the hash code of the expression string.static Stringquote(String string)Quote a string so that it can be used in an expression as a literal string, instead of being expanded.voidreadExternal(ObjectInput in)Deserialize this instance.BigDecimalresolveBigDecimal()Resolve this expression to a decimal value.BigDecimalresolveBigDecimal(ValueExpressionResolver resolver)Resolve this expression to a decimal value.BigIntegerresolveBigInteger()Resolve this expression to a large integer value.BigIntegerresolveBigInteger(ValueExpressionResolver resolver)Resolve this expression to a large integer value.booleanresolveBoolean()Resolve this expression to abooleanvalue.booleanresolveBoolean(ValueExpressionResolver resolver)Resolve this expression to abooleanvalue.intresolveInt()Resolve this expression to anintvalue.intresolveInt(ValueExpressionResolver resolver)Resolve this expression to anintvalue.longresolveLong()Resolve this expression to alongvalue.longresolveLong(ValueExpressionResolver resolver)Resolve this expression to alongvalue.StringresolveString()Resolve this expression to a string value.StringresolveString(ValueExpressionResolver resolver)Resolve this expression to a string value.StringtoString()Get a printable string representation of this object.voidwriteExternal(ObjectOutput out)Serialize this instance.
-
-
-
Constructor Detail
-
ValueExpression
public ValueExpression(String expressionString)
Construct a new instance.- Parameters:
expressionString- the expression string
-
-
Method Detail
-
quote
public static String quote(String string)
Quote a string so that it can be used in an expression as a literal string, instead of being expanded.- Parameters:
string- the string to quote- Returns:
- the quoted string
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
Serialize this instance.- Specified by:
writeExternalin interfaceExternalizable- Parameters:
out- the target stream- Throws:
IOException- if a serialization error occurs
-
readExternal
public void readExternal(ObjectInput in) throws IOException
Deserialize this instance.- Specified by:
readExternalin interfaceExternalizable- Parameters:
in- the source stream- Throws:
IOException- if a serialization error occurs
-
getExpressionString
public String getExpressionString()
Get the raw expression string.- Returns:
- the raw expression string (will not be
null)
-
hashCode
public int hashCode()
Get the hash code of the expression string.
-
equals
public boolean equals(Object other)
Determine whether this object is equal to another.
-
equals
public boolean equals(ValueExpression other)
Determine whether this object is equal to another.- Parameters:
other- the other object- Returns:
trueif they are equal,falseotherwise
-
resolveString
public String resolveString()
Resolve this expression to a string value.- Returns:
- the resolved value
-
resolveString
public String resolveString(ValueExpressionResolver resolver)
Resolve this expression to a string value.- Parameters:
resolver- the resolver to use- Returns:
- the resolved value
-
resolveBoolean
public boolean resolveBoolean()
Resolve this expression to abooleanvalue.- Returns:
- the resolved value
-
resolveBoolean
public boolean resolveBoolean(ValueExpressionResolver resolver)
Resolve this expression to abooleanvalue.- Parameters:
resolver- the resolver to use- Returns:
- the resolved value
-
resolveInt
public int resolveInt()
Resolve this expression to anintvalue.- Returns:
- the resolved value
-
resolveInt
public int resolveInt(ValueExpressionResolver resolver)
Resolve this expression to anintvalue.- Parameters:
resolver- the resolver to use- Returns:
- the resolved value
-
resolveLong
public long resolveLong()
Resolve this expression to alongvalue.- Returns:
- the resolved value
-
resolveLong
public long resolveLong(ValueExpressionResolver resolver)
Resolve this expression to alongvalue.- Parameters:
resolver- the resolver to use- Returns:
- the resolved value
-
resolveBigInteger
public BigInteger resolveBigInteger()
Resolve this expression to a large integer value.- Returns:
- the resolved value
-
resolveBigInteger
public BigInteger resolveBigInteger(ValueExpressionResolver resolver)
Resolve this expression to a large integer value.- Parameters:
resolver- the resolver to use- Returns:
- the resolved value
-
resolveBigDecimal
public BigDecimal resolveBigDecimal()
Resolve this expression to a decimal value.- Returns:
- the resolved value
-
resolveBigDecimal
public BigDecimal resolveBigDecimal(ValueExpressionResolver resolver)
Resolve this expression to a decimal value.- Parameters:
resolver- the resolver to use- Returns:
- the resolved value
-
-