Example usage for org.eclipse.jdt.core.dom FieldDeclaration setModifiers

List of usage examples for org.eclipse.jdt.core.dom FieldDeclaration setModifiers

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom FieldDeclaration setModifiers.

Prototype

public void setModifiers(int modifiers) 

Source Link

Document

Sets the modifiers explicitly specified on this declaration (JLS2 API only).

Usage

From source file:org.whole.lang.java.util.JDTTransformerVisitor.java

License:Open Source License

public boolean visit(FieldDeclaration node) {
    org.whole.lang.java.model.FieldDeclaration fieldDecl = lf.create(JavaEntityDescriptorEnum.FieldDeclaration);
    appendBodyDeclaration(fieldDecl);// w w w  .j a v a  2 s. c o  m

    if (acceptChild(node.getJavadoc()))
        fieldDecl.setJavadoc(this.javadoc);

    acceptChild(node.getType());
    fieldDecl.setType(type);

    List<?> modifiers = node.modifiers();
    if (!modifiers.isEmpty()) {
        fieldDecl.setModifiers(lf.create(JavaEntityDescriptorEnum.ExtendedModifiers));
        setExtendedModifiers(fieldDecl.getModifiers(), modifiers);
    }

    Iterator<?> i = node.fragments().iterator();
    while (i.hasNext()) {
        ((ASTNode) i.next()).accept(this);
        fieldDecl.getFragments().wAdd(varFrag);
    }

    return false;
}