private Field parseField(final NodeList nodeList, final int nodeIndex) { final Node node = nodeList.item(nodeIndex); final String typeName = getAttributeValue(node, "type"); final Type fieldType = typeByNameMap.get(typeName); if (fieldType == null) { handleError(node, "could not find type: " + typeName); } final Field field = new Field.Builder() .name(getAttributeValue(node, "name")) .description(getAttributeValueOrNull(node, "description")) .id(Integer.parseInt(getAttributeValue(node, "id"))) .offset(Integer.parseInt(getAttributeValue(node, "offset", "0"))) .semanticType(getAttributeValueOrNull(node, "semanticType")) .presence(getPresence(node, fieldType)) .valueRef(getAttributeValueOrNull(node, "valueRef")) .sinceVersion(Integer.parseInt(getAttributeValue(node, "sinceVersion", "0"))) .deprecated(Integer.parseInt(getAttributeValue(node, "deprecated", "0"))) .epoch(getAttributeValueOrNull(node, "epoch")) .timeUnit(getAttributeValueOrNull(node, "timeUnit")) .type(fieldType) .build(); field.validate(node, typeByNameMap); return field; }
.build(); field.validate(node, typeByNameMap);
private Field parseField(final NodeList nodeList, final int nodeIndex) { final String typeName = getAttributeValue(nodeList.item(nodeIndex), "type"); final Type fieldType = typeByNameMap.get(typeName); if (fieldType == null) { handleError(nodeList.item(nodeIndex), "could not find type: " + typeName); } final Field field = new Field.Builder() .name(getAttributeValue(nodeList.item(nodeIndex), "name")) .description(getAttributeValueOrNull(nodeList.item(nodeIndex), "description")) .id(Integer.parseInt(getAttributeValue(nodeList.item(nodeIndex), "id"))) .offset(Integer.parseInt(getAttributeValue(nodeList.item(nodeIndex), "offset", "0"))) .semanticType(getAttributeValueOrNull(nodeList.item(nodeIndex), "semanticType")) .presence(Presence.get(getAttributeValue(nodeList.item(nodeIndex), "presence", "required"))) .sinceVersion(Integer.parseInt(getAttributeValue(nodeList.item(nodeIndex), "sinceVersion", "0"))) .epoch(getAttributeValue(nodeList.item(nodeIndex), "epoch", "unix")) .timeUnit(getAttributeValue(nodeList.item(nodeIndex), "timeUnit", "nanosecond")) .type(fieldType) .build(); field.validate(nodeList.item(nodeIndex)); return field; }
.build(); field.validate(nodeList.item(nodeIndex));
private Field parseField(final NodeList nodeList, final int nodeIndex) { final Node node = nodeList.item(nodeIndex); final String typeName = getAttributeValue(node, "type"); final Type fieldType = typeByNameMap.get(typeName); if (fieldType == null) { handleError(node, "could not find type: " + typeName); } final Field field = new Field.Builder() .name(getAttributeValue(node, "name")) .description(getAttributeValueOrNull(node, "description")) .id(Integer.parseInt(getAttributeValue(node, "id"))) .offset(Integer.parseInt(getAttributeValue(node, "offset", "0"))) .semanticType(getAttributeValueOrNull(node, "semanticType")) .presence(getPresence(node, fieldType)) .valueRef(getAttributeValueOrNull(node, "valueRef")) .sinceVersion(Integer.parseInt(getAttributeValue(node, "sinceVersion", "0"))) .deprecated(Integer.parseInt(getAttributeValue(node, "deprecated", "0"))) .epoch(getAttributeValueOrNull(node, "epoch")) .timeUnit(getAttributeValueOrNull(node, "timeUnit")) .type(fieldType) .build(); field.validate(node, typeByNameMap); return field; }
private Field parseField(final NodeList nodeList, final int nodeIndex) { final Node node = nodeList.item(nodeIndex); final String typeName = getAttributeValue(node, "type"); final Type fieldType = typeByNameMap.get(typeName); if (fieldType == null) { handleError(node, "could not find type: " + typeName); } final Field field = new Field.Builder() .name(getAttributeValue(node, "name")) .description(getAttributeValueOrNull(node, "description")) .id(Integer.parseInt(getAttributeValue(node, "id"))) .offset(Integer.parseInt(getAttributeValue(node, "offset", "0"))) .semanticType(getAttributeValueOrNull(node, "semanticType")) .presence(getPresence(node, fieldType)) .valueRef(getAttributeValueOrNull(node, "valueRef")) .sinceVersion(Integer.parseInt(getAttributeValue(node, "sinceVersion", "0"))) .deprecated(Integer.parseInt(getAttributeValue(node, "deprecated", "0"))) .epoch(getAttributeValueOrNull(node, "epoch")) .timeUnit(getAttributeValueOrNull(node, "timeUnit")) .type(fieldType) .build(); field.validate(node, typeByNameMap); return field; }
.build(); field.validate(node, typeByNameMap);
.build(); field.validate(node, typeByNameMap);