import org.opendaylight.yangtools.yang.binding.Augmentation;
import org.opendaylight.yangtools.yang.binding.BaseIdentity;
import org.opendaylight.yangtools.yang.binding.BindingCodec;
+import org.opendaylight.yangtools.yang.binding.BindingMapping;
import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.Identifier;
if (adaptedForPaths.contains(path)) {
return;
}
- LOG.info("Adapting mixin codec {} for path {}",this,path);
+ LOG.debug("Adapting mixin codec {} for path {}",this,path);
/**
* We search in schema context if the use of this location aware
* codec (augmentable codec, case codec) makes sense on provided
@Override
public Class<?> deserialize(final QName input) {
+ if(input == null) {
+ return null;
+ }
Type type = qnamesToIdentityMap.get(input);
if (type == null) {
- return null;
+ String packageName = BindingMapping.getRootPackageName(input);
+ String className = BindingMapping.getClassName(input);
+ type = new ReferencedTypeImpl(packageName, className);
}
ReferencedTypeImpl typeref = new ReferencedTypeImpl(type.getPackageName(), type.getName());
WeakReference<Class> softref = typeToClass.get(typeref);
public Object deserialize(final Object input, final InstanceIdentifier bindingIdentifier) {
Type type = qnamesToIdentityMap.get(input);
if (type == null) {
- return null;
+ throw new IllegalArgumentException( "Invalid for \"" + input + "\"." );
}
ReferencedTypeImpl typeref = new ReferencedTypeImpl(type.getPackageName(), type.getName());
WeakReference<Class> softref = typeToClass.get(typeref);
if (qname != null) {
return qname;
}
- ConcreteType typeref = Types.typeForClass(input);
- qname = typeToQname.get(typeref);
+ qname = BindingReflections.findQName(input);
if (qname != null) {
identityQNames.put(input, qname);
}