/** * Construct a ValidValue given the XML node and the encodingType. * * @param node that contains the validValue * @param encodingType for the enum */ public ValidValue(final Node node, final PrimitiveType encodingType) { name = getAttributeValue(node, "name"); description = getAttributeValueOrNull(node, "description"); value = PrimitiveValue.parse(node.getFirstChild().getNodeValue(), encodingType); sinceVersion = Integer.parseInt(getAttributeValue(node, "sinceVersion", "0")); deprecated = Integer.parseInt(getAttributeValue(node, "deprecated", "0")); checkForValidName(node, name); }
private static void addTypeWithNameCheck(final Map<String, Type> typeByNameMap, final Type type, final Node node) { if (typeByNameMap.get(type.name()) != null) { handleWarning(node, "type already exists for name: " + type.name()); } checkForValidName(node, type.name()); typeByNameMap.put(type.name(), type); }
/** * Construct a Choice given the XML node and the encodingType * * @param node that contains the validValue * @param encodingType for the enum */ public Choice(final Node node, final PrimitiveType encodingType) { name = getAttributeValue(node, "name"); description = getAttributeValueOrNull(node, "description"); value = PrimitiveValue.parse(node.getFirstChild().getNodeValue(), encodingType); sinceVersion = Integer.parseInt(getAttributeValue(node, "sinceVersion", "0")); deprecated = Integer.parseInt(getAttributeValue(node, "deprecated", "0")); // choice values are bit positions (0, 1, 2, 3, 4, etc.) from LSB to MSB if (value.longValue() >= (encodingType.size() * 8)) { throw new IllegalArgumentException("Choice value out of bounds: " + value.longValue()); } checkForValidName(node, name); }
private static void addMessageWithIdCheck( final ObjectHashSet<String> distinctNames, final Map<Long, Message> messageByIdMap, final Message message, final Node node) { if (messageByIdMap.get((long)message.id()) != null) { handleError(node, "message template id already exists: " + message.id()); } if (!distinctNames.add(message.name())) { handleError(node, "message name already exists: " + message.name()); } checkForValidName(node, message.name()); messageByIdMap.put((long)message.id(), message); }
.build(); XmlSchemaParser.checkForValidName(node, field.name());
public void validate(final Node node) { if (type != null) { if (semanticType != null && type.semanticType() != null && !semanticType.equals(type.semanticType())) { handleError(node, "Mismatched semanticType on type and field: " + name); } } checkForValidName(node, name); }
private static void addMessageWithIdCheck( final Map<Long, Message> messageByIdMap, final Message message, final Node node) { if (messageByIdMap.get(Long.valueOf(message.id())) != null) { handleError(node, "message template id already exists: " + message.id()); } checkForValidName(node, message.name()); messageByIdMap.put(Long.valueOf(message.id()), message); }
/** * Construct a ValidValue given the XML node and the encodingType. * * @param node that contains the validValue * @param encodingType for the enum */ public ValidValue(final Node node, final PrimitiveType encodingType) { name = getAttributeValue(node, "name"); description = getAttributeValueOrNull(node, "description"); value = PrimitiveValue.parse(node.getFirstChild().getNodeValue(), encodingType); sinceVersion = Integer.parseInt(getAttributeValue(node, "sinceVersion", "0")); checkForValidName(node, name); }
private static void addTypeWithNameCheck(final Map<String, Type> typeByNameMap, final Type type, final Node node) { if (typeByNameMap.get(type.name()) != null) { handleWarning(node, "type already exists for name: " + type.name()); } checkForValidName(node, type.name()); typeByNameMap.put(type.name(), type); }
/** * Construct a ValidValue given the XML node and the encodingType. * * @param node that contains the validValue * @param encodingType for the enum */ public ValidValue(final Node node, final PrimitiveType encodingType) { name = getAttributeValue(node, "name"); description = getAttributeValueOrNull(node, "description"); value = PrimitiveValue.parse(node.getFirstChild().getNodeValue(), encodingType); sinceVersion = Integer.parseInt(getAttributeValue(node, "sinceVersion", "0")); deprecated = Integer.parseInt(getAttributeValue(node, "deprecated", "0")); checkForValidName(node, name); }
/** * Construct a ValidValue given the XML node and the encodingType. * * @param node that contains the validValue * @param encodingType for the enum */ public ValidValue(final Node node, final PrimitiveType encodingType) { name = getAttributeValue(node, "name"); description = getAttributeValueOrNull(node, "description"); value = PrimitiveValue.parse(node.getFirstChild().getNodeValue(), encodingType); sinceVersion = Integer.parseInt(getAttributeValue(node, "sinceVersion", "0")); deprecated = Integer.parseInt(getAttributeValue(node, "deprecated", "0")); checkForValidName(node, name); }
private static void addTypeWithNameCheck(final Map<String, Type> typeByNameMap, final Type type, final Node node) { if (typeByNameMap.get(type.name()) != null) { handleWarning(node, "type already exists for name: " + type.name()); } checkForValidName(node, type.name()); typeByNameMap.put(type.name(), type); }
private static void addTypeWithNameCheck(final Map<String, Type> typeByNameMap, final Type type, final Node node) { if (typeByNameMap.get(type.name()) != null) { handleWarning(node, "type already exists for name: " + type.name()); } checkForValidName(node, type.name()); typeByNameMap.put(type.name(), type); }
/** * Construct a Choice given the XML node and the encodingType * * @param node that contains the validValue * @param encodingType for the enum */ public Choice(final Node node, final PrimitiveType encodingType) { name = getAttributeValue(node, "name"); description = getAttributeValueOrNull(node, "description"); value = PrimitiveValue.parse(node.getFirstChild().getNodeValue(), encodingType); sinceVersion = Integer.parseInt(getAttributeValue(node, "sinceVersion", "0")); deprecated = Integer.parseInt(getAttributeValue(node, "deprecated", "0")); // choice values are bit positions (0, 1, 2, 3, 4, etc.) from LSB to MSB if (value.longValue() >= (encodingType.size() * 8)) { throw new IllegalArgumentException("Choice value out of bounds: " + value.longValue()); } checkForValidName(node, name); }
/** * Construct a Choice given the XML node and the encodingType * * @param node that contains the validValue * @param encodingType for the enum */ public Choice(final Node node, final PrimitiveType encodingType) { name = getAttributeValue(node, "name"); description = getAttributeValueOrNull(node, "description"); value = PrimitiveValue.parse(node.getFirstChild().getNodeValue(), encodingType); sinceVersion = Integer.parseInt(getAttributeValue(node, "sinceVersion", "0")); // choice values are bit positions (0, 1, 2, 3, 4, etc.) from LSB to MSB if (value.longValue() >= (encodingType.size() * 8)) { throw new IllegalArgumentException("Choice value out of bounds: " + value.longValue()); } checkForValidName(node, name); }
/** * Construct a Choice given the XML node and the encodingType * * @param node that contains the validValue * @param encodingType for the enum */ public Choice(final Node node, final PrimitiveType encodingType) { name = getAttributeValue(node, "name"); description = getAttributeValueOrNull(node, "description"); value = PrimitiveValue.parse(node.getFirstChild().getNodeValue(), encodingType); sinceVersion = Integer.parseInt(getAttributeValue(node, "sinceVersion", "0")); deprecated = Integer.parseInt(getAttributeValue(node, "deprecated", "0")); // choice values are bit positions (0, 1, 2, 3, 4, etc.) from LSB to MSB if (value.longValue() >= (encodingType.size() * 8)) { throw new IllegalArgumentException("Choice value out of bounds: " + value.longValue()); } checkForValidName(node, name); }
private Field parseGroupField(final NodeList nodeList, final int nodeIndex) throws XPathExpressionException { final String dimensionTypeName = getAttributeValue(nodeList.item(nodeIndex), "dimensionType", "groupSizeEncoding"); Type dimensionType = typeByNameMap.get(dimensionTypeName); if (dimensionType == null) { handleError(nodeList.item(nodeIndex), "could not find dimensionType: " + dimensionTypeName); } else if (!(dimensionType instanceof CompositeType)) { handleError(nodeList.item(nodeIndex), "dimensionType should be a composite type: " + dimensionTypeName); dimensionType = null; } else { ((CompositeType)dimensionType).checkForWellFormedGroupSizeEncoding(nodeList.item(nodeIndex)); } 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"))) .blockLength(Integer.parseInt(getAttributeValue(nodeList.item(nodeIndex), "blockLength", "0"))) .sinceVersion(Integer.parseInt(getAttributeValue(nodeList.item(nodeIndex), "sinceVersion", "0"))) .dimensionType((CompositeType)dimensionType) .build(); XmlSchemaParser.checkForValidName(nodeList.item(nodeIndex), field.name()); field.groupFields(parseFieldsAndGroups(nodeList.item(nodeIndex))); // recursive call return field; }
private static void addMessageWithIdCheck( final ObjectHashSet<String> distinctNames, final Map<Long, Message> messageByIdMap, final Message message, final Node node) { if (messageByIdMap.get((long)message.id()) != null) { handleError(node, "message template id already exists: " + message.id()); } if (!distinctNames.add(message.name())) { handleError(node, "message name already exists: " + message.name()); } checkForValidName(node, message.name()); messageByIdMap.put((long)message.id(), message); }
private static void addMessageWithIdCheck( final ObjectHashSet<String> distinctNames, final Map<Long, Message> messageByIdMap, final Message message, final Node node) { if (messageByIdMap.get((long)message.id()) != null) { handleError(node, "message template id already exists: " + message.id()); } if (!distinctNames.add(message.name())) { handleError(node, "message name already exists: " + message.name()); } checkForValidName(node, message.name()); messageByIdMap.put((long)message.id(), message); }