@Override public SchemaPath getTargetPath() { return delegate.getTargetPath(); }
@Override public SchemaPath getTargetPath() { return delegate.getTargetPath(); }
/** * Creates package name from <code>parentAugmentPackageName</code> (package * name for direct parent augmentation) and <code>augmentationSchema</code> . * * <p> * Resulting package name is concatenation of <code>parentAugmentPackageName</code> * and the local name of <code>schemaPath</code>. * * <p> * Based on type of node, there is also possible suffix added in order * to prevent package name conflicts. * * @param parentAugmentPackageName * string with package name of direct parent augmentation, MUST be normalized, * otherwise this method may return an invalid string. * @param augmentationSchema * augmentation schema which is direct son of parent augmentation. * @return string with valid JAVA package name * @throws NullPointerException if any of the arguments are null */ public static String packageNameForAugmentedGeneratedType(final String parentAugmentPackageName, final AugmentationSchemaNode augmentationSchema) { final QName last = augmentationSchema.getTargetPath().getLastComponent(); return generateNormalizedPackageName(parentAugmentPackageName, last); }
public ImmutableMap<AugmentationIdentifier,Type> getAvailableAugmentationTypes(final DataNodeContainer container) { final Map<AugmentationIdentifier,Type> identifierToType = new HashMap<>(); if (container instanceof AugmentationTarget) { for (final AugmentationSchemaNode augment : ((AugmentationTarget) container).getAvailableAugmentations()) { if (!isLocalAugment((AugmentationTarget) container, augment)) { // Augmentation must have child nodes if is to be used with Binding classes AugmentationSchemaNode augOrig = augment; while (augOrig.getOriginalDefinition().isPresent()) { augOrig = augOrig.getOriginalDefinition().get(); } if (!augment.getChildNodes().isEmpty()) { final Type augType = this.targetToAugmentation.get(augOrig.getTargetPath()); if (augType != null) { identifierToType.put(getAugmentationIdentifier(augment), augType); } } } } } return ImmutableMap.copyOf(identifierToType); }
private void usesAugmentationToGenTypes(final ModuleContext context, final AugmentationSchemaNode augSchema, final UsesNode usesNode, final DataNodeContainer usesNodeParent) { checkArgument(augSchema != null, "Augmentation Schema cannot be NULL."); checkState(augSchema.getTargetPath() != null, "Augmentation Schema does not contain Target Path (Target Path is NULL)."); final SchemaPath targetPath = augSchema.getTargetPath(); final SchemaNode targetSchemaNode = findOriginalTargetFromGrouping(targetPath, usesNode); if (targetSchemaNode == null) {
checkState(augSchema.getTargetPath() != null, "Augmentation Schema does not contain Target Path (Target Path is NULL)."); final SchemaPath targetPath = augSchema.getTargetPath(); SchemaNode targetSchemaNode = null;
final SchemaPath targetPath = augSchema.getTargetPath(); SchemaNode targetSchemaNode = findDataSchemaNode(schemaContext, targetPath); if (targetSchemaNode instanceof DataSchemaNode
private void emitAugment(final AugmentationSchemaNode augmentation) { super.writer.startAugmentNode(augmentation.getTargetPath()); // FIXME: BUG-2444: whenNode //Optional // FIXME: BUG-2444: *(ifFeatureNode ) emitDocumentedNode(augmentation); for (final UsesNode uses : augmentation.getUses()) { emitUsesNode(uses); } for (final DataSchemaNode childNode : augmentation.getChildNodes()) { if (childNode instanceof CaseSchemaNode) { emitCaseNode((CaseSchemaNode) childNode); } else { emitDataSchemaNode(childNode); } } emitUnknownStatementNodes(augmentation.getUnknownSchemaNodes()); emitNotifications(augmentation.getNotifications()); emitActions(augmentation.getActions()); super.writer.endNode(); }