public AugmentationSchemaNode startAugmentationNode(final AugmentationIdentifier identifier) { LOG.debug("Enter augmentation {}", identifier); Object parent = getParent(); checkArgument(parent instanceof AugmentationTarget, "Augmentation not allowed under %s", parent); if (parent instanceof ChoiceSchemaNode) { final QName name = Iterables.get(identifier.getPossibleChildNames(), 0); parent = findCaseByChild((ChoiceSchemaNode) parent, name); } checkArgument(parent instanceof DataNodeContainer, "Augmentation allowed only in DataNodeContainer", parent); final AugmentationSchemaNode schema = SchemaUtils.findSchemaForAugment((AugmentationTarget) parent, identifier.getPossibleChildNames()); final AugmentationSchemaNode resolvedSchema = EffectiveAugmentationSchema.create(schema, (DataNodeContainer) parent); schemaStack.push(resolvedSchema); return resolvedSchema; }
public AugmentationSchemaNode startAugmentationNode(final AugmentationIdentifier identifier) { LOG.debug("Enter augmentation {}", identifier); Object parent = getParent(); checkArgument(parent instanceof AugmentationTarget, "Augmentation not allowed under %s", parent); if (parent instanceof ChoiceSchemaNode) { final QName name = Iterables.get(identifier.getPossibleChildNames(), 0); parent = findCaseByChild((ChoiceSchemaNode) parent, name); } checkArgument(parent instanceof DataNodeContainer, "Augmentation allowed only in DataNodeContainer", parent); final AugmentationSchemaNode schema = SchemaUtils.findSchemaForAugment((AugmentationTarget) parent, identifier.getPossibleChildNames()); final AugmentationSchemaNode resolvedSchema = EffectiveAugmentationSchema.create(schema, (DataNodeContainer) parent); schemaStack.push(resolvedSchema); return resolvedSchema; }