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

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

Introduction

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

Prototype

public final int getNodeType() 

Source Link

Document

Returns an integer value identifying the type of this concrete AST node.

Usage

From source file:egovframework.mgt.fit.library.parser.visitor.ClassParsingVisitor.java

License:Apache License

/**
 *   ./*w w w .  ja va2s .c  o  m*/
 * @return   
 */
@Override
public boolean visit(FieldDeclaration node) {
    if (node.getNodeType() == ASTNode.FIELD_DECLARATION) {
        for (Object obj : node.fragments()) {
            if (obj instanceof VariableDeclaration) {
                VariableDeclaration vd = (VariableDeclaration) obj;
                Variable field = new Variable();
                field.setModifier(node.getModifiers());
                field.setType(project.resolveClass(ParsingHelper.getFullNameWithSimpleName(
                        node.getType().toString(), javaClass.getPackage(), javaClass.getImports())));
                field.setName(vd.getName().getFullyQualifiedName());
                field.setValue(StringHelper.safeToString(vd.getInitializer()));
                node.accept(new AnnotationParsingVisitor(field, ASTNode.FIELD_DECLARATION));
                field.setNode(vd);
                javaClass.addField(field);
            }
        }

    }
    return super.visit(node);
}