+ @Override
+ public final Object deserialize(final Object parent, final InstanceIdentifier parentPath) {
+ adaptForPath(parentPath);
+ Preconditions.checkArgument(parent instanceof CompositeNode, "node must be of CompositeNode type.");
+ CompositeNode parentData = (CompositeNode) parent;
+ ArrayList<T> applicable = new ArrayList<>(implementations.size());
+
+ /*
+ * Codecs are filtered to only ones, which
+ * are applicable in supplied parent context.
+ *
+ */
+ for (T impl : getImplementations().values()) {
+ @SuppressWarnings("unchecked")
+ boolean codecApplicable = impl.isApplicable(parentPath, parentData);
+ if (codecApplicable) {
+ applicable.add(impl);
+ }
+ }
+ LOG.trace("{}: Deserializing mixins from {}, Schema Location {}, Applicable Codecs: {}, All Codecs: {}",this,parent,parentPath,applicable,getImplementations().values());
+
+ /* In case of none is applicable, we return
+ * null. Since there is no mixin which
+ * is applicable in this location.
+ */
+ if(applicable.isEmpty()) {
+ return null;
+ }
+ return deserializeImpl(parentData, parentPath, applicable);
+ }
+
+ protected abstract Object deserializeImpl(final CompositeNode input, final InstanceIdentifier<?> parentPath,
+ Iterable<T> applicableCodecs);
+