private IllegalArgumentCodec<Object, Object> getCodecForBindingClass(final Class<?> valueType,
final TypeDefinition<?> typeDef) {
if (typeDef instanceof IdentityrefTypeDefinition) {
- return ValueTypeCodec.encapsulatedValueCodecFor(valueType, typeDef, identityCodec);
+ return new CompositeValueCodec(SchemaUnawareCodec.of(valueType, typeDef), identityCodec);
} else if (typeDef instanceof InstanceIdentifierTypeDefinition) {
- return ValueTypeCodec.encapsulatedValueCodecFor(valueType, typeDef, instanceIdentifierCodec);
+ return new CompositeValueCodec(SchemaUnawareCodec.of(valueType, typeDef), instanceIdentifierCodec);
} else if (typeDef instanceof UnionTypeDefinition) {
final Callable<UnionTypeCodec> unionLoader = UnionTypeCodec.loader(valueType, (UnionTypeDefinition) typeDef,
this);
package org.opendaylight.mdsal.binding.dom.codec.impl;
import org.opendaylight.yangtools.concepts.IllegalArgumentCodec;
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
/**
* Value codec, which serializes / deserializes values from DOM simple values.
// FIXME: IllegalArgumentCodec is perhaps not appropriate here due to null behavior
abstract class ValueTypeCodec implements IllegalArgumentCodec<Object, Object> {
- @SuppressWarnings("rawtypes")
- static ValueTypeCodec encapsulatedValueCodecFor(final Class<?> typeClz, final TypeDefinition<?> typeDef,
- final IllegalArgumentCodec delegate) {
- return new CompositeValueCodec(SchemaUnawareCodec.of(typeClz, typeDef), delegate);
- }
}