/** Reads a scalar, map, or type name. */ public String readDataType() { String name = readWord(); return readDataType(name); }
/** Reads a scalar, map, or type name with {@code name} as a prefix word. */ public String readDataType(String name) { if (name.equals("map")) { if (readChar() != '<') throw unexpected("expected '<'"); String keyType = readDataType(); if (readChar() != ',') throw unexpected("expected ','"); String valueType = readDataType(); if (readChar() != '>') throw unexpected("expected '>'"); return String.format("map<%s, %s>", keyType, valueType); } else { return name; } }
type = reader.readDataType(); break; type = reader.readDataType(); break; type = reader.readDataType(); break; type = reader.readDataType(word); break;
private OneOfElement readOneOf(String documentation) { OneOfElement.Builder builder = OneOfElement.builder() .name(reader.readName()) .documentation(documentation); ImmutableList.Builder<FieldElement> fields = ImmutableList.builder(); ImmutableList.Builder<GroupElement> groups = ImmutableList.builder(); reader.require('{'); while (true) { String nestedDocumentation = reader.readDocumentation(); if (reader.peekChar('}')) break; Location location = reader.location(); String type = reader.readDataType(); if (type.equals("group")) { groups.add(readGroup(location, nestedDocumentation, null)); } else { fields.add(readField(location, nestedDocumentation, null, type)); } } return builder.fields(fields.build()) .groups(groups.build()) .build(); }
if (word.equals("stream")) { builder.requestStreaming(true); type = reader.readDataType(); } else { type = reader.readDataType(word); if (word.equals("stream")) { builder.responseStreaming(true); type = reader.readDataType(); } else { type = reader.readDataType(word);
String name = reader.readDataType(); ImmutableList.Builder<OptionElement> withOptions = ImmutableList.builder(); String target = null;
/** Reads a scalar, map, or type name. */ public String readDataType() { String name = readWord(); return readDataType(name); }
/** Reads a scalar, map, or type name with {@code name} as a prefix word. */ public String readDataType(String name) { if (name.equals("map")) { if (readChar() != '<') throw unexpected("expected '<'"); String keyType = readDataType(); if (readChar() != ',') throw unexpected("expected ','"); String valueType = readDataType(); if (readChar() != '>') throw unexpected("expected '>'"); return String.format("map<%s, %s>", keyType, valueType); } else { return name; } }
type = reader.readDataType(); break; type = reader.readDataType(); break; type = reader.readDataType(); break; type = reader.readDataType(word); break;
private OneOfElement readOneOf(String documentation) { OneOfElement.Builder builder = OneOfElement.builder() .name(reader.readName()) .documentation(documentation); ImmutableList.Builder<FieldElement> fields = ImmutableList.builder(); ImmutableList.Builder<GroupElement> groups = ImmutableList.builder(); reader.require('{'); while (true) { String nestedDocumentation = reader.readDocumentation(); if (reader.peekChar('}')) break; Location location = reader.location(); String type = reader.readDataType(); if (type.equals("group")) { groups.add(readGroup(nestedDocumentation, null)); } else { fields.add(readField(location, nestedDocumentation, null, type)); } } return builder.fields(fields.build()) .groups(groups.build()) .build(); }
if (word.equals("stream")) { builder.requestStreaming(true); type = reader.readDataType(); } else { type = reader.readDataType(word); if (word.equals("stream")) { builder.responseStreaming(true); type = reader.readDataType(); } else { type = reader.readDataType(word);
String name = reader.readDataType(); String target = null; String adapter = null;