public interface SoyObjectType extends SoyType
Object types are always referred to by their fully-qualified name; That is, there's no concept of packages or scopes in this type system (those concepts are already factored out before the type definition reaches this point.)
Important: Do not use outside of Soy code (treat as superpackage-private).
SoyType.Kind| Modifier and Type | Method and Description |
|---|---|
String |
getFieldAccessExpr(String fieldContainerExpr,
String fieldName,
SoyBackendKind backend)
Return the expression used to access the value of the field, for a given output context.
|
com.google.common.collect.ImmutableSet<String> |
getFieldAccessImports(String fieldName,
SoyBackendKind backend)
In some cases,
accessing a field requires importing
symbols into the generated code (example being protobuf extension fields which
require importing the extension type). |
com.google.common.collect.ImmutableSet<String> |
getFieldNames()
Return all the possible field names that can be referenced from this ObjectType.
|
SoyType |
getFieldType(String fieldName)
Return the data type of the field with the given name; If there's no such
field, then return
null. |
String |
getName()
Return the fully-qualified name of this object type.
|
String |
getNameForBackend(SoyBackendKind backend)
Return the fully-qualified name of this type for a given output context.
|
getKind, isAssignableFrom, isInstance, javaTypeString getName()
String getNameForBackend(SoyBackendKind backend)
backend - Which backend we're generating code for.SoyType getFieldType(String fieldName)
null.fieldName - The name of the field.com.google.common.collect.ImmutableSet<String> getFieldNames()
String getFieldAccessExpr(String fieldContainerExpr, String fieldName, SoyBackendKind backend)
fieldContainerExpr - An expression that evaluates to the container of the named field.
This expression may have any operator precedence that binds more tightly than unary
operators.fieldName - Name of the field.backend - Which backend we're generating code for.com.google.common.collect.ImmutableSet<String> getFieldAccessImports(String fieldName, SoyBackendKind backend)
accessing a field requires importing
symbols into the generated code (example being protobuf extension fields which
require importing the extension type). If this field requires imports, then this
method will return the strings representing the symbol needed to import.
Otherwise, returns the empty set.fieldName - The name of the field being accessed.backend - Which backend we're generating code for.