Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.puppycrawl.tools.checkstyle.api
Class ScopeUtils  view ScopeUtils download ScopeUtils.java

java.lang.Object
  extended bycom.puppycrawl.tools.checkstyle.api.ScopeUtils

public final class ScopeUtils
extends java.lang.Object

Contains utility methods for working on scope.

Version:
1.0

Constructor Summary
private ScopeUtils()
          prevent instantiation
 
Method Summary
static Scope getScopeFromMods(DetailAST aMods)
          Returns the Scope specified by the modifier set.
static Scope getSurroundingScope(DetailAST aAST)
          Returns the scope of the surrounding "block".
static boolean inCodeBlock(DetailAST aAST)
          Returns whether the scope of a node is restricted to a code block.
static boolean inInterfaceBlock(DetailAST aAST)
          Returns whether a node is directly contained within an interface block.
static boolean isLocalVariableDef(DetailAST aAST)
          Determines whether a node is a local variable definition.
static boolean isOuterMostType(DetailAST aAST)
          Returns whether a node is contained in the outer most type block.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScopeUtils

private ScopeUtils()
prevent instantiation

Method Detail

getScopeFromMods

public static Scope getScopeFromMods(DetailAST aMods)
Returns the Scope specified by the modifier set.


getSurroundingScope

public static Scope getSurroundingScope(DetailAST aAST)
Returns the scope of the surrounding "block".


inInterfaceBlock

public static boolean inInterfaceBlock(DetailAST aAST)
Returns whether a node is directly contained within an interface block.


inCodeBlock

public static boolean inCodeBlock(DetailAST aAST)
Returns whether the scope of a node is restricted to a code block. A code block is a method or constructor body, or a initialiser block.


isOuterMostType

public static boolean isOuterMostType(DetailAST aAST)
Returns whether a node is contained in the outer most type block.


isLocalVariableDef

public static boolean isLocalVariableDef(DetailAST aAST)
Determines whether a node is a local variable definition. I.e. if it is declared in a code block, a for initializer, or a catch parameter.