Class AnnotatedElementImpl
- java.lang.Object
-
- org.glassfish.hk2.classmodel.reflect.impl.AnnotatedElementImpl
-
- All Implemented Interfaces:
AnnotatedElement
- Direct Known Subclasses:
FieldModelImpl,MethodModelImpl,TypeImpl
public class AnnotatedElementImpl extends java.lang.Object implements AnnotatedElement
Implementation of an annotated element
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<AnnotationModel>annotationsprivate booleanisApplicationClassprivate java.lang.Stringname
-
Constructor Summary
Constructors Constructor Description AnnotatedElementImpl(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddAnnotation(AnnotationModel annotation)AnnotationModelgetAnnotation(java.lang.String name)Returns an annotation model if the type is annotated with the passed annotation namejava.util.Collection<AnnotationModel>getAnnotations()Returns a unmodifiable set of annotations that are present on this annotated element.java.lang.StringgetName()Annotated element have a name, which vary depending on the actual subclass type.booleanisApplicationClass()protected voidprint(java.lang.StringBuffer sb)voidsetApplicationClass(boolean applicationClass)java.lang.StringshortDesc()Construct and return a short description name that can be used to display the instance valuejava.lang.StringtoString()
-
-
-
Field Detail
-
name
private final java.lang.String name
-
annotations
private final java.util.List<AnnotationModel> annotations
-
isApplicationClass
private boolean isApplicationClass
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:AnnotatedElementAnnotated element have a name, which vary depending on the actual subclass type. For instance, a class annotated element's name is the class name as obtained fromClass.getName()- Specified by:
getNamein interfaceAnnotatedElement- Returns:
- the annotated element name
-
addAnnotation
void addAnnotation(AnnotationModel annotation)
-
getAnnotations
public java.util.Collection<AnnotationModel> getAnnotations()
Description copied from interface:AnnotatedElementReturns a unmodifiable set of annotations that are present on this annotated element.- Specified by:
getAnnotationsin interfaceAnnotatedElement- Returns:
- the collection of annotations
-
getAnnotation
public AnnotationModel getAnnotation(java.lang.String name)
Description copied from interface:AnnotatedElementReturns an annotation model if the type is annotated with the passed annotation name- Specified by:
getAnnotationin interfaceAnnotatedElement- Parameters:
name- the annotation name- Returns:
- the annotation model or null if the type is not annotated with this annotation type of the passed name.
-
isApplicationClass
public boolean isApplicationClass()
-
setApplicationClass
public void setApplicationClass(boolean applicationClass)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
shortDesc
public java.lang.String shortDesc()
Description copied from interface:AnnotatedElementConstruct and return a short description name that can be used to display the instance value- Specified by:
shortDescin interfaceAnnotatedElement- Returns:
- a short description
-
print
protected void print(java.lang.StringBuffer sb)
-
-