SoyType.Kind| Constructor and Description |
|---|
SoyProtoType(SoyTypeRegistry typeRegistry,
com.google.protobuf.Descriptors.Descriptor descriptor,
Set<com.google.protobuf.Descriptors.FieldDescriptor> extensions) |
| Modifier and Type | Method and Description |
|---|---|
com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
String |
getDescriptorExpression()
For ParseInfo generation, return a string that represents the Java source expression for the
static descriptor constant.
|
com.google.protobuf.Descriptors.FieldDescriptor |
getFieldDescriptor(String fieldName)
Returns the
Descriptors.FieldDescriptor of the given field. |
com.google.common.collect.ImmutableSet<String> |
getFieldNames()
Returns all the field names of this proto.
|
SoyType |
getFieldType(String fieldName)
Returns the
SoyType of the given field, or null if the field does not exist. |
SoyType.Kind |
getKind()
Returns what kind of type this is.
|
String |
getNameForBackend(SoyBackendKind backend)
Returns this proto's type name for the given backend.
|
boolean |
isAssignableFrom(SoyType fromType)
Returns true if a parameter or field of this type can be assigned from a value of
srcType. |
boolean |
shouldCheckFieldPresenceToEmulateJspbNullability(String fieldName)
Whether or not server side emuluation of jspb semantics needs to check for field presence and
return null for absent fields.
|
String |
toString() |
public SoyProtoType(SoyTypeRegistry typeRegistry, com.google.protobuf.Descriptors.Descriptor descriptor, Set<com.google.protobuf.Descriptors.FieldDescriptor> extensions)
public SoyType.Kind getKind()
SoyTypepublic boolean isAssignableFrom(SoyType fromType)
SoyTypesrcType.isAssignableFrom in interface SoyTypefromType - The type of the incoming value.public com.google.protobuf.Descriptors.Descriptor getDescriptor()
public String getDescriptorExpression()
public com.google.protobuf.Descriptors.FieldDescriptor getFieldDescriptor(String fieldName)
Descriptors.FieldDescriptor of the given field.@Nullable public SoyType getFieldType(String fieldName)
SoyType of the given field, or null if the field does not exist.public com.google.common.collect.ImmutableSet<String> getFieldNames()
public String getNameForBackend(SoyBackendKind backend)
public boolean shouldCheckFieldPresenceToEmulateJspbNullability(String fieldName)
This isn't necessary in the JS backends because we can rely on the proto->JS compiler to create these semantics.