public class TextFormatParseInfoTree
extends java.lang.Object
The locations of primary fields values are retrieved by getLocation
or getLocations
. The locations of sub message values are within nested TextFormatParseInfoTree
s and are retrieve by getNestedTree
or getNestedTrees
.
The TextFormatParseInfoTree
is created by a Builder.
Modifier and Type | Class and Description |
---|---|
static class |
TextFormatParseInfoTree.Builder
Builder for a
TextFormatParseInfoTree . |
Modifier and Type | Method and Description |
---|---|
static TextFormatParseInfoTree.Builder |
builder()
Create a builder for a
ParseInfoTree . |
TextFormatParseLocation |
getLocation(Descriptors.FieldDescriptor fieldDescriptor,
int index)
Get the location in the source of a field's value.
|
java.util.List<TextFormatParseLocation> |
getLocations(Descriptors.FieldDescriptor fieldDescriptor)
Retrieve all the locations of a field.
|
TextFormatParseInfoTree |
getNestedTree(Descriptors.FieldDescriptor fieldDescriptor,
int index)
Returns the parse info tree for the given field, which must be a message type.
|
java.util.List<TextFormatParseInfoTree> |
getNestedTrees(Descriptors.FieldDescriptor fieldDescriptor)
Retrieve a list of all the location information trees for a sub message field.
|
public java.util.List<TextFormatParseLocation> getLocations(Descriptors.FieldDescriptor fieldDescriptor)
fieldDescriptor
- the @{link FieldDescriptor} of the desired fieldpublic TextFormatParseLocation getLocation(Descriptors.FieldDescriptor fieldDescriptor, int index)
Returns the TextFormatParseLocation
for index-th value of the field in the parsed
text.
fieldDescriptor
- the @{link FieldDescriptor} of the desired fieldindex
- the index of the value.TextFormatParseLocation
of the valuejava.lang.IllegalArgumentException
- index is out of rangepublic java.util.List<TextFormatParseInfoTree> getNestedTrees(Descriptors.FieldDescriptor fieldDescriptor)
fieldDescriptor
- the @{link FieldDescriptor} of the desired fieldTextFormatParseInfoTree
public TextFormatParseInfoTree getNestedTree(Descriptors.FieldDescriptor fieldDescriptor, int index)
fieldDescriptor
- the @{link FieldDescriptor} of the desired sub messageindex
- the index of message value.ParseInfoTree
of the message value. null
is returned if the field
doesn't exist or the index is out of range.java.lang.IllegalArgumentException
- if index is out of rangepublic static TextFormatParseInfoTree.Builder builder()
ParseInfoTree
.