# Class TextFormatParseInfoTree (3.19.4)

    public class TextFormatParseInfoTree

Data structure which is populated with the locations of each field value parsed from the text.

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.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> TextFormatParseInfoTree

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Methods

### builder()

    public static TextFormatParseInfoTree.Builder builder()

Create a builder for a `ParseInfoTree`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TextFormatParseInfoTree.Builder` | the builder |

## Methods

### getLocation(Descriptors.FieldDescriptor fieldDescriptor, int index)

    public TextFormatParseLocation getLocation(Descriptors.FieldDescriptor fieldDescriptor, int index)

Get the location in the source of a field's value.

Returns the [TextFormatParseLocation](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TextFormatParseLocation) for index-th value of the field in the parsed
text.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `fieldDescriptor` | `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.FieldDescriptor` the [FieldDescriptor](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.FieldDescriptor) of the desired field |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` the index of the value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TextFormatParseLocation` | the [TextFormatParseLocation](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TextFormatParseLocation) of the value |

### getLocations(Descriptors.FieldDescriptor fieldDescriptor)

    public List<TextFormatParseLocation> getLocations(Descriptors.FieldDescriptor fieldDescriptor)

Retrieve all the locations of a field.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `fieldDescriptor` | `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.FieldDescriptor` the [FieldDescriptor](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.FieldDescriptor) of the desired field |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TextFormatParseLocation>` | a list of the locations of values of the field. If there are not values or the field doesn't exist, an empty list is returned. |

### getNestedTree(Descriptors.FieldDescriptor fieldDescriptor, int index)

    public TextFormatParseInfoTree getNestedTree(Descriptors.FieldDescriptor fieldDescriptor, int index)

Returns the parse info tree for the given field, which must be a message type.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `fieldDescriptor` | `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.FieldDescriptor` the [FieldDescriptor](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.FieldDescriptor) of the desired sub message |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` the index of message value. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TextFormatParseInfoTree` | the `ParseInfoTree` of the message value. `null` is returned if the field doesn't exist or the index is out of range. |

### getNestedTrees(Descriptors.FieldDescriptor fieldDescriptor)

    public List<TextFormatParseInfoTree> getNestedTrees(Descriptors.FieldDescriptor fieldDescriptor)

Retrieve a list of all the location information trees for a sub message field.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `fieldDescriptor` | `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.FieldDescriptor` the [FieldDescriptor](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.FieldDescriptor) of the desired field |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TextFormatParseInfoTree>` | A list of [TextFormatParseInfoTree](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TextFormatParseInfoTree) |