Ejemplo n.º 1
0
  public void removeClassByName(ClassCollection collection, String classToRemove) {

    for (Class class1 : collection) {
      if (class1.getName().equals(classToRemove)) {
        collection.remove(class1);
        return;
      }
    }
  }
 public String fileName(final Product product, final org.deltaj.deltaj.Class clazz) {
   String _packageName = this.packageName(product);
   String _folderName = this.folderName(_packageName);
   String _plus = (_folderName + "/");
   String _name = clazz.getName();
   String _plus_1 = (_plus + _name);
   return (_plus_1 + ".java");
 }
Ejemplo n.º 3
0
  public void replaceMethod(Class classToModify, Method method) {

    Method methodToReplace = removeMethod(classToModify, method.getName());
    if (methodToReplace != null) {
      boolean originalReferenced = originalPreProcessor.preprocess(methodToReplace, method);
      if (originalReferenced) classToModify.getMethods().add(methodToReplace);
    }
    addClonedMethod(classToModify, method);
  }
Ejemplo n.º 4
0
  public void modifyClass(Class classToModify, ClassModification modifiesClass) {

    if (modifiesClass.getExtends() != null) classToModify.setExtends(modifiesClass.getExtends());
    for (DeltaSubAction modifiesClassAction : modifiesClass.getSubActions())
      modifyClass(classToModify, modifiesClassAction);
  }
Ejemplo n.º 5
0
  protected Method removeMethod(Class classToModify, String methodName) {

    Method methodToRemove = DeltaJUtils.methodByName(classToModify, methodName);
    if (methodToRemove != null) classToModify.getMethods().remove(methodToRemove);
    return methodToRemove;
  }
Ejemplo n.º 6
0
  protected void modifyClassCase(Class classToModify, FieldRemoval removesField) {

    Field fieldToRemove = DeltaJUtils.fieldByName(classToModify, removesField.getName());
    if (fieldToRemove != null) classToModify.getFields().remove(fieldToRemove);
  }
Ejemplo n.º 7
0
  protected void addClonedMethod(Class classToModify, Method method) {

    classToModify.getMethods().add(EcoreUtil2.clone(method));
  }
Ejemplo n.º 8
0
  protected void addClonedField(Class classToModify, Field field) {

    classToModify.getFields().add(EcoreUtil2.clone(field));
  }
 public String qualifiedName(final Product product, final org.deltaj.deltaj.Class clazz) {
   String _packageName = this.packageName(product);
   String _name = clazz.getName();
   return this.concatPackage(_packageName, _name);
 }