コード例 #1
0
  public void removeClassByName(ClassCollection collection, String classToRemove) {

    for (Class class1 : collection) {
      if (class1.getName().equals(classToRemove)) {
        collection.remove(class1);
        return;
      }
    }
  }
コード例 #2
0
 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");
 }
コード例 #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);
  }
コード例 #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);
  }
コード例 #5
0
  protected Method removeMethod(Class classToModify, String methodName) {

    Method methodToRemove = DeltaJUtils.methodByName(classToModify, methodName);
    if (methodToRemove != null) classToModify.getMethods().remove(methodToRemove);
    return methodToRemove;
  }
コード例 #6
0
  protected void modifyClassCase(Class classToModify, FieldRemoval removesField) {

    Field fieldToRemove = DeltaJUtils.fieldByName(classToModify, removesField.getName());
    if (fieldToRemove != null) classToModify.getFields().remove(fieldToRemove);
  }
コード例 #7
0
  protected void addClonedMethod(Class classToModify, Method method) {

    classToModify.getMethods().add(EcoreUtil2.clone(method));
  }
コード例 #8
0
  protected void addClonedField(Class classToModify, Field field) {

    classToModify.getFields().add(EcoreUtil2.clone(field));
  }
コード例 #9
0
 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);
 }