terp - the Codemesh Modular
Template Interpreter v1.3.309

com.codemesh.terp.api
Interface Lvalue

All Known Subinterfaces:
Nvalue
All Known Implementing Classes:
FileContentsSetter.LContents, FileContentsSetter.LLines, FileContentsSetter.LText, IndexOperatorSetter.L, Lvalue.AbstractLvalue, Lvalue.FieldInvoker, Lvalue.ForMap, Lvalue.MethodInvoker, Nvalue.AbstractNvalue

public interface Lvalue

An lvalue that provides access to setting a value. The Lvalue type provides the basic interface for functions that modify the values of variables, members, collections, and any other modifiable objects.

Some objects are not modifiable and are therefore never represented by an Lvalue. A string object for example is immutable. It cannot have its string value changed and it is therefore never represented by an Lvalue. The terp framework creates Lvalue instances when it encounters a modifying operation like an assignment or an increment/decrement operation.

Since:
1.0.0
Author:
Alexander R Krapf

Nested Class Summary
static class Lvalue.AbstractLvalue
           
static class Lvalue.FieldInvoker
           
static class Lvalue.ForMap
          A value getter for a string map.
static class Lvalue.MethodInvoker
           
 
Method Summary
 java.lang.Object set(java.lang.Object value)
          Sets a new value and returns the old one.
 Nvalue toNvalue()
          Returns an Nvalue for the same datum that is represented by this Lvalue.
 Rvalue toRvalue()
          Returns an Rvalue for the same datum that is represented by this Lvalue.
 

Method Detail

set

java.lang.Object set(java.lang.Object value)
Sets a new value and returns the old one.

Parameters:
value - the new value.
Returns:
the old value.
Throws:
TerpException - if an exceptin occurs during the operation.

toRvalue

Rvalue toRvalue()
Returns an Rvalue for the same datum that is represented by this Lvalue.

Returns:
an Rvalue or null if there is no corresponding Rvalue.

toNvalue

Nvalue toNvalue()
Returns an Nvalue for the same datum that is represented by this Lvalue.

Returns:
an Nvalue ot null.

terp - the Codemesh Modular
Template Interpreter v1.3.309

Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.