Exemplo 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");
 }
Exemplo 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);
  }
Exemplo 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);
  }
Exemplo 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;
  }
Exemplo n.º 6
0
  protected void modifyClassCase(Class classToModify, FieldRemoval removesField) {

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

    classToModify.getMethods().add(EcoreUtil2.clone(method));
  }
Exemplo 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);
 }