public abstract class ModelASTValue extends ModelASTElement implements ModelASTMethodArg
ModelASTEnvironment
, ModelASTNamedArgumentList
and elsewhere.Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static ModelASTValue |
fromConstant(Object o,
Object sourceLocation) |
static ModelASTValue |
fromGString(String gstring,
Object sourceLocation) |
Object |
getValue()
Returns a value or an expression that represents this value.
|
int |
hashCode() |
abstract boolean |
isLiteral()
If the value can be determined without side-effect at AST parsing time,
this method returns true, and
getValue() returns its value. |
net.sf.json.JSONObject |
toJSON()
Translates this element and any children it may have into JSON conforming to the schema.
|
String |
toString() |
getSourceLocation, removeSourceLocation, setSourceLocation, toGroovy, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
removeSourceLocation, toGroovy, validate
public abstract boolean isLiteral()
getValue()
returns its value.true
if the value can be determined without side-effects at AST parsing time.public Object getValue()
secret('12345')
or even pow(2,10)
.
In case the value is an expression, this method returns a string represntation
suitable for the editor.
For example, if the value is foobar(x)
, we want the editor to show
"${foobar(x)}"public net.sf.json.JSONObject toJSON()
ModelASTElement
toJSON
in interface ModelASTMethodArg
toJSON
in class ModelASTElement
JSONObject
or JSONArray
but for some leaf nodes, may be a String
or
other simple class.public boolean equals(Object o)
ModelASTElement
equals
in class ModelASTElement
public int hashCode()
ModelASTElement
hashCode
in class ModelASTElement
public String toString()
ModelASTElement
toString
in class ModelASTElement
public static ModelASTValue fromConstant(Object o, Object sourceLocation)
public static ModelASTValue fromGString(String gstring, Object sourceLocation)
Copyright © 2016–2017. All rights reserved.