org.sonar.java.api
Class JavaClass

java.lang.Object
  extended by org.sonar.api.resources.Resource
      extended by org.sonar.java.api.JavaClass

public final class JavaClass
extends Resource

Since:
2.6

Nested Class Summary
static class JavaClass.Builder
           
 
Field Summary
static String QUALIFIER
           
static String SCOPE
           
static int UNKNOWN_LINE
           
 
Fields inherited from class org.sonar.api.resources.Resource
QUALIFIER_CLASS, QUALIFIER_DIRECTORY, QUALIFIER_FIELD, QUALIFIER_FILE, QUALIFIER_LIB, QUALIFIER_METHOD, QUALIFIER_MODULE, QUALIFIER_PACKAGE, QUALIFIER_PROJECT, QUALIFIER_SUBVIEW, QUALIFIER_UNIT_TEST_CLASS, QUALIFIER_VIEW, SCOPE_ENTITY, SCOPE_SET, SCOPE_SPACE
 
Method Summary
static JavaClass create(String name)
           
static JavaClass create(String packageName, String className)
           
 String getClassName()
           
 String getDescription()
           
 int getFromLine()
           
 Language getLanguage()
           
 String getLongName()
           
 String getName()
           
 String getPackageName()
           
 Resource getParent()
          The parent is used to build the resources tree, for example for relations between classes, packages and projects.
 String getQualifier()
           
 String getScope()
           
 int getToLine()
           
 boolean matchFilePattern(String antPattern)
          Check resource against an Ant pattern, like mypackag?/*Foo.java.
 String toString()
           
 
Methods inherited from class org.sonar.api.resources.Resource
equals, getEffectiveKey, getId, getKey, hashCode, isExcluded, setEffectiveKey, setExcluded, setId, setKey
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SCOPE

public static final String SCOPE
See Also:
Constant Field Values

QUALIFIER

public static final String QUALIFIER
See Also:
Constant Field Values

UNKNOWN_LINE

public static final int UNKNOWN_LINE
See Also:
Constant Field Values
Method Detail

getPackageName

public String getPackageName()

getClassName

public String getClassName()

getFromLine

public int getFromLine()

getToLine

public int getToLine()

getName

public String getName()
Specified by:
getName in class Resource
Returns:
the resource name

getLongName

public String getLongName()
Specified by:
getLongName in class Resource
Returns:
the resource long name

getDescription

public String getDescription()
Specified by:
getDescription in class Resource
Returns:
the resource description

getLanguage

public Language getLanguage()
Specified by:
getLanguage in class Resource
Returns:
the language

getScope

public String getScope()
Specified by:
getScope in class Resource
Returns:
the scope

getQualifier

public String getQualifier()
Specified by:
getQualifier in class Resource
Returns:
the qualifier

getParent

public Resource getParent()
Description copied from class: Resource
The parent is used to build the resources tree, for example for relations between classes, packages and projects.

Return null if the parent is the project.

Specified by:
getParent in class Resource

matchFilePattern

public boolean matchFilePattern(String antPattern)
Description copied from class: Resource
Check resource against an Ant pattern, like mypackag?/*Foo.java. It's used for example to match resource exclusions.

Specified by:
matchFilePattern in class Resource
Parameters:
antPattern - Ant-like pattern (with **, * and ?). It includes file suffixes.
Returns:
true if the resource matches the Ant pattern

toString

public String toString()
Overrides:
toString in class Object

create

public static JavaClass create(String name)

create

public static JavaClass create(String packageName,
                               String className)


Copyright © 2009-2011 SonarSource. All Rights Reserved.