List of usage examples for org.eclipse.jdt.core.dom MethodDeclaration CONSTRUCTOR_PROPERTY
SimplePropertyDescriptor CONSTRUCTOR_PROPERTY
To view the source code for org.eclipse.jdt.core.dom MethodDeclaration CONSTRUCTOR_PROPERTY.
Click Source Link
From source file:org.moe.natjgen.ClassMemberEditor.java
License:Apache License
@SuppressWarnings("unchecked") private void read() { // Update already existing functions for (BodyDeclaration decl : (List<BodyDeclaration>) lrw.getRewrittenList()) { if (decl instanceof MethodDeclaration) { if (((Boolean) getRewrite().get(decl, MethodDeclaration.CONSTRUCTOR_PROPERTY)) .booleanValue() == true) { allConstructors.add(new ConstructorEditor(getManager(), (MethodDeclaration) decl, false)); } else { allMethods.add(new MethodEditor(getManager(), (MethodDeclaration) decl, false)); }//from www . j a va 2 s . co m } else if (decl instanceof FieldDeclaration) { allFields.add(new FieldEditor(getManager(), (FieldDeclaration) decl, false)); } else if (decl instanceof Initializer) { InitializerEditor editor = new InitializerEditor(getManager(), (Initializer) decl); if (editor.getModifiers().isStatic()) { allStaticInitializers.add(editor); } } else if (decl instanceof TypeDeclaration) { allClasses.add(new ClassEditor(getManager(), (TypeDeclaration) decl, false)); } } }
From source file:org.moe.natjgen.ConstructorEditor.java
License:Apache License
public ConstructorEditor(AbstractUnitManager manager, MethodDeclaration decl, boolean isNew) { super(manager, decl, isNew); if (isNew) {//from ww w .j a v a 2 s. co m getRewrite().set(decl, MethodDeclaration.NAME_PROPERTY, getAST().newSimpleName(getManager().getUnitName()), getEditGroup()); getRewrite().set(decl, MethodDeclaration.CONSTRUCTOR_PROPERTY, Boolean.TRUE, getEditGroup()); } }