T - the return type of the visit methodspublic abstract class FieldVisitor<T> extends Object
| Constructor and Description |
|---|
FieldVisitor() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
visitBool()
Visits a boolean valued field that should be interpreted as a soy bool.
|
protected abstract T |
visitBytes()
Visits a bytes valued field that should be interpreted as a base64 encoded soy string.
|
protected abstract T |
visitDoubleAsFloat()
Visits a doubble valued field that should be interpreted as a soy float.
|
protected abstract T |
visitEnum(com.google.protobuf.Descriptors.EnumDescriptor enumType)
Visits a enum typed field that should be interpted as a soy enum type.
|
static <T> T |
visitField(com.google.protobuf.Descriptors.FieldDescriptor fieldDescriptor,
FieldVisitor<T> visitor)
Applies the visitor to the given field.
|
protected abstract T |
visitFloat()
Visits a float valued field that should be interpreted as a soy float.
|
protected abstract T |
visitInt()
Visits an int valued field that should be interpreted as a soy int.
|
protected abstract T |
visitJspbMap(com.google.protobuf.Descriptors.FieldDescriptor keyField,
T valueValue)
Proto
map fields are handled by visitMap(com.google.protobuf.Descriptors.FieldDescriptor, T, T). |
protected abstract T |
visitLongAsInt()
Visits a long valued field that should be interpreted as a soy int.
|
protected abstract T |
visitLongAsString()
Visits a long valued field that should be interpreted as a soy string.
|
protected abstract T |
visitMap(com.google.protobuf.Descriptors.FieldDescriptor mapField,
T keyValue,
T valueValue)
Visits a proto map field.
|
protected abstract T |
visitMessage(com.google.protobuf.Descriptors.Descriptor messageType)
Visits a message typed field that should be interpted as a soy proto type.
|
protected abstract T |
visitRepeated(T value)
Visits a repeated field.
|
protected abstract T |
visitSafeHtml()
Visits a SafeHtmlProto field that should be interpreted as a soy html object.
|
protected abstract T |
visitSafeScript()
Visits a SafeScriptProto field that should be interpreted as a soy js object.
|
protected abstract T |
visitSafeStyle()
Visits a SafeStyleProto field that should be interpreted as a soy css object.
|
protected abstract T |
visitSafeStyleSheet()
Visits a SafeStyleSheetProto field that should be interpreted as a soy css object.
|
protected abstract T |
visitSafeUrl()
Visits a SafeUrlProto field that should be interpreted as a soy uri object.
|
protected abstract T |
visitString()
Visits a string valued field that should be interpreted as a soy string.
|
protected abstract T |
visitTrustedResourceUrl()
Visits a TrustedResourceUrlProto field that should be interpreted as a soy trusted_resource_url
object.
|
protected abstract T |
visitUnsignedInt()
Visits an unsigned int valued field that should be interpreted as a soy int.
|
protected abstract T |
visitUnsignedLongAsString()
Visits an unsigned long valued field that should be interpreted as a soy string.
|
public static <T> T visitField(com.google.protobuf.Descriptors.FieldDescriptor fieldDescriptor,
FieldVisitor<T> visitor)
protected abstract T visitMap(com.google.protobuf.Descriptors.FieldDescriptor mapField, T keyValue, T valueValue)
protected abstract T visitJspbMap(com.google.protobuf.Descriptors.FieldDescriptor keyField, T valueValue)
map fields are handled by visitMap(com.google.protobuf.Descriptors.FieldDescriptor, T, T). But before protos had a map type,
JSPB had a map_key field annotation that simulated map behavior at runtime. They're
still out there, somewhere, so we have to support them.
TODO(b/70671325): Investigate if we can drop support for this.
keyField - the field of the message that is the key field. guaranateed to be a stringvalueValue - the result of evaluating this visitor on the field when interpreted as a
scalar.protected abstract T visitRepeated(T value)
value - the result of applying this visitor the field when interpreted as a scalar value.protected abstract T visitLongAsInt()
protected abstract T visitUnsignedInt()
protected abstract T visitUnsignedLongAsString()
protected abstract T visitLongAsString()
protected abstract T visitBool()
protected abstract T visitInt()
protected abstract T visitBytes()
protected abstract T visitString()
protected abstract T visitDoubleAsFloat()
protected abstract T visitFloat()
protected abstract T visitSafeHtml()
protected abstract T visitSafeScript()
protected abstract T visitSafeStyle()
protected abstract T visitSafeStyleSheet()
protected abstract T visitSafeUrl()
protected abstract T visitTrustedResourceUrl()
protected abstract T visitMessage(com.google.protobuf.Descriptors.Descriptor messageType)
protected abstract T visitEnum(com.google.protobuf.Descriptors.EnumDescriptor enumType)