- }
- return createFromSimpleType(key, type);
- }
-
- private JSONCodec<?> createReferencedTypeCodec(final DataSchemaNode schema,
- final LeafrefTypeDefinition type) {
- // FIXME: Verify if this does indeed support leafref of leafref
- final TypeDefinition<?> referencedType =
- SchemaContextUtil.getBaseTypeForLeafRef(type, getSchemaContext(), schema);
- Verify.verifyNotNull(referencedType, "Unable to find base type for leafref node '%s'.", schema.getPath());
- return createCodec(schema, referencedType);
- }
-
- private JSONCodec<QName> createIdentityrefTypeCodec(final DataSchemaNode schema) {
- final JSONCodec<QName> jsonStringIdentityrefCodec =
- new JSONStringIdentityrefCodec(schemaContext, schema.getQName().getModule());
- return jsonStringIdentityrefCodec;
- }
-
- private JSONCodec<Object> createUnionTypeCodec(final DataSchemaNode schema, final UnionTypeDefinition type) {
- final JSONCodec<Object> jsonStringUnionCodec = new JSONStringUnionCodec(schema, type, this);
- return jsonStringUnionCodec;
- }
-
- private JSONCodec<?> createFromSimpleType(final DataSchemaNode schema, final TypeDefinition<?> type) {
- if (type instanceof InstanceIdentifierTypeDefinition) {