public class JPackage extends Object implements JPackage
Modifier and Type | Method and Description |
---|---|
JClassType |
findType(String typeName)
Finds a type in this package.
|
JClassType |
findType(String[] typeName)
Finds a type in this package.
|
<T extends Annotation> |
getAnnotation(Class<T> annotationClass)
Returns an instance of the specified annotation type if it is present on
this element or
null if it is not. |
Annotation[] |
getAnnotations()
Returns all the annotations present on this element.
|
Annotation[] |
getDeclaredAnnotations()
Returns the annotations declared directly on this element; does not include
any inherited annotations.
|
String |
getName()
Returns the name of the package.
|
JClassType |
getType(String typeName)
Finds a type in this package.
|
JClassType[] |
getTypes()
Returns all top-level types in this package.
|
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationClass)
Returns
true if this item has an annotation of the specified
type. |
boolean |
isDefault()
Returns
true only for the default package. |
String |
toString() |
public JClassType findType(String typeName)
JPackage
public JClassType findType(String[] typeName)
JPackage
public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
HasAnnotations
null
if it is not. For a class, this will
look for annotations on supertypes as well.getAnnotation
in interface HasAnnotations
annotationClass
- annotation type to search fornull
if it is notpublic Annotation[] getAnnotations()
HasAnnotations
getAnnotations
in interface HasAnnotations
public Annotation[] getDeclaredAnnotations()
HasAnnotations
getDeclaredAnnotations
in interface HasAnnotations
public String getName()
JPackage
public JClassType getType(String typeName) throws NotFoundException
JPackage
getType
in interface JPackage
typeName
- the name of the type; use the .
separated to
search for a nested typenull
if the type does not exist in this
packageNotFoundException
public JClassType[] getTypes()
JPackage
public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
HasAnnotations
true
if this item has an annotation of the specified
type. For a class, this will look at supertypes as well.isAnnotationPresent
in interface HasAnnotations
true
if this item has an annotation of the specified
typepublic boolean isDefault()
JPackage
true
only for the default package.Copyright © 2018. All rights reserved.