List of usage examples for org.aspectj.apache.bcel.generic ClassGen removeMethod
public void removeMethod(Method m)
From source file:org.caesarj.mixer.intern.ClassModifyingVisitor.java
License:Open Source License
/** * Remove all methods from <code>clazz</code> whose names start * with '$new'./*from w w w . j a v a 2 s .co m*/ * @param clazz The class to modify * @return The class with removed methods */ protected JavaClass removeFactoryMethods(JavaClass clazz) { ClassGen gen = new ClassGen(clazz); Method[] methods = gen.getMethods(); for (int i = 0; i < methods.length; i++) { Method method = methods[i]; if (method.getName().startsWith(CaesarConstants.FACTORY_METHOD_PREFIX)) { gen.removeMethod(method); } } return gen.getJavaClass(); }