Package groovy.model
Class ClosureModel
- java.lang.Object
-
- groovy.model.ClosureModel
-
- All Implemented Interfaces:
NestedValueModel
,ValueModel
public class ClosureModel extends Object implements ValueModel, NestedValueModel
Represents a value model using a closure to extract the value from some source model and an optional write closure for updating the value.
-
-
Constructor Summary
Constructors Constructor Description ClosureModel(ValueModel sourceModel, Closure readClosure)
ClosureModel(ValueModel sourceModel, Closure readClosure, Closure writeClosure)
ClosureModel(ValueModel sourceModel, Closure readClosure, Closure writeClosure, Class type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueModel
getSourceModel()
Class
getType()
Object
getValue()
boolean
isEditable()
void
setValue(Object value)
-
-
-
Constructor Detail
-
ClosureModel
public ClosureModel(ValueModel sourceModel, Closure readClosure)
-
ClosureModel
public ClosureModel(ValueModel sourceModel, Closure readClosure, Closure writeClosure)
-
ClosureModel
public ClosureModel(ValueModel sourceModel, Closure readClosure, Closure writeClosure, Class type)
-
-
Method Detail
-
getSourceModel
public ValueModel getSourceModel()
- Specified by:
getSourceModel
in interfaceNestedValueModel
-
getValue
public Object getValue()
- Specified by:
getValue
in interfaceValueModel
-
setValue
public void setValue(Object value)
- Specified by:
setValue
in interfaceValueModel
-
getType
public Class getType()
- Specified by:
getType
in interfaceValueModel
-
isEditable
public boolean isEditable()
- Specified by:
isEditable
in interfaceValueModel
-
-