|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.iu.cnets.klatsch.lang.Value
edu.iu.cnets.klatsch.lang.VProperty
public class VProperty
This class encapsulates "properties", which are wrappers around methods contained in the subclasses
of Pane
. In order to invoke one of these methods in Klatsch, you get one of these values
using the prop() method in VPane
, then invoke it like any other procedure. The Pane itself
is stored in the VProperty object, so you don't need to include it at invocation time.
Exposure of a method as a property in a subclass of Pane is as simple as making sure it has the
name "prop_[NAME]".
Field Summary | |
---|---|
(package private) java.lang.String |
name
the name of the primitive |
(package private) Pane |
pane
the pane containing this property |
(package private) java.lang.reflect.Method |
prop
the method to invoke |
Constructor Summary | |
---|---|
VProperty(Pane pane,
java.lang.String name,
java.lang.reflect.Method prop)
Create a new wrapper for a property for the given pane, name, and method. |
Method Summary | |
---|---|
Value |
apply(Value... args)
Invoke the property for which we were instantiated. |
java.lang.String |
toString()
Returns a string representation of the property. |
Methods inherited from class edu.iu.cnets.klatsch.lang.Value |
---|
require, requireCount, requireType, toJson |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
Pane pane
java.lang.String name
java.lang.reflect.Method prop
Constructor Detail |
---|
public VProperty(Pane pane, java.lang.String name, java.lang.reflect.Method prop)
pane
- the pane containing the propertyname
- the property nameprop
- the property implementationMethod Detail |
---|
public Value apply(Value... args) throws EvaluationException
apply
in interface Callable
args
- the arguments to pass in
EvaluationException
- for any runtime errorspublic java.lang.String toString()
toString
in class Value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |