public abstract class BuckStarlarkStructObject extends Object implements com.google.devtools.build.lib.syntax.ClassObject, com.google.devtools.build.lib.skylarkinterface.SkylarkValue
ClassObject
.
This also marks it as a SkylarkValue
.
A struct like object is an object containing fields accessible via the dot syntax, like obj.field
.
We currently do not support method calls.
Constructor and Description |
---|
BuckStarlarkStructObject() |
Modifier and Type | Method and Description |
---|---|
protected abstract Class<?> |
getDeclaredClass() |
String |
getErrorMessageForUnknownField(String field) |
com.google.common.collect.ImmutableCollection<String> |
getFieldNames() |
protected com.google.common.collect.ImmutableMap<String,Method> |
getMethods() |
Object |
getValue(String name) |
void |
repr(com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter printer) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
@Nullable public Object getValue(String name) throws com.google.devtools.build.lib.syntax.EvalException
getValue
in interface com.google.devtools.build.lib.syntax.ClassObject
com.google.devtools.build.lib.syntax.EvalException
protected abstract Class<?> getDeclaredClass()
public com.google.common.collect.ImmutableCollection<String> getFieldNames()
getFieldNames
in interface com.google.devtools.build.lib.syntax.ClassObject
@Nullable public String getErrorMessageForUnknownField(String field)
getErrorMessageForUnknownField
in interface com.google.devtools.build.lib.syntax.ClassObject
public void repr(com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter printer)
repr
in interface com.google.devtools.build.lib.skylarkinterface.SkylarkPrintable