2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.binding.dom.codec.impl;
10 import static com.google.common.base.Preconditions.checkArgument;
11 import static com.google.common.base.Verify.verify;
12 import static java.util.Objects.requireNonNull;
14 import com.google.common.annotations.Beta;
15 import com.google.common.base.Throwables;
16 import com.google.common.collect.ImmutableMap;
17 import com.google.common.collect.ImmutableMap.Builder;
18 import java.lang.invoke.MethodHandle;
19 import java.lang.invoke.MethodHandles;
20 import java.lang.invoke.MethodType;
21 import java.lang.reflect.Method;
22 import java.util.HashMap;
23 import java.util.Iterator;
24 import java.util.List;
26 import java.util.Map.Entry;
27 import java.util.Optional;
28 import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
29 import org.eclipse.jdt.annotation.NonNull;
30 import org.eclipse.jdt.annotation.Nullable;
31 import org.opendaylight.binding.runtime.api.ClassLoadingStrategy;
32 import org.opendaylight.mdsal.binding.dom.codec.api.IncorrectNestingException;
33 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
34 import org.opendaylight.mdsal.binding.model.api.Type;
35 import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
36 import org.opendaylight.yangtools.concepts.Immutable;
37 import org.opendaylight.yangtools.util.ClassLoaderUtils;
38 import org.opendaylight.yangtools.yang.binding.Augmentable;
39 import org.opendaylight.yangtools.yang.binding.Augmentation;
40 import org.opendaylight.yangtools.yang.binding.DataObject;
41 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
42 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.Item;
43 import org.opendaylight.yangtools.yang.binding.OpaqueObject;
44 import org.opendaylight.yangtools.yang.common.QName;
45 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
46 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
47 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
48 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
49 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
50 import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode;
51 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
52 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeContainer;
53 import org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode;
54 import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
55 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
56 import org.opendaylight.yangtools.yang.model.api.DocumentedNode.WithStatus;
57 import org.opendaylight.yangtools.yang.model.util.SchemaNodeUtils;
58 import org.slf4j.Logger;
59 import org.slf4j.LoggerFactory;
62 * This class is an implementation detail. It is public only due to technical reasons and may change at any time.
65 public abstract class DataObjectCodecContext<D extends DataObject, T extends DataNodeContainer & WithStatus>
66 extends DataContainerCodecContext<D, T> {
67 private static final class Augmentations implements Immutable {
68 final ImmutableMap<YangInstanceIdentifier.PathArgument, DataContainerCodecPrototype<?>> byYang;
69 final ImmutableMap<Class<?>, DataContainerCodecPrototype<?>> byStream;
71 Augmentations(final ImmutableMap<YangInstanceIdentifier.PathArgument, DataContainerCodecPrototype<?>> byYang,
72 final ImmutableMap<Class<?>, DataContainerCodecPrototype<?>> byStream) {
73 this.byYang = requireNonNull(byYang);
74 this.byStream = requireNonNull(byStream);
78 private static final Logger LOG = LoggerFactory.getLogger(DataObjectCodecContext.class);
79 private static final MethodType CONSTRUCTOR_TYPE = MethodType.methodType(void.class,
80 DataObjectCodecContext.class, NormalizedNodeContainer.class);
81 private static final MethodType DATAOBJECT_TYPE = MethodType.methodType(DataObject.class,
82 DataObjectCodecContext.class, NormalizedNodeContainer.class);
83 private static final Augmentations EMPTY_AUGMENTATIONS = new Augmentations(ImmutableMap.of(), ImmutableMap.of());
85 private final ImmutableMap<String, ValueNodeCodecContext> leafChild;
86 private final ImmutableMap<YangInstanceIdentifier.PathArgument, NodeContextSupplier> byYang;
87 private final ImmutableMap<Class<?>, DataContainerCodecPrototype<?>> byStreamClass;
88 private final ImmutableMap<Class<?>, DataContainerCodecPrototype<?>> byBindingArgClass;
89 private final ImmutableMap<AugmentationIdentifier, Type> possibleAugmentations;
90 private final MethodHandle proxyConstructor;
92 // FIXME: the presence of these two volatile fields may be preventing us from being able to improve
93 // DataContainerCodecPrototype.get() publication.
94 @SuppressWarnings("rawtypes")
95 private static final AtomicReferenceFieldUpdater<DataObjectCodecContext, Augmentations>
96 AUGMENTATIONS_UPDATER = AtomicReferenceFieldUpdater.newUpdater(DataObjectCodecContext.class,
97 Augmentations.class, "augmentations");
98 private volatile Augmentations augmentations = EMPTY_AUGMENTATIONS;
100 private volatile ImmutableMap<Class<?>, DataContainerCodecPrototype<?>> mismatchedAugmented = ImmutableMap.of();
102 DataObjectCodecContext(final DataContainerCodecPrototype<T> prototype) {
103 this(prototype, null);
106 DataObjectCodecContext(final DataContainerCodecPrototype<T> prototype, final Method keyMethod) {
109 final Class<D> bindingClass = getBindingClass();
111 final ImmutableMap<Method, ValueNodeCodecContext> tmpLeaves = factory().getLeafNodes(bindingClass, getSchema());
112 final Map<Class<?>, Method> clsToMethod = BindingReflections.getChildrenClassToMethod(bindingClass);
114 final Map<YangInstanceIdentifier.PathArgument, NodeContextSupplier> byYangBuilder = new HashMap<>();
115 final Map<Class<?>, DataContainerCodecPrototype<?>> byStreamClassBuilder = new HashMap<>();
116 final Map<Class<?>, DataContainerCodecPrototype<?>> byBindingArgClassBuilder = new HashMap<>();
118 // Adds leaves to mapping
119 final Builder<String, ValueNodeCodecContext> leafChildBuilder =
120 ImmutableMap.builderWithExpectedSize(tmpLeaves.size());
121 for (final Entry<Method, ValueNodeCodecContext> entry : tmpLeaves.entrySet()) {
122 final ValueNodeCodecContext leaf = entry.getValue();
123 leafChildBuilder.put(leaf.getSchema().getQName().getLocalName(), leaf);
124 byYangBuilder.put(leaf.getDomPathArgument(), leaf);
126 this.leafChild = leafChildBuilder.build();
128 final Map<Method, Class<?>> tmpDataObjects = new HashMap<>();
129 for (final Entry<Class<?>, Method> childDataObj : clsToMethod.entrySet()) {
130 final Method method = childDataObj.getValue();
131 verify(!method.isDefault(), "Unexpected default method %s in %s", method, bindingClass);
133 final Class<?> retClass = childDataObj.getKey();
134 if (OpaqueObject.class.isAssignableFrom(retClass)) {
135 // Filter OpaqueObjects, they are not containers
139 final DataContainerCodecPrototype<?> childProto = loadChildPrototype(retClass);
140 tmpDataObjects.put(method, childProto.getBindingClass());
141 byStreamClassBuilder.put(childProto.getBindingClass(), childProto);
142 byYangBuilder.put(childProto.getYangArg(), childProto);
143 if (childProto.isChoice()) {
144 final ChoiceNodeCodecContext<?> choice = (ChoiceNodeCodecContext<?>) childProto.get();
145 for (final Class<?> cazeChild : choice.getCaseChildrenClasses()) {
146 byBindingArgClassBuilder.put(cazeChild, childProto);
151 this.byYang = ImmutableMap.copyOf(byYangBuilder);
152 this.byStreamClass = ImmutableMap.copyOf(byStreamClassBuilder);
154 // Slight footprint optimization: we do not want to copy byStreamClass, as that would force its entrySet view
155 // to be instantiated. Furthermore the two maps can easily end up being equal -- hence we can reuse
156 // byStreamClass for the purposes of both.
157 byBindingArgClassBuilder.putAll(byStreamClassBuilder);
158 this.byBindingArgClass = byStreamClassBuilder.equals(byBindingArgClassBuilder) ? this.byStreamClass
159 : ImmutableMap.copyOf(byBindingArgClassBuilder);
161 final Class<? extends CodecDataObject<?>> generatedClass;
162 if (Augmentable.class.isAssignableFrom(bindingClass)) {
163 this.possibleAugmentations = factory().getRuntimeContext().getAvailableAugmentationTypes(getSchema());
164 generatedClass = CodecDataObjectGenerator.generateAugmentable(prototype.getFactory().getLoader(),
165 bindingClass, tmpLeaves, tmpDataObjects, keyMethod);
167 this.possibleAugmentations = ImmutableMap.of();
168 generatedClass = CodecDataObjectGenerator.generate(prototype.getFactory().getLoader(), bindingClass,
169 tmpLeaves, tmpDataObjects, keyMethod);
171 reloadAllAugmentations();
173 final MethodHandle ctor;
175 ctor = MethodHandles.publicLookup().findConstructor(generatedClass, CONSTRUCTOR_TYPE);
176 } catch (NoSuchMethodException | IllegalAccessException e) {
177 throw new LinkageError("Failed to find contructor for class " + generatedClass, e);
180 proxyConstructor = ctor.asType(DATAOBJECT_TYPE);
183 // This method could be synchronized, but that would mean that concurrent attempts to load an invalid augmentation
184 // would end up being unnecessarily contended -- blocking real progress and not being able to run concurrently
185 // while producing no effect. We therefore use optimistic read + CAS.
186 private void reloadAllAugmentations() {
187 // Load current values
188 Augmentations oldAugmentations = augmentations;
190 // FIXME: can we detect when we have both maps fully populated and skip all of this?
192 // Scratch space for additions
193 final Map<PathArgument, DataContainerCodecPrototype<?>> addByYang = new HashMap<>();
194 final Map<Class<?>, DataContainerCodecPrototype<?>> addByStream = new HashMap<>();
196 // Iterate over all possibilities, checking for modifications.
197 for (final Type augment : possibleAugmentations.values()) {
198 final DataContainerCodecPrototype<?> augProto = getAugmentationPrototype(augment);
199 if (augProto != null) {
200 final PathArgument yangArg = augProto.getYangArg();
201 final Class<?> bindingClass = augProto.getBindingClass();
202 if (!oldAugmentations.byYang.containsKey(yangArg)) {
203 if (addByYang.putIfAbsent(yangArg, augProto) == null) {
204 LOG.trace("Discovered new YANG mapping {} -> {} in {}", yangArg, augProto, this);
207 if (!oldAugmentations.byStream.containsKey(bindingClass)) {
208 if (addByStream.putIfAbsent(bindingClass, augProto) == null) {
209 LOG.trace("Discovered new class mapping {} -> {} in {}", bindingClass, augProto, this);
216 if (addByYang.isEmpty() && addByStream.isEmpty()) {
217 LOG.trace("No new augmentations discovered in {}", this);
221 // We have some additions, propagate them out
222 final Augmentations newAugmentations = new Augmentations(concatMaps(oldAugmentations.byYang, addByYang),
223 concatMaps(oldAugmentations.byStream, addByStream));
224 if (AUGMENTATIONS_UPDATER.compareAndSet(this, oldAugmentations, newAugmentations)) {
225 // Success, we are done
229 // We have raced installing new augmentations, read them again, remove everything present in the installed
230 // once and try again. This may mean that we end up not doing anything, but that's fine.
231 oldAugmentations = augmentations;
233 // We could use Map.removeAll(oldAugmentations.byYang.keySet()), but that forces the augmentation's keyset
234 // to be materialized, which we otherwise do not need. Hence we do this the other way around, instantiating
235 // our temporary maps' keySets and iterating over them. That's fine as we'll be throwing those maps away.
236 removeMapKeys(addByYang, oldAugmentations.byYang);
237 removeMapKeys(addByStream, oldAugmentations.byStream);
241 private static <K, V> ImmutableMap<K, V> concatMaps(final ImmutableMap<K, V> old, final Map<K, V> add) {
246 final Builder<K, V> builder = ImmutableMap.builderWithExpectedSize(old.size() + add.size());
249 return builder.build();
252 private static <K, V> void removeMapKeys(final Map<K, V> removeFrom, final ImmutableMap<K, V> map) {
253 final Iterator<K> it = removeFrom.keySet().iterator();
254 while (it.hasNext()) {
255 if (map.containsKey(it.next())) {
261 @SuppressWarnings("unchecked")
263 public <C extends DataObject> DataContainerCodecContext<C, ?> streamChild(final Class<C> childClass) {
264 final DataContainerCodecPrototype<?> childProto = streamChildPrototype(childClass);
265 return (DataContainerCodecContext<C, ?>) childNonNull(childProto, childClass, " Child %s is not valid child.",
269 private DataContainerCodecPrototype<?> streamChildPrototype(final Class<?> childClass) {
270 final DataContainerCodecPrototype<?> childProto = byStreamClass.get(childClass);
271 if (childProto != null) {
274 if (Augmentation.class.isAssignableFrom(childClass)) {
275 return augmentationByClass(childClass);
280 @SuppressWarnings("unchecked")
282 public <C extends DataObject> Optional<DataContainerCodecContext<C, ?>> possibleStreamChild(
283 final Class<C> childClass) {
284 final DataContainerCodecPrototype<?> childProto = streamChildPrototype(childClass);
285 if (childProto != null) {
286 return Optional.of((DataContainerCodecContext<C, ?>) childProto.get());
288 return Optional.empty();
292 public DataContainerCodecContext<?,?> bindingPathArgumentChild(final InstanceIdentifier.PathArgument arg,
293 final List<YangInstanceIdentifier.PathArgument> builder) {
295 final Class<? extends DataObject> argType = arg.getType();
296 DataContainerCodecPrototype<?> ctxProto = byBindingArgClass.get(argType);
297 if (ctxProto == null && Augmentation.class.isAssignableFrom(argType)) {
298 ctxProto = augmentationByClass(argType);
300 final DataContainerCodecContext<?, ?> context = childNonNull(ctxProto, argType,
301 "Class %s is not valid child of %s", argType, getBindingClass()).get();
302 if (context instanceof ChoiceNodeCodecContext) {
303 final ChoiceNodeCodecContext<?> choice = (ChoiceNodeCodecContext<?>) context;
304 choice.addYangPathArgument(arg, builder);
306 final Optional<? extends Class<? extends DataObject>> caseType = arg.getCaseType();
307 final Class<? extends DataObject> type = arg.getType();
308 final DataContainerCodecContext<?, ?> caze;
309 if (caseType.isPresent()) {
310 // Non-ambiguous addressing this should not pose any problems
311 caze = choice.streamChild(caseType.get());
313 caze = choice.getCaseByChildClass(type);
316 caze.addYangPathArgument(arg, builder);
317 return caze.bindingPathArgumentChild(arg, builder);
319 context.addYangPathArgument(arg, builder);
324 public NodeCodecContext yangPathArgumentChild(final YangInstanceIdentifier.PathArgument arg) {
325 final NodeContextSupplier childSupplier;
326 if (arg instanceof NodeIdentifierWithPredicates) {
327 childSupplier = byYang.get(new NodeIdentifier(arg.getNodeType()));
328 } else if (arg instanceof AugmentationIdentifier) {
329 childSupplier = yangAugmentationChild((AugmentationIdentifier) arg);
331 childSupplier = byYang.get(arg);
334 return childNonNull(childSupplier, arg, "Argument %s is not valid child of %s", arg, getSchema()).get();
337 protected final ValueNodeCodecContext getLeafChild(final String name) {
338 final ValueNodeCodecContext value = leafChild.get(name);
340 throw IncorrectNestingException.create("Leaf %s is not valid for %s", name, getBindingClass());
345 private DataContainerCodecPrototype<?> loadChildPrototype(final Class<?> childClass) {
346 final DataSchemaNode origDef = factory().getRuntimeContext().getSchemaDefinition(childClass);
347 // Direct instantiation or use in same module in which grouping
349 DataSchemaNode sameName;
351 sameName = getSchema().getDataChildByName(origDef.getQName());
352 } catch (final IllegalArgumentException e) {
355 final DataSchemaNode childSchema;
356 if (sameName != null) {
357 // Exactly same schema node
358 if (origDef.equals(sameName)) {
359 childSchema = sameName;
360 // We check if instantiated node was added via uses
361 // statement and is instantiation of same grouping
362 } else if (origDef.equals(SchemaNodeUtils.getRootOriginalIfPossible(sameName))) {
363 childSchema = sameName;
365 // Node has same name, but clearly is different
369 // We are looking for instantiation via uses in other module
370 final QName instantiedName = origDef.getQName().withModule(namespace());
371 final DataSchemaNode potential = getSchema().getDataChildByName(instantiedName);
372 // We check if it is really instantiated from same
373 // definition as class was derived
374 if (potential != null && origDef.equals(SchemaNodeUtils.getRootOriginalIfPossible(potential))) {
375 childSchema = potential;
380 final DataSchemaNode nonNullChild =
381 childNonNull(childSchema, childClass, "Node %s does not have child named %s", getSchema(), childClass);
382 return DataContainerCodecPrototype.from(createBindingArg(childClass, nonNullChild), nonNullChild, factory());
385 @SuppressWarnings("unchecked")
386 Item<?> createBindingArg(final Class<?> childClass, final DataSchemaNode childSchema) {
387 return Item.of((Class<? extends DataObject>) childClass);
390 private DataContainerCodecPrototype<?> yangAugmentationChild(final AugmentationIdentifier arg) {
391 final DataContainerCodecPrototype<?> firstTry = augmentations.byYang.get(arg);
392 if (firstTry != null) {
395 if (possibleAugmentations.containsKey(arg)) {
396 // Try to load augmentations, which will potentially update knownAugmentations, hence we re-load that field
398 reloadAllAugmentations();
399 return augmentations.byYang.get(arg);
404 private @Nullable DataContainerCodecPrototype<?> augmentationByClass(final @NonNull Class<?> childClass) {
405 DataContainerCodecPrototype<?> lookup = augmentationByClassOrEquivalentClass(childClass);
406 if (lookup != null || !isPotentialAugmentation(childClass)) {
410 // Attempt to reload all augmentations using TCCL and lookup again
411 reloadAllAugmentations();
412 lookup = augmentationByClassOrEquivalentClass(childClass);
413 if (lookup != null) {
417 // Still no result, this can be caused by TCCL not being set up properly -- try the class's ClassLoader
419 final ClassLoader loader = childClass.getClassLoader();
420 if (loader == null) {
424 LOG.debug("Class {} not loaded via TCCL, attempting to recover", childClass);
425 ClassLoaderUtils.runWithClassLoader(loader, this::reloadAllAugmentations);
426 return augmentationByClassOrEquivalentClass(childClass);
429 private boolean isPotentialAugmentation(final Class<?> childClass) {
430 final JavaTypeName name = JavaTypeName.create(childClass);
431 for (Type type : possibleAugmentations.values()) {
432 if (name.equals(type.getIdentifier())) {
439 private @Nullable DataContainerCodecPrototype<?> augmentationByClassOrEquivalentClass(
440 final @NonNull Class<?> childClass) {
441 // Perform a single load, so we can reuse it if we end up going to the reflection-based slow path
442 final ImmutableMap<Class<?>, DataContainerCodecPrototype<?>> local = augmentations.byStream;
443 final DataContainerCodecPrototype<?> childProto = local.get(childClass);
444 if (childProto != null) {
449 * It is potentially mismatched valid augmentation - we look up equivalent augmentation using reflection
450 * and walk all stream child and compare augmentations classes if they are equivalent. When we find a match
451 * we'll cache it so we do not need to perform reflection operations again.
453 final DataContainerCodecPrototype<?> mismatched = mismatchedAugmented.get(childClass);
454 if (mismatched != null) {
458 @SuppressWarnings("rawtypes")
459 final Class<?> augTarget = BindingReflections.findAugmentationTarget((Class) childClass);
460 if (getBindingClass().equals(augTarget)) {
461 for (final DataContainerCodecPrototype<?> realChild : local.values()) {
462 if (Augmentation.class.isAssignableFrom(realChild.getBindingClass())
463 && BindingReflections.isSubstitutionFor(childClass, realChild.getBindingClass())) {
464 return cacheMismatched(childClass, realChild);
468 LOG.trace("Failed to resolve {} as a valid augmentation in {}", childClass, this);
472 private synchronized DataContainerCodecPrototype<?> cacheMismatched(final Class<?> childClass,
473 final DataContainerCodecPrototype<?> prototype) {
474 // Original access was unsynchronized, we need to perform additional checking
475 final ImmutableMap<Class<?>, DataContainerCodecPrototype<?>> local = mismatchedAugmented;
476 final DataContainerCodecPrototype<?> existing = local.get(childClass);
477 if (existing != null) {
481 final Builder<Class<?>, DataContainerCodecPrototype<?>> builder = ImmutableMap.builderWithExpectedSize(
483 builder.putAll(local);
484 builder.put(childClass, prototype);
486 mismatchedAugmented = builder.build();
487 LOG.trace("Cached mismatched augmentation {} -> {} in {}", childClass, prototype, this);
491 private DataContainerCodecPrototype<?> getAugmentationPrototype(final Type value) {
492 final ClassLoadingStrategy loader = factory().getRuntimeContext().getStrategy();
493 @SuppressWarnings("rawtypes")
494 final Class augClass;
496 augClass = loader.loadClass(value);
497 } catch (final ClassNotFoundException e) {
498 LOG.debug("Failed to load augmentation prototype for {}. Will be retried when needed.", value, e);
502 @SuppressWarnings("unchecked")
503 final Entry<AugmentationIdentifier, AugmentationSchemaNode> augSchema = factory().getRuntimeContext()
504 .getResolvedAugmentationSchema(getSchema(), augClass);
505 return DataContainerCodecPrototype.from(augClass, augSchema.getKey(), augSchema.getValue(), factory());
508 @SuppressWarnings("checkstyle:illegalCatch")
509 protected final D createBindingProxy(final NormalizedNodeContainer<?, ?, ?> node) {
511 return (D) proxyConstructor.invokeExact(this, node);
512 } catch (final Throwable e) {
513 Throwables.throwIfUnchecked(e);
514 throw new IllegalStateException(e);
518 @SuppressWarnings("unchecked")
519 Map<Class<? extends Augmentation<?>>, Augmentation<?>> getAllAugmentationsFrom(
520 final NormalizedNodeContainer<?, PathArgument, NormalizedNode<?, ?>> data) {
522 @SuppressWarnings("rawtypes")
523 final Map map = new HashMap<>();
525 for (final NormalizedNode<?, ?> childValue : data.getValue()) {
526 if (childValue instanceof AugmentationNode) {
527 final AugmentationNode augDomNode = (AugmentationNode) childValue;
528 final DataContainerCodecPrototype<?> codecProto = yangAugmentationChild(augDomNode.getIdentifier());
529 if (codecProto != null) {
530 final DataContainerCodecContext<?, ?> codec = codecProto.get();
531 map.put(codec.getBindingClass(), codec.deserializeObject(augDomNode));
535 for (final DataContainerCodecPrototype<?> value : augmentations.byStream.values()) {
536 final Optional<NormalizedNode<?, ?>> augData = data.getChild(value.getYangArg());
537 if (augData.isPresent()) {
538 map.put(value.getBindingClass(), value.get().deserializeObject(augData.get()));
545 public InstanceIdentifier.PathArgument deserializePathArgument(final YangInstanceIdentifier.PathArgument arg) {
546 checkArgument(getDomPathArgument().equals(arg));
551 public YangInstanceIdentifier.PathArgument serializePathArgument(final InstanceIdentifier.PathArgument arg) {
552 checkArgument(bindingArg().equals(arg));
553 return getDomPathArgument();