+ private def void usesAugmentationToGenTypes(String augmentPackageName, AugmentationSchema augSchema, Module module,
+ UsesNode usesNode, DataNodeContainer usesNodeParent) {
+ checkArgument(augmentPackageName !== null, "Package Name cannot be NULL.");
+ checkArgument(augSchema !== null, "Augmentation Schema cannot be NULL.");
+ checkState(augSchema.targetPath !== null,
+ "Augmentation Schema does not contain Target Path (Target Path is NULL).");
+
+ processUsesAugments(augSchema, module);
+ val targetPath = augSchema.targetPath;
+ var SchemaNode targetSchemaNode = null
+ targetSchemaNode = findOriginalTargetFromGrouping(targetPath, usesNode);
+ if (targetSchemaNode == null) {
+ throw new IllegalArgumentException("augment target not found: " + targetPath)
+ }
+
+ var targetTypeBuilder = findChildNodeByPath(targetSchemaNode.path)
+ if (targetTypeBuilder === null) {
+ targetTypeBuilder = findCaseByPath(targetSchemaNode.path)
+ }
+ if (targetTypeBuilder === null) {
+ throw new NullPointerException("Target type not yet generated: " + targetSchemaNode);