Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.AbstractTypeDeclaration.modifiers()


        } else {
            TypeDeclaration type = m_ast.newTypeDeclaration();
            type.setInterface(false);
            abstype = type;
        }
        abstype.modifiers().add(m_ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
        abstype.setName(m_ast.newSimpleName(cname));
        return abstype;
    }
   
    /**
 
View Full Code Here


     * @param isenum Java 5 enum class flag
     * @return builder
     */
    public ClassBuilder newInnerClass(String cname, ClassBuilder outer, boolean isenum) {
        AbstractTypeDeclaration decl = createClass(cname, isenum);
        decl.modifiers().add(m_ast.newModifier(Modifier.ModifierKeyword.STATIC_KEYWORD));
//        type.superInterfaceTypes().add(createType("java.io.Serializable"));
        return new ClassBuilder(decl, outer);
    }

    /**
 
View Full Code Here

                String typeContent = constructTypeStub(parentCU, imports, lineDelimiter);

                int index = cuContent.lastIndexOf(simpleTypeStub);
                if (index == -1) {
                    AbstractTypeDeclaration typeNode = (AbstractTypeDeclaration) astRoot.types().get(0);
                    int start = ((ASTNode) typeNode.modifiers().get(0)).getStartPosition();
                    int end = typeNode.getStartPosition() + typeNode.getLength();
                    buffer.replace(start, end - start, typeContent);
                } else {
                    buffer.replace(index, simpleTypeStub.length(), typeContent);
                }
View Full Code Here

                String typeContent = constructTypeStub(parentCU, imports, lineDelimiter);

                int index = cuContent.lastIndexOf(simpleTypeStub);
                if (index == -1) {
                    AbstractTypeDeclaration typeNode = (AbstractTypeDeclaration) astRoot.types().get(0);
                    int start = ((ASTNode) typeNode.modifiers().get(0)).getStartPosition();
                    int end = typeNode.getStartPosition() + typeNode.getLength();
                    buffer.replace(start, end - start, typeContent);
                } else {
                    buffer.replace(index, simpleTypeStub.length(), typeContent);
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.