| Package | Description |
|---|---|
| com.google.template.soy.exprtree |
Expression parse tree.
|
| com.google.template.soy.jbcsrc.restricted | |
| com.google.template.soy.passes | |
| com.google.template.soy.shared.internal |
Internal shared class among multiple backends.
|
| com.google.template.soy.soyparse | |
| com.google.template.soy.soytree.defn |
Nodes for representing various kinds of variable and parameter definitions.
|
| com.google.template.soy.types |
Classes that represent Soy parameter type declarations.
|
| Modifier and Type | Method and Description |
|---|---|
SoyType |
ExprNode.getType()
Gets the data type of this node.
|
SoyType |
VarRefNode.getType() |
SoyType |
AbstractParentExprNode.getType() |
SoyType |
GlobalNode.getType() |
SoyType |
VarDefn.type()
Returns the data type of this variable.
|
| Modifier and Type | Method and Description |
|---|---|
void |
GlobalNode.resolve(SoyType soyType,
ExprNode.PrimitiveNode value) |
void |
VarRefNode.setSubstituteType(SoyType type)
Override the type of the variable when used in this context.
|
void |
AbstractParentExprNode.setType(SoyType type) |
| Constructor and Description |
|---|
AbstractParentExprNode(SoyType type,
SourceLocation sourceLocation) |
| Modifier and Type | Method and Description |
|---|---|
SoyType |
SoyRuntimeType.soyType() |
SoyType |
SoyExpression.soyType()
Returns the
SoyType of the expression. |
| Modifier and Type | Method and Description |
|---|---|
static SoyExpression |
SoyExpression.forSoyValue(SoyType type,
Expression delegate) |
static SoyRuntimeType |
SoyRuntimeType.getBoxedType(SoyType soyType)
Returns the boxed representation of the given type.
|
static com.google.common.base.Optional<SoyRuntimeType> |
SoyRuntimeType.getUnboxedType(SoyType soyType)
Returns the unboxed
jbcsrc representation of the given type, or absent if no such
representation exists. |
| Modifier and Type | Field and Description |
|---|---|
com.google.common.collect.Multimap<String,SoyType> |
FindIndirectParamsVisitor.indirectParamTypes
Multimap from indirect param key to param types.
|
com.google.common.collect.Multimap<String,SoyType> |
FindIndirectParamsVisitor.IndirectParamsInfo.indirectParamTypes
Multimap from indirect param key to param types.
|
| Constructor and Description |
|---|
IndirectParamsInfo(SortedMap<String,TemplateParam> indirectParams,
com.google.common.collect.Multimap<String,TemplateNode> paramKeyToCalleesMultimap,
com.google.common.collect.Multimap<String,SoyType> indirectParamTypes,
boolean mayHaveIndirectParamsInExternalCalls,
boolean mayHaveIndirectParamsInExternalDelCalls) |
| Modifier and Type | Method and Description |
|---|---|
abstract SoyType |
ResolvedSignature.returnType()
Return type.
|
| Modifier and Type | Method and Description |
|---|---|
abstract com.google.common.collect.ImmutableList<SoyType> |
ResolvedSignature.parameterTypes()
A list of parameter types.
|
| Modifier and Type | Method and Description |
|---|---|
static ResolvedSignature |
ResolvedSignature.create(com.google.common.collect.ImmutableList<SoyType> parameterTypes,
SoyType returnType) |
| Modifier and Type | Method and Description |
|---|---|
static ResolvedSignature |
ResolvedSignature.create(com.google.common.collect.ImmutableList<SoyType> parameterTypes,
SoyType returnType) |
| Modifier and Type | Method and Description |
|---|---|
static SoyType |
SoyFileParser.parseType(String typeText,
SoyTypeRegistry typeRegistry,
String filePath,
ErrorReporter errorReporter)
Attempts to parse the given input as a type node.
|
| Modifier and Type | Method and Description |
|---|---|
SoyType |
SoyDocParam.type() |
| Modifier and Type | Method and Description |
|---|---|
void |
LocalVar.setType(SoyType type)
Setter for the type - this is necessary because sometimes we don't know the variable type until
after analysis.
|
| Constructor and Description |
|---|
HeaderParam(String name,
SourceLocation nameLocation,
SoyType type,
TypeNode typeNode,
boolean isRequired,
boolean isInjected,
String desc) |
InjectedParam(String name,
SoyType type) |
LocalVar(String name,
SoyNode.LocalVarNode declaringNode,
SoyType type) |
LoopVar(String name,
SoyNode.LocalVarNode declaringNode,
SoyType type) |
TemplateParam(String name,
SoyType type,
boolean isRequired,
boolean isInjected,
String desc,
SourceLocation nameLocation) |
| Modifier and Type | Interface and Description |
|---|---|
interface |
SoyObjectType
Type representing an object.
|
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractMapType
Abstract base class for
LegacyObjectMapType and MapType. |
class |
AnyType
The "any" type is the supertype of all other types.
|
class |
BoolType
Soy boolean type.
|
class |
ErrorType
A placeholder for errors during parsing.
|
class |
FloatType
Soy floating-point type.
|
class |
IntType
Soy integer type.
|
class |
LegacyObjectMapType
Map type - generalized mapping type with key and value type arguments.
|
class |
ListType
Represents the type of a list, a sequential random-access container keyed by integer.
|
class |
MapType
Map type - generalized mapping type with key and value type arguments.
|
class |
NullType
The "null" type.
|
class |
RecordType
Dict type - classic dictionary type with string keys.
|
class |
SanitizedType
Implementation of types for sanitized strings, that is strings that are produced by templates
having a "kind" attribute.
|
static class |
SanitizedType.AttributesType
Type produced by templates whose kind is "attributes".
|
static class |
SanitizedType.CssType
Type produced by templates whose kind is "css".
|
static class |
SanitizedType.HtmlType
Type produced by templates whose kind is "html".
|
static class |
SanitizedType.JsType
Type produced by templates whose kind is "js".
|
static class |
SanitizedType.TrustedResourceUriType
Type produced by templates whose kind is "trustedResourceUri".
|
static class |
SanitizedType.UriType
Type produced by templates whose kind is "uri".
|
class |
SoyProtoEnumType
A
SoyType implementation which describes a protocol buffer enum type. |
class |
SoyProtoType
A
SoyType subclass which describes a protocol buffer type. |
class |
StringType
Soy string type.
|
class |
UnionType
Type representing a set of possible alternative types.
|
class |
UnknownType
The "unknown" type is used to indicate that the type was unspecified or could not be inferred.
|
| Modifier and Type | Field and Description |
|---|---|
static SoyType |
SoyTypes.NUMBER_TYPE
Shared constant for the 'number' type.
|
| Modifier and Type | Method and Description |
|---|---|
static SoyType |
SoyTypes.computeLowestCommonType(SoyTypeRegistry typeRegistry,
Collection<SoyType> types)
Compute the most specific type that is assignable from all types within a collection.
|
static SoyType |
SoyTypes.computeLowestCommonType(SoyTypeRegistry typeRegistry,
SoyType t0,
SoyType t1)
Compute the most specific type that is assignable from both t0 and t1.
|
SoyType |
ListType.getElementType() |
SoyType |
RecordType.getFieldType(String fieldName) |
SoyType |
SoyProtoType.getFieldType(String fieldName)
Returns the
SoyType of the given field, or null if the field does not exist. |
SoyType |
SoyObjectType.getFieldType(String fieldName)
Return the data type of the field with the given name; If there's no such field, then return
null. |
SoyType |
LegacyObjectMapType.getKeyType() |
SoyType |
MapType.getKeyType() |
abstract SoyType |
AbstractMapType.getKeyType()
Returns the type for keys of this map.
|
SoyType |
SoyTypeRegistry.getOrCreateType(TypeNode node,
ErrorReporter errorReporter)
Converts a TypeNode into a SoyType.
|
SoyType |
SoyTypeRegistry.getOrCreateUnionType(Collection<SoyType> members)
Factory function which creates a union type, given the member types.
|
SoyType |
SoyTypeRegistry.getOrCreateUnionType(SoyType... members)
Factory function which creates a union type, given the member types.
|
static SoyType |
SoyTypes.getSoyTypeForBinaryOperator(SoyType t0,
SoyType t1,
SoyTypes.SoyTypeBinaryOperator operator)
Returns the
SoyType that should be the result of a binary operator. |
SoyType |
SoyTypeRegistry.getType(String typeName)
Look up a type by name.
|
static SoyType |
SanitizedType.getTypeForContentKind(SanitizedContentKind contentKind)
Given a content kind, return the corresponding soy type.
|
SoyType |
LegacyObjectMapType.getValueType() |
SoyType |
MapType.getValueType() |
abstract SoyType |
AbstractMapType.getValueType()
Returns the type for values in this map.
|
static SoyType |
SoyTypes.makeNullable(SoyType type) |
static SoyType |
UnionType.of(Collection<SoyType> members)
Create a union from a collection of types.
|
static SoyType |
UnionType.of(SoyType... members)
Convenience method for creating unions.
|
static SoyType |
SoyTypes.removeNull(SoyType type) |
SoyType |
UnionType.removeNullability()
Returns a Soy type that is equivalent to this one but with 'null' removed.
|
SoyType |
SoyTypes.SoyTypeBinaryOperator.resolve(SoyType left,
SoyType right) |
SoyType |
SoyTypes.SoyTypeEqualComparisonOp.resolve(SoyType left,
SoyType right) |
SoyType |
SoyTypes.SoyTypeComparisonOp.resolve(SoyType left,
SoyType right) |
SoyType |
SoyTypes.SoyTypePlusOperator.resolve(SoyType left,
SoyType right) |
SoyType |
SoyTypes.SoyTypeArithmeticOperator.resolve(SoyType left,
SoyType right) |
static SoyType |
SoyTypes.tryRemoveNull(SoyType soyType)
If the type is nullable, makes it non-nullable.
|
| Modifier and Type | Method and Description |
|---|---|
static com.google.common.base.Optional<SoyType> |
SoyTypes.computeLowestCommonTypeArithmetic(SoyType t0,
SoyType t1)
Compute the most specific type that is assignable from both t0 and t1, taking into account
arithmetic promotions - that is, converting int to float if needed.
|
com.google.common.collect.ImmutableSortedMap<String,SoyType> |
RecordType.getMembers()
Return the members of this record type.
|
Set<SoyType> |
UnionType.getMembers()
Return the set of types contained in this union.
|
| Modifier and Type | Method and Description |
|---|---|
static SoyType |
SoyTypes.computeLowestCommonType(SoyTypeRegistry typeRegistry,
SoyType t0,
SoyType t1)
Compute the most specific type that is assignable from both t0 and t1.
|
static com.google.common.base.Optional<SoyType> |
SoyTypes.computeLowestCommonTypeArithmetic(SoyType t0,
SoyType t1)
Compute the most specific type that is assignable from both t0 and t1, taking into account
arithmetic promotions - that is, converting int to float if needed.
|
LegacyObjectMapType |
SoyTypeRegistry.getOrCreateLegacyObjectMapType(SoyType keyType,
SoyType valueType)
Factory function which creates a legacy object map type, given a key and value type.
|
ListType |
SoyTypeRegistry.getOrCreateListType(SoyType elementType)
Factory function which creates a list type, given an element type.
|
MapType |
SoyTypeRegistry.getOrCreateMapType(SoyType keyType,
SoyType valueType)
Factory function which creates a map type, given a key and value type.
|
SoyType |
SoyTypeRegistry.getOrCreateUnionType(SoyType... members)
Factory function which creates a union type, given the member types.
|
static SoyType |
SoyTypes.getSoyTypeForBinaryOperator(SoyType t0,
SoyType t1,
SoyTypes.SoyTypeBinaryOperator operator)
Returns the
SoyType that should be the result of a binary operator. |
boolean |
LegacyObjectMapType.isAssignableFrom(SoyType srcType) |
boolean |
StringType.isAssignableFrom(SoyType srcType) |
boolean |
RecordType.isAssignableFrom(SoyType srcType) |
boolean |
UnknownType.isAssignableFrom(SoyType srcType) |
boolean |
ListType.isAssignableFrom(SoyType srcType) |
boolean |
ErrorType.isAssignableFrom(SoyType srcType) |
boolean |
SoyProtoEnumType.isAssignableFrom(SoyType fromType) |
boolean |
SoyProtoType.isAssignableFrom(SoyType fromType) |
boolean |
MapType.isAssignableFrom(SoyType srcType) |
boolean |
SoyType.isAssignableFrom(SoyType srcType)
Returns true if a parameter or field of this type can be assigned from a value of
srcType. |
boolean |
IntType.isAssignableFrom(SoyType srcType) |
boolean |
AnyType.isAssignableFrom(SoyType srcType) |
boolean |
UnionType.isAssignableFrom(SoyType srcType) |
static boolean |
SoyTypes.isNullable(SoyType type) |
static boolean |
SoyTypes.isNumericOrUnknown(SoyType type) |
static boolean |
SoyTypes.isNumericPrimitive(SoyType type)
Returns true if the input type is a numeric primitive type, such as int, float, proto enum, and
number.
|
static SoyType |
SoyTypes.makeNullable(SoyType type) |
static SoyType |
UnionType.of(SoyType... members)
Convenience method for creating unions.
|
static ListType |
ListType.of(SoyType elementType) |
static LegacyObjectMapType |
LegacyObjectMapType.of(SoyType keyType,
SoyType valueType) |
static MapType |
MapType.of(SoyType keyType,
SoyType valueType) |
static SoyType |
SoyTypes.removeNull(SoyType type) |
SoyType |
SoyTypes.SoyTypeBinaryOperator.resolve(SoyType left,
SoyType right) |
SoyType |
SoyTypes.SoyTypeEqualComparisonOp.resolve(SoyType left,
SoyType right) |
SoyType |
SoyTypes.SoyTypeComparisonOp.resolve(SoyType left,
SoyType right) |
SoyType |
SoyTypes.SoyTypePlusOperator.resolve(SoyType left,
SoyType right) |
SoyType |
SoyTypes.SoyTypeArithmeticOperator.resolve(SoyType left,
SoyType right) |
static SoyType |
SoyTypes.tryRemoveNull(SoyType soyType)
If the type is nullable, makes it non-nullable.
|
| Modifier and Type | Method and Description |
|---|---|
static SoyType |
SoyTypes.computeLowestCommonType(SoyTypeRegistry typeRegistry,
Collection<SoyType> types)
Compute the most specific type that is assignable from all types within a collection.
|
RecordType |
SoyTypeRegistry.getOrCreateRecordType(Map<String,SoyType> fields)
Factory function which creates a record type, given a map of fields.
|
SoyType |
SoyTypeRegistry.getOrCreateUnionType(Collection<SoyType> members)
Factory function which creates a union type, given the member types.
|
static SoyType |
UnionType.of(Collection<SoyType> members)
Create a union from a collection of types.
|
static RecordType |
RecordType.of(Map<String,? extends SoyType> members) |