X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=binding%2Fmdsal-binding-dom-codec%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Fbinding%2Fdom%2Fcodec%2Fimpl%2FAugmentationCodecContext.java;h=484e192f98bc32460ad3ce8d53dd7dc1db087672;hb=2b732eb188c6b34a91488308318a590a14cf2c07;hp=2d61c85456e952c376ad49e3fc02e5f31b169a30;hpb=fec64f6b8dcb6c2106c0328cc7f308a2493a32c9;p=mdsal.git diff --git a/binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/AugmentationCodecContext.java b/binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/AugmentationCodecContext.java index 2d61c85456..484e192f98 100644 --- a/binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/AugmentationCodecContext.java +++ b/binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/AugmentationCodecContext.java @@ -18,7 +18,7 @@ import org.opendaylight.mdsal.binding.dom.codec.api.BindingAugmentationCodecTree import org.opendaylight.mdsal.binding.runtime.api.AugmentRuntimeType; import org.opendaylight.yangtools.yang.binding.Augmentation; import org.opendaylight.yangtools.yang.binding.DataObject; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.binding.DataObjectStep; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode; @@ -33,12 +33,12 @@ final class AugmentationCodecContext> private final MethodHandle proxyConstructor; - private AugmentationCodecContext(final AugmentationCodecPrototype prototype, + private AugmentationCodecContext(final AugmentationCodecPrototype prototype, final DataContainerAnalysis analysis) { super(prototype, analysis); - final var bindingClass = CodecDataObjectGenerator.generate(prototype.getFactory().getLoader(), - prototype.getBindingClass(), analysis.leafContexts, analysis.daoProperties, null); + final var bindingClass = CodecDataObjectGenerator.generate(prototype.contextFactory().getLoader(), + prototype.javaClass(), analysis.leafContexts, analysis.daoProperties, null); final MethodHandle ctor; try { @@ -50,20 +50,20 @@ final class AugmentationCodecContext> proxyConstructor = ctor.asType(DATAOBJECT_TYPE); } - AugmentationCodecContext(final AugmentationCodecPrototype prototype) { + AugmentationCodecContext(final AugmentationCodecPrototype prototype) { this(prototype, new DataContainerAnalysis<>(prototype, CodecItemFactory.of())); } @Override - public PathArgument serializePathArgument(final InstanceIdentifier.PathArgument arg) { - if (!bindingArg().equals(arg)) { - throw new IllegalArgumentException("Unexpected argument " + arg); + public PathArgument serializePathArgument(final DataObjectStep step) { + if (!bindingArg().equals(step)) { + throw new IllegalArgumentException("Unexpected argument " + step); } return null; } @Override - public InstanceIdentifier.PathArgument deserializePathArgument(final PathArgument arg) { + public DataObjectStep deserializePathArgument(final PathArgument arg) { if (arg != null) { throw new IllegalArgumentException("Unexpected argument " + arg); } @@ -73,7 +73,7 @@ final class AugmentationCodecContext> @SuppressWarnings("checkstyle:illegalCatch") @Override public D filterFrom(final DataContainerNode parentData) { - for (var childArg : ((AugmentationCodecPrototype) prototype).getChildArgs()) { + for (var childArg : ((AugmentationCodecPrototype) prototype()).getChildArgs()) { if (parentData.childByArg(childArg) != null) { try { return (D) proxyConstructor.invokeExact(this, parentData); @@ -92,17 +92,17 @@ final class AugmentationCodecContext> } @Override - protected Object deserializeObject(final NormalizedNode normalizedNode) { + Object deserializeObject(final NormalizedNode normalizedNode) { return filterFrom(checkDataArgument(DataContainerNode.class, normalizedNode)); } @Override - void addYangPathArgument(final List builder, final InstanceIdentifier.PathArgument arg) { + void addYangPathArgument(final List builder, final DataObjectStep step) { // No-op } @Override - protected NodeIdentifier getDomPathArgument() { + NodeIdentifier getDomPathArgument() { return null; }