Top Description Inners Methods
org.springframework.expression.spel.ast

public Interface ValueRef

Known Direct Implementers
org.springframework.expression.spel.ast.ValueRef.NullValueRef, org.springframework.expression.spel.ast.ValueRef.TypedValueHolderValueRef, org.springframework.expression.spel.ast.VariableReference.VariableRef, org.springframework.expression.spel.ast.Indexer.ArrayIndexingValueRef, org.springframework.expression.spel.ast.Indexer.MapIndexingValueRef, org.springframework.expression.spel.ast.Indexer.PropertyIndexingValueRef, org.springframework.expression.spel.ast.Indexer.CollectionIndexingValueRef, org.springframework.expression.spel.ast.Indexer.StringIndexingValueRef, org.springframework.expression.spel.ast.MethodReference.MethodValueRef, org.springframework.expression.spel.ast.PropertyOrFieldReference.AccessorValueRef
Imports
org.springframework.expression.TypedValue, org.springframework.expression.spel.SpelEvaluationException, .SpelMessage, org.springframework.lang.Nullable

Represents a reference to a value. With a reference it is possible to get or set the value. Passing around value references rather than the values themselves can avoid incorrect duplication of operand evaluation. For example in 'list[index++]++' without a value reference for 'list[index++]' it would be necessary to evaluate list[index++] twice (once to get the value, once to determine where the value goes) and that would double increment index.
Author
Andy Clement
Since
3.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ValueRef.NullValueRef

A ValueRef for the null value.

public static class
ValueRef.TypedValueHolderValueRef

A ValueRef holder for a single value, which cannot be set.

Method Summary

Modifier and TypeMethod and Description
public TypedValue

Returns:

the value
getValue
()

Returns the value this ValueRef points to, it should not require expression component re-evaluation.

public boolean

Returns:

true if setValue() is supported for this value reference.
isWritable
()

Indicates whether calling setValue(Object) is supported.

public void
setValue(Object
the new value
newValue
)

Sets the value this ValueRef points to, it should not require expression component re-evaluation.

Method Detail

getValueback to summary
public TypedValue getValue()

Returns the value this ValueRef points to, it should not require expression component re-evaluation.

Returns:TypedValue

the value

isWritableback to summary
public boolean isWritable()

Indicates whether calling setValue(Object) is supported.

Returns:boolean

true if setValue() is supported for this value reference.

setValueback to summary
public void setValue(Object newValue)

Sets the value this ValueRef points to, it should not require expression component re-evaluation.

Parameters
newValue:Object

the new value

org.springframework.expression.spel.ast back to summary

public Class ValueRef.NullValueRef

extends Object
implements ValueRef
Class Inheritance
  • java.lang.Object
  • org.springframework.expression.spel.ast.ValueRef.NullValueRef
All Implemented Interfaces
org.springframework.expression.spel.ast.ValueRef

A ValueRef for the null value.

Field Summary

Modifier and TypeField and Description
pack-priv static final ValueRef.NullValueRef

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public TypedValue
getValue()

Implements org.springframework.expression.spel.ast.ValueRef.getValue.

Returns the value this ValueRef points to, it should not require expression component re-evaluation.
public boolean
isWritable()

Implements org.springframework.expression.spel.ast.ValueRef.isWritable.

Indicates whether calling setValue(Object) is supported.
public void
setValue(Object
the new value
newValue
)

Implements org.springframework.expression.spel.ast.ValueRef.setValue.

Sets the value this ValueRef points to, it should not require expression component re-evaluation.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
pack-priv static final ValueRef.NullValueRef INSTANCE

Constructor Detail

NullValueRefback to summary
public NullValueRef()

Method Detail

getValueback to summary
public TypedValue getValue()

Implements org.springframework.expression.spel.ast.ValueRef.getValue.

Doc from org.springframework.expression.spel.ast.ValueRef.getValue.

Returns the value this ValueRef points to, it should not require expression component re-evaluation.

Returns:TypedValue

the value

Annotations
@Override
isWritableback to summary
public boolean isWritable()

Implements org.springframework.expression.spel.ast.ValueRef.isWritable.

Doc from org.springframework.expression.spel.ast.ValueRef.isWritable.

Indicates whether calling setValue(Object) is supported.

Returns:boolean

true if setValue() is supported for this value reference.

Annotations
@Override
setValueback to summary
public void setValue(Object newValue)

Implements org.springframework.expression.spel.ast.ValueRef.setValue.

Doc from org.springframework.expression.spel.ast.ValueRef.setValue.

Sets the value this ValueRef points to, it should not require expression component re-evaluation.

Parameters
newValue:Object

the new value

Annotations
@Override
org.springframework.expression.spel.ast back to summary

public Class ValueRef.TypedValueHolderValueRef

extends Object
implements ValueRef
Class Inheritance
  • java.lang.Object
  • org.springframework.expression.spel.ast.ValueRef.TypedValueHolderValueRef
All Implemented Interfaces
org.springframework.expression.spel.ast.ValueRef

A ValueRef holder for a single value, which cannot be set.

Field Summary

Modifier and TypeField and Description
private final SpelNodeImpl
private final TypedValue

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public TypedValue
getValue()

Implements org.springframework.expression.spel.ast.ValueRef.getValue.

Returns the value this ValueRef points to, it should not require expression component re-evaluation.
public boolean
isWritable()

Implements org.springframework.expression.spel.ast.ValueRef.isWritable.

Indicates whether calling setValue(Object) is supported.
public void
setValue(Object
the new value
newValue
)

Implements org.springframework.expression.spel.ast.ValueRef.setValue.

Sets the value this ValueRef points to, it should not require expression component re-evaluation.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nodeback to summary
private final SpelNodeImpl node
typedValueback to summary
private final TypedValue typedValue

Constructor Detail

TypedValueHolderValueRefback to summary
public TypedValueHolderValueRef(TypedValue typedValue, SpelNodeImpl node)

Method Detail

getValueback to summary
public TypedValue getValue()

Implements org.springframework.expression.spel.ast.ValueRef.getValue.

Doc from org.springframework.expression.spel.ast.ValueRef.getValue.

Returns the value this ValueRef points to, it should not require expression component re-evaluation.

Returns:TypedValue

the value

Annotations
@Override
isWritableback to summary
public boolean isWritable()

Implements org.springframework.expression.spel.ast.ValueRef.isWritable.

Doc from org.springframework.expression.spel.ast.ValueRef.isWritable.

Indicates whether calling setValue(Object) is supported.

Returns:boolean

true if setValue() is supported for this value reference.

Annotations
@Override
setValueback to summary
public void setValue(Object newValue)

Implements org.springframework.expression.spel.ast.ValueRef.setValue.

Doc from org.springframework.expression.spel.ast.ValueRef.setValue.

Sets the value this ValueRef points to, it should not require expression component re-evaluation.

Parameters
newValue:Object

the new value

Annotations
@Override