@Override
    public FieldPath buildFieldPath(String remainFieldName) {
        if (remainFieldName.isEmpty()) return new FieldPath();

        String currFieldName = remainFieldName;
        String subFieldName = "";

        for (int i = 0; i < remainFieldName.length(); i++) {
            if (remainFieldName.charAt(i) == '.') {
                currFieldName = remainFieldName.substring(0, i);
                subFieldName = remainFieldName.substring(i + 1);
                break;
            } else if (remainFieldName.charAt(i) == '{' || remainFieldName.charAt(i) == '[') {
                currFieldName = remainFieldName.substring(0, i);
                subFieldName = remainFieldName.substring(i);
                break;
            }
        }

        Field f = getField(currFieldName);
        if (f != null) {
            FieldPath fieldPath = f.getDataType().buildFieldPath(subFieldName);
            List<FieldPathEntry> tmpPath = new ArrayList<FieldPathEntry>(fieldPath.getList());
            tmpPath.add(0, FieldPathEntry.newStructFieldEntry(f));
            return new FieldPath(tmpPath);
        } else {
            throw new IllegalArgumentException("Field '" + currFieldName + "' not found in " + this);
        }
    }
Gets the field with the specified id.

@param id the id of the field to return.
@return the matching field, or null if not found.
document/src/main/java/com/yahoo/document/StructuredDataType.java