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
TextFormatParseInfoTrees 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 | Field and Description |
|---|---|
private java.util.Map<Descriptors.FieldDescriptor,java.util.List<TextFormatParseLocation>> |
locationsFromField |
(package private) java.util.Map<Descriptors.FieldDescriptor,java.util.List<TextFormatParseInfoTree>> |
subtreesFromField |
| Modifier | Constructor and Description |
|---|---|
private |
TextFormatParseInfoTree(java.util.Map<Descriptors.FieldDescriptor,java.util.List<TextFormatParseLocation>> locationsFromField,
java.util.Map<Descriptors.FieldDescriptor,java.util.List<TextFormatParseInfoTree.Builder>> subtreeBuildersFromField)
Construct a
TextFormatParseInfoTree. |
| Modifier and Type | Method and Description |
|---|---|
static TextFormatParseInfoTree.Builder |
builder()
Create a builder for a
ParseInfoTree. |
private static <T> T |
getFromList(java.util.List<T> list,
int index,
Descriptors.FieldDescriptor fieldDescriptor) |
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.
|
private java.util.Map<Descriptors.FieldDescriptor,java.util.List<TextFormatParseLocation>> locationsFromField
java.util.Map<Descriptors.FieldDescriptor,java.util.List<TextFormatParseInfoTree>> subtreesFromField
private TextFormatParseInfoTree(java.util.Map<Descriptors.FieldDescriptor,java.util.List<TextFormatParseLocation>> locationsFromField, java.util.Map<Descriptors.FieldDescriptor,java.util.List<TextFormatParseInfoTree.Builder>> subtreeBuildersFromField)
TextFormatParseInfoTree.locationsFromField - a map of fields to location in the source codesubtreeBuildersFromField - a map of fields to parse tree location information builderspublic java.util.List<TextFormatParseLocation> getLocations(Descriptors.FieldDescriptor fieldDescriptor)
fieldDescriptor - the 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 fieldTextFormatParseInfoTreepublic 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.private static <T> T getFromList(java.util.List<T> list,
int index,
Descriptors.FieldDescriptor fieldDescriptor)