private void streamNormalizedNode(final NormalizedNodeStreamWriter writer, final byte nodeType) throws IOException {
switch (nodeType) {
- case NodeTypes.ANY_XML_NODE:
+ case LithiumNode.ANY_XML_NODE:
streamAnyxml(writer);
break;
- case NodeTypes.AUGMENTATION_NODE:
+ case LithiumNode.AUGMENTATION_NODE:
streamAugmentation(writer);
break;
- case NodeTypes.CHOICE_NODE:
+ case LithiumNode.CHOICE_NODE:
streamChoice(writer);
break;
- case NodeTypes.CONTAINER_NODE:
+ case LithiumNode.CONTAINER_NODE:
streamContainer(writer);
break;
- case NodeTypes.LEAF_NODE:
+ case LithiumNode.LEAF_NODE:
streamLeaf(writer);
break;
- case NodeTypes.LEAF_SET:
+ case LithiumNode.LEAF_SET:
streamLeafSet(writer);
break;
- case NodeTypes.ORDERED_LEAF_SET:
+ case LithiumNode.ORDERED_LEAF_SET:
streamOrderedLeafSet(writer);
break;
- case NodeTypes.LEAF_SET_ENTRY_NODE:
+ case LithiumNode.LEAF_SET_ENTRY_NODE:
streamLeafSetEntry(writer);
break;
- case NodeTypes.MAP_ENTRY_NODE:
+ case LithiumNode.MAP_ENTRY_NODE:
streamMapEntry(writer);
break;
- case NodeTypes.MAP_NODE:
+ case LithiumNode.MAP_NODE:
streamMap(writer);
break;
- case NodeTypes.ORDERED_MAP_NODE:
+ case LithiumNode.ORDERED_MAP_NODE:
streamOrderedMap(writer);
break;
- case NodeTypes.UNKEYED_LIST:
+ case LithiumNode.UNKEYED_LIST:
streamUnkeyedList(writer);
break;
- case NodeTypes.UNKEYED_LIST_ITEM:
+ case LithiumNode.UNKEYED_LIST_ITEM:
streamUnkeyedListItem(writer);
break;
default:
writer.startMapEntryNode(entryIdentifier, NormalizedNodeStreamWriter.UNKNOWN_SIZE);
// Same loop as commonStreamContainer(), but ...
- for (byte nodeType = input.readByte(); nodeType != NodeTypes.END_NODE; nodeType = input.readByte()) {
- if (nodeType == NodeTypes.LEAF_NODE) {
+ for (byte nodeType = input.readByte(); nodeType != LithiumNode.END_NODE; nodeType = input.readByte()) {
+ if (nodeType == LithiumNode.LEAF_NODE) {
// ... leaf nodes may need de-duplication
streamLeaf(writer, entryIdentifier);
} else {
}
private void commonStreamContainer(final NormalizedNodeStreamWriter writer) throws IOException {
- for (byte nodeType = input.readByte(); nodeType != NodeTypes.END_NODE; nodeType = input.readByte()) {
+ for (byte nodeType = input.readByte(); nodeType != LithiumNode.END_NODE; nodeType = input.readByte()) {
streamNormalizedNode(writer, nodeType);
}
writer.endNode();
final String readCodedString() throws IOException {
final byte valueType = input.readByte();
switch (valueType) {
- case TokenTypes.IS_NULL_VALUE:
+ case LithiumTokens.IS_NULL_VALUE:
return null;
- case TokenTypes.IS_CODE_VALUE:
+ case LithiumTokens.IS_CODE_VALUE:
final int code = input.readInt();
try {
return codedStringMap.get(code);
} catch (IndexOutOfBoundsException e) {
throw new IOException("String code " + code + " was not found", e);
}
- case TokenTypes.IS_STRING_VALUE:
+ case LithiumTokens.IS_STRING_VALUE:
final String value = input.readUTF().intern();
codedStringMap.add(value);
return value;
private Object readObject() throws IOException {
byte objectType = input.readByte();
switch (objectType) {
- case ValueTypes.BITS_TYPE:
+ case LithiumValue.BITS_TYPE:
return readObjSet();
- case ValueTypes.BOOL_TYPE:
+ case LithiumValue.BOOL_TYPE:
return input.readBoolean();
- case ValueTypes.BYTE_TYPE:
+ case LithiumValue.BYTE_TYPE:
return input.readByte();
- case ValueTypes.INT_TYPE:
+ case LithiumValue.INT_TYPE:
return input.readInt();
- case ValueTypes.LONG_TYPE:
+ case LithiumValue.LONG_TYPE:
return input.readLong();
- case ValueTypes.QNAME_TYPE:
+ case LithiumValue.QNAME_TYPE:
return readQName();
- case ValueTypes.SHORT_TYPE:
+ case LithiumValue.SHORT_TYPE:
return input.readShort();
- case ValueTypes.STRING_TYPE:
+ case LithiumValue.STRING_TYPE:
return input.readUTF();
- case ValueTypes.STRING_BYTES_TYPE:
+ case LithiumValue.STRING_BYTES_TYPE:
return readStringBytes();
- case ValueTypes.BIG_DECIMAL_TYPE:
+ case LithiumValue.BIG_DECIMAL_TYPE:
return new BigDecimal(input.readUTF());
- case ValueTypes.BIG_INTEGER_TYPE:
+ case LithiumValue.BIG_INTEGER_TYPE:
return new BigInteger(input.readUTF());
- case ValueTypes.BINARY_TYPE:
+ case LithiumValue.BINARY_TYPE:
byte[] bytes = new byte[input.readInt()];
input.readFully(bytes);
return bytes;
- case ValueTypes.YANG_IDENTIFIER_TYPE:
+ case LithiumValue.YANG_IDENTIFIER_TYPE:
return readYangInstanceIdentifierInternal();
- case ValueTypes.EMPTY_TYPE:
+ case LithiumValue.EMPTY_TYPE:
// Leaf nodes no longer allow null values and thus we no longer emit null values. Previously, the "empty"
// yang type was represented as null so we translate an incoming null value to Empty. It was possible for
// a BI user to set a string leaf to null and we're rolling the dice here but the chances for that are
// very low. We'd have to know the yang type but, even if we did, we can't let a null value pass upstream
// so we'd have to drop the leaf which might cause other issues.
- case ValueTypes.NULL_TYPE:
+ case LithiumValue.NULL_TYPE:
return Empty.getInstance();
default:
int type = input.readByte();
switch (type) {
- case PathArgumentTypes.AUGMENTATION_IDENTIFIER:
+ case LithiumPathArgument.AUGMENTATION_IDENTIFIER:
return readAugmentationIdentifier();
- case PathArgumentTypes.NODE_IDENTIFIER:
+ case LithiumPathArgument.NODE_IDENTIFIER:
return readNodeIdentifier();
- case PathArgumentTypes.NODE_IDENTIFIER_WITH_PREDICATES:
+ case LithiumPathArgument.NODE_IDENTIFIER_WITH_PREDICATES:
return readNormalizedNodeWithPredicates();
- case PathArgumentTypes.NODE_IDENTIFIER_WITH_VALUE:
+ case LithiumPathArgument.NODE_IDENTIFIER_WITH_VALUE:
return new NodeWithValue<>(readQName(), readObject());
default:
// FIXME: throw hard error