JBoss Dynamic Model Representation API 1.2.0.Beta1

org.jboss.dmr
Class ValueExpression

java.lang.Object
  extended by 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
ValueExpression(String expressionString)
          Construct a new instance.
 
Method Summary
 boolean equals(Object other)
          Determine whether this object is equal to another.
 boolean equals(ValueExpression other)
          Determine whether this object is equal to another.
 String getExpressionString()
          Get the raw expression string.
 int hashCode()
          Get the hash code of the expression string.
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.
 void readExternal(ObjectInput in)
          Deserialize this instance.
 BigDecimal resolveBigDecimal()
          Resolve this expression to a decimal value.
 BigDecimal resolveBigDecimal(ValueExpressionResolver resolver)
          Resolve this expression to a decimal value.
 BigInteger resolveBigInteger()
          Resolve this expression to a large integer value.
 BigInteger resolveBigInteger(ValueExpressionResolver resolver)
          Resolve this expression to a large integer value.
 boolean resolveBoolean()
          Resolve this expression to a boolean value.
 boolean resolveBoolean(ValueExpressionResolver resolver)
          Resolve this expression to a boolean value.
 int resolveInt()
          Resolve this expression to an int value.
 int resolveInt(ValueExpressionResolver resolver)
          Resolve this expression to an int value.
 long resolveLong()
          Resolve this expression to a long value.
 long resolveLong(ValueExpressionResolver resolver)
          Resolve this expression to a long value.
 String resolveString()
          Resolve this expression to a string value.
 String resolveString(ValueExpressionResolver resolver)
          Resolve this expression to a string value.
 String toString()
          Get a printable string representation of this object.
 void writeExternal(ObjectOutput out)
          Serialize this instance.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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:
writeExternal in interface Externalizable
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:
readExternal in interface Externalizable
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.

Overrides:
hashCode in class Object
Returns:
the hash code

equals

public boolean equals(Object other)
Determine whether this object is equal to another.

Overrides:
equals in class Object
Parameters:
other - the other object
Returns:
true if they are equal, false otherwise

equals

public boolean equals(ValueExpression other)
Determine whether this object is equal to another.

Parameters:
other - the other object
Returns:
true if they are equal, false otherwise

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 a boolean value.

Returns:
the resolved value

resolveBoolean

public boolean resolveBoolean(ValueExpressionResolver resolver)
Resolve this expression to a boolean value.

Parameters:
resolver - the resolver to use
Returns:
the resolved value

resolveInt

public int resolveInt()
Resolve this expression to an int value.

Returns:
the resolved value

resolveInt

public int resolveInt(ValueExpressionResolver resolver)
Resolve this expression to an int value.

Parameters:
resolver - the resolver to use
Returns:
the resolved value

resolveLong

public long resolveLong()
Resolve this expression to a long value.

Returns:
the resolved value

resolveLong

public long resolveLong(ValueExpressionResolver resolver)
Resolve this expression to a long value.

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

toString

public String toString()
Get a printable string representation of this object.

Overrides:
toString in class Object
Returns:
the string

JBoss Dynamic Model Representation API 1.2.0.Beta1

Copyright © 2010 JBoss, a division of Red Hat, Inc.