Loading Language Integration/JEE/org.codeling.lang.jee.transformation/src/main/java/org/codeling/lang/jee7/transformation/bean_feature/ChildOperationTransformation.java +1 −32 Original line number Diff line number Diff line Loading @@ -30,14 +30,12 @@ public class ChildOperationTransformation implements IALTransformation<StereotypeApplication, IType> { private IALHolder holder = new IALHolder(); private ComponentType componentType; public ChildOperationTransformation(ChildTypeTransformation childTypeTransformation, ComponentType componentType) { public ChildOperationTransformation(ChildTypeTransformation childTypeTransformation) { super(null, ProfilesUtils.getEReference( ProfilesUtils.getStereotype("OperationInterface", Profiles.INTERFACES_TYPE_OPERATIONS.load()), "operations")); this.componentType = componentType; } @Override Loading Loading @@ -118,35 +116,6 @@ public class ChildOperationTransformation List<EObject> children = Models.getTargetsAsList(modelElement, ProfilesUtils.getEReference( Profiles.COMPONENTS_HIERARCHY_SCOPED.load(), "HierarchicalComponentTypeScoped", "childTypes")); createProvidedOperationRecursively(children, null); // IType type = (IType) codeElement; // List<EObject> targets = Models.getTargetsAsList(modelElement, eReference); // for (EObject target : targets) { // if (type.getMethod(getNameAttributeValue(target), new String[0]).exists()) { // // Method already exists. Do nothing // } else { // // Method does not exist. Create a new one. // String targetName = getNameAttributeValue(target); // // // For presentation purposes. This is currently only able to handle the name // of // // Annotated Member References (Single) references. // String content = "public void " + targetName.substring(0, 1).toLowerCase() + // targetName.substring(1) // + "(){" + componentType.getName().substring(0, 1).toLowerCase() // + componentType.getName().substring(1) + "." + targetName.substring(0, // 1).toLowerCase() // + targetName.substring(1) + "();" + "}"; // // try { // type.createMethod(content, null, true, null); // } catch (JavaModelException e) { // addWarning(MessageFormat.format("Could not add method [{0}] to [{1}].", // target, // codeElement.getElementName()), e); // } // } // } } private void createProvidedOperationRecursively(List<EObject> children, ComponentType topmostProvidingComponent) { Loading Language Integration/JEE/org.codeling.lang.jee.transformation/src/main/java/org/codeling/lang/jee7/transformation/bean_feature/ChildTypeTransformation.java +1 −2 Original line number Diff line number Diff line Loading @@ -66,8 +66,7 @@ public class ChildTypeTransformation @Override protected void doCreateChildTransformationsToCode( List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) { ChildOperationTransformation child = new ChildOperationTransformation(this, (ComponentType) modelElement.getAppliedTo()); ChildOperationTransformation child = new ChildOperationTransformation(this); child.setModelElement(modelElement); child.getIALHolder().setFoundationalIALElement(holder.getFoundationalIALElement()); child.getIALHolder().setPriorFoundationalIALElement(holder.getPriorFoundationalIALElement()); Loading Loading
Language Integration/JEE/org.codeling.lang.jee.transformation/src/main/java/org/codeling/lang/jee7/transformation/bean_feature/ChildOperationTransformation.java +1 −32 Original line number Diff line number Diff line Loading @@ -30,14 +30,12 @@ public class ChildOperationTransformation implements IALTransformation<StereotypeApplication, IType> { private IALHolder holder = new IALHolder(); private ComponentType componentType; public ChildOperationTransformation(ChildTypeTransformation childTypeTransformation, ComponentType componentType) { public ChildOperationTransformation(ChildTypeTransformation childTypeTransformation) { super(null, ProfilesUtils.getEReference( ProfilesUtils.getStereotype("OperationInterface", Profiles.INTERFACES_TYPE_OPERATIONS.load()), "operations")); this.componentType = componentType; } @Override Loading Loading @@ -118,35 +116,6 @@ public class ChildOperationTransformation List<EObject> children = Models.getTargetsAsList(modelElement, ProfilesUtils.getEReference( Profiles.COMPONENTS_HIERARCHY_SCOPED.load(), "HierarchicalComponentTypeScoped", "childTypes")); createProvidedOperationRecursively(children, null); // IType type = (IType) codeElement; // List<EObject> targets = Models.getTargetsAsList(modelElement, eReference); // for (EObject target : targets) { // if (type.getMethod(getNameAttributeValue(target), new String[0]).exists()) { // // Method already exists. Do nothing // } else { // // Method does not exist. Create a new one. // String targetName = getNameAttributeValue(target); // // // For presentation purposes. This is currently only able to handle the name // of // // Annotated Member References (Single) references. // String content = "public void " + targetName.substring(0, 1).toLowerCase() + // targetName.substring(1) // + "(){" + componentType.getName().substring(0, 1).toLowerCase() // + componentType.getName().substring(1) + "." + targetName.substring(0, // 1).toLowerCase() // + targetName.substring(1) + "();" + "}"; // // try { // type.createMethod(content, null, true, null); // } catch (JavaModelException e) { // addWarning(MessageFormat.format("Could not add method [{0}] to [{1}].", // target, // codeElement.getElementName()), e); // } // } // } } private void createProvidedOperationRecursively(List<EObject> children, ComponentType topmostProvidingComponent) { Loading
Language Integration/JEE/org.codeling.lang.jee.transformation/src/main/java/org/codeling/lang/jee7/transformation/bean_feature/ChildTypeTransformation.java +1 −2 Original line number Diff line number Diff line Loading @@ -66,8 +66,7 @@ public class ChildTypeTransformation @Override protected void doCreateChildTransformationsToCode( List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) { ChildOperationTransformation child = new ChildOperationTransformation(this, (ComponentType) modelElement.getAppliedTo()); ChildOperationTransformation child = new ChildOperationTransformation(this); child.setModelElement(modelElement); child.getIALHolder().setFoundationalIALElement(holder.getFoundationalIALElement()); child.getIALHolder().setPriorFoundationalIALElement(holder.getPriorFoundationalIALElement()); Loading