org.sonar.api.resources
Class Scopes

java.lang.Object
  extended by org.sonar.api.resources.Scopes

public final class Scopes
extends Object

Resource scopes are used to group some types of resources. For example Java methods, Flex methods, C functions and Cobol paragraphs are grouped in the scope "block unit".

Scopes are generally used in UI to display/hide some services or in web services.

Scopes are not extensible by plugins.

Since:
2.6

Field Summary
static String BLOCK_UNIT
          Deprecated. since 4.3 resources under FILE level are no more be supported since 4.2.
static String DIRECTORY
          For example directory or Java package.
static String FILE
          For example a Java file.
static String PROGRAM_UNIT
          Deprecated. since 4.3 resources under FILE level are no more be supported since 4.2.
static String PROJECT
          For example view, subview, project, module or library.
static String[] SORTED_SCOPES
           
 
Method Summary
static boolean isBlockUnit(Resource resource)
          Deprecated. since 4.3 resources under FILE level are no more be supported since 4.2.
static boolean isDirectory(Resource resource)
           
static boolean isFile(Resource resource)
          This scope is sometimes called a "compilation unit".
static boolean isHigherThan(Resource resource, String than)
           
static boolean isHigherThan(String scope, String than)
           
static boolean isHigherThanOrEquals(Resource resource, String than)
           
static boolean isHigherThanOrEquals(String scope, String than)
           
static boolean isProgramUnit(Resource resource)
          Deprecated. since 4.3 resources under FILE level are no more be supported since 4.2.
static boolean isProject(Resource resource)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROJECT

public static final String PROJECT
For example view, subview, project, module or library. Persisted in database.

See Also:
Constant Field Values

DIRECTORY

public static final String DIRECTORY
For example directory or Java package. Persisted in database. A more generic term for this scope could be "namespace"

See Also:
Constant Field Values

FILE

public static final String FILE
For example a Java file. Persisted in database. A more generic term for this scope could be "compilation unit". It's the lowest scope in file system units.

See Also:
Constant Field Values

PROGRAM_UNIT

@Deprecated
public static final String PROGRAM_UNIT
Deprecated. since 4.3 resources under FILE level are no more be supported since 4.2.
Types like Java classes/interfaces. Not persisted in database.

See Also:
Constant Field Values

BLOCK_UNIT

@Deprecated
public static final String BLOCK_UNIT
Deprecated. since 4.3 resources under FILE level are no more be supported since 4.2.
Block units like methods, functions or Cobol paragraphs.

See Also:
Constant Field Values

SORTED_SCOPES

public static final String[] SORTED_SCOPES
Method Detail

isProject

public static boolean isProject(Resource resource)

isDirectory

public static boolean isDirectory(Resource resource)

isFile

public static boolean isFile(Resource resource)
This scope is sometimes called a "compilation unit".


isProgramUnit

@Deprecated
public static boolean isProgramUnit(Resource resource)
Deprecated. since 4.3 resources under FILE level are no more be supported since 4.2.

A program unit can be a Java class.


isBlockUnit

@Deprecated
public static boolean isBlockUnit(Resource resource)
Deprecated. since 4.3 resources under FILE level are no more be supported since 4.2.


isHigherThan

public static boolean isHigherThan(Resource resource,
                                   String than)

isHigherThan

public static boolean isHigherThan(String scope,
                                   String than)

isHigherThanOrEquals

public static boolean isHigherThanOrEquals(Resource resource,
                                           String than)

isHigherThanOrEquals

public static boolean isHigherThanOrEquals(String scope,
                                           String than)


Copyright © 2009–2015 SonarSource. All rights reserved.