Example usage for org.eclipse.jdt.core.dom ASTNode setFlags

List of usage examples for org.eclipse.jdt.core.dom ASTNode setFlags

Introduction

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

Prototype

public final void setFlags(int flags) 

Source Link

Document

Sets the flags associated with this node to the given value.

Usage

From source file:org.eclipse.che.jdt.dom.ASTNodes.java

License:Open Source License

/**
 * Adds flags to the given node and all its descendants.
 *
 * @param root//w ww.  j  ava2 s  .  co  m
 *         The root node
 * @param flags
 *         The flags to set
 */
public static void setFlagsToAST(ASTNode root, final int flags) {
    root.accept(new GenericVisitor(true) {
        @Override
        protected boolean visitNode(ASTNode node) {
            node.setFlags(node.getFlags() | flags);
            return true;
        }
    });
}