Package org.jboss.weld.resources.spi
Interface ClassFileInfo
-
public interface ClassFileInfoRepresents metadata of a Java class. Weld uses this metadata to decide whether the class should be processed by Weld or not without loading the class.- Author:
- Jozef Hartinger
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classClassFileInfo.NestingTypeHelper enum which lists all possible nesting types of a class.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleancontainsAnnotation(Class<? extends Annotation> annotationType)Indicates whether this class contains an annotation of the specified annotation type.StringgetClassName()Returns the name of this class.intgetModifiers()Returns the class access and property modifiers, as defined in http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.1-200-E.1ClassFileInfo.NestingTypegetNestingType()Returns the nesting type of the class usingClassFileInfo.NestingTypeenum.StringgetSuperclassName()Returns the name of this class's superclass or java.lang.Object if this class does not have a superclass.booleanhasCdiConstructor()Indicates whether this class has a CDI constructor.booleanisAnnotationDeclared(Class<? extends Annotation> annotationType)Indicates whether an annotation of the specified annotation type is directly present on this class.booleanisAssignableFrom(Class<?> javaClass)Indicates whether this class is either the same as, or is a superclass of the specified class.booleanisAssignableTo(Class<?> javaClass)Indicates whether this class is either the same as, or is a subclass of the specified class.default booleanisTopLevelClass()Deprecated - usegetClassNestingType()instead.booleanisVetoed()Indicates whether this class is vetoed from CDI processing.
-
-
-
Method Detail
-
getClassName
String getClassName()
Returns the name of this class.- Returns:
- the FQCN of the class represented by this class file
-
getSuperclassName
String getSuperclassName()
Returns the name of this class's superclass or java.lang.Object if this class does not have a superclass.- Returns:
- the FQCN of the superclass of this class or java.lang.Object if this class does not have a superclass
-
isAnnotationDeclared
boolean isAnnotationDeclared(Class<? extends Annotation> annotationType)
Indicates whether an annotation of the specified annotation type is directly present on this class.- Parameters:
annotationType- the specified annotation type- Returns:
- true if an annotation of a specified type is directly present on this class, false otherwise
-
containsAnnotation
boolean containsAnnotation(Class<? extends Annotation> annotationType)
Indicates whether this class contains an annotation of the specified annotation type. A class is said to contain the annotation if any of these applies:- The annotation or an annotation annotated with the annotation is present on the class
- The annotation or an annotation annotated with the annotation, which is annotated with
Inherited, is present on a direct or indirect superclass of the given class - The annotation or an annotation annotated with the annotation is present on a field or method declared by the given class or any direct or indirect superclass of the given class
- The annotation or an annotation annotated with the annotation is present on a parameter of a method declared by the given class or any direct or indirect superclass of the given class
- The annotation or an annotation annotated with the annotation is present on a default method or a parameter of a default method declared by an interface directly or indirectly implemented by the given class
- The annotation or an annotation annotated with the annotation is present on a constructor declared by the given class
- The annotation or an annotation annotated with the annotation is present on a parameter of a constructor declared by the given class
- Parameters:
annotationType- the specified annotation type- Returns:
- true if the class contains the annotation, false otherwise
-
getModifiers
int getModifiers()
Returns the class access and property modifiers, as defined in http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.1-200-E.1- Returns:
- class access and property modifiers
-
hasCdiConstructor
boolean hasCdiConstructor()
Indicates whether this class has a CDI constructor.- Returns:
- true if this class has a constructor annotated with
Injector a no-arg constructor, false otherwise
-
isAssignableFrom
boolean isAssignableFrom(Class<?> javaClass)
Indicates whether this class is either the same as, or is a superclass of the specified class.- Parameters:
javaClass- the specified class- Returns:
- true if this class is either the same as, or is a superclass of the specified class, false otherwise
-
isAssignableTo
boolean isAssignableTo(Class<?> javaClass)
Indicates whether this class is either the same as, or is a subclass of the specified class.- Parameters:
javaClass- the specified class- Returns:
- true if this class is either the same as, or is a subclass of the specified class, false otherwise
-
isVetoed
boolean isVetoed()
Indicates whether this class is vetoed from CDI processing.- Returns:
- true if the
Vetoedannotation is present on this class or the class's package, false otherwise
-
isTopLevelClass
default boolean isTopLevelClass()
Deprecated - usegetClassNestingType()instead. Indicates whether this class is a top-level class or an inner class.- Returns:
- true if this class is a top-level class, false otherwise
-
getNestingType
ClassFileInfo.NestingType getNestingType()
Returns the nesting type of the class usingClassFileInfo.NestingTypeenum. A class can be either top level, nested inner, nested local, nested anonymous or nested static.- Returns:
- Class
ClassFileInfo.NestingType
-
-