Class AnnotationType
- java.lang.Object
-
- com.mrivanplays.annotationconfig.core.AnnotationType
-
public final class AnnotationType extends Object
Represents an annotation type, holding utility methods for the held raw annotation type.
-
-
Field Summary
Fields Modifier and Type Field Description static AnnotationType
COMMENT
static AnnotationType
COMMENTS
static AnnotationType
CONFIG_OBJECT
static AnnotationType
KEY
static AnnotationType
TYPE_RESOLVER
-
Constructor Summary
Constructors Constructor Description AnnotationType(Class<? extends Annotation> rawType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<? extends Annotation>
getRawType()
Returns the raw type held by this annotation type.boolean
is(AnnotationType type)
boolean
is(Class<? extends Annotation> anno)
Returns whether or not the specified raw annotation type exactly matches the held raw annotation type in this instance.static boolean
isCustom(AnnotationType type)
Returns whether or not the annotation type specified is custom.static AnnotationType
match(Class<? extends Annotation> anno)
Tries to match the annotation raw type to the built in annotation types.static AnnotationType
match(Class<? extends Annotation> anno, CustomAnnotationRegistry annoRegistry)
Tries to match the annotation raw type to the annotation types in theCustomAnnotationRegistry
and the built in annotation types.String
toString()
-
-
-
Field Detail
-
COMMENT
public static final AnnotationType COMMENT
-
COMMENTS
public static final AnnotationType COMMENTS
-
TYPE_RESOLVER
public static final AnnotationType TYPE_RESOLVER
-
KEY
public static final AnnotationType KEY
-
CONFIG_OBJECT
public static final AnnotationType CONFIG_OBJECT
-
-
Constructor Detail
-
AnnotationType
public AnnotationType(Class<? extends Annotation> rawType)
-
-
Method Detail
-
isCustom
public static boolean isCustom(AnnotationType type)
Returns whether or not the annotation type specified is custom.- Parameters:
type
- the type you want to check if its custom- Returns:
- boolean value, representing the outcome of the check.
-
match
public static AnnotationType match(Class<? extends Annotation> anno)
Tries to match the annotation raw type to the built in annotation types.If you're searching for a way to also match custom annotation types, use
match(Class, CustomAnnotationRegistry)
- Parameters:
anno
- annotation raw type- Returns:
- matched annotation type, or null
-
match
public static AnnotationType match(Class<? extends Annotation> anno, CustomAnnotationRegistry annoRegistry)
Tries to match the annotation raw type to the annotation types in theCustomAnnotationRegistry
and the built in annotation types.- Parameters:
anno
- annotation raw typeannoRegistry
- searched registry- Returns:
- matched annotation type, or null
-
getRawType
public Class<? extends Annotation> getRawType()
Returns the raw type held by this annotation type.- Returns:
- raw type
-
is
public boolean is(Class<? extends Annotation> anno)
Returns whether or not the specified raw annotation type exactly matches the held raw annotation type in this instance.- Parameters:
anno
- raw annotation type- Returns:
- boolean value, representing the outcome of this check
-
is
public boolean is(AnnotationType type)
- Parameters:
type
- annotation type- Returns:
- boolean value, representing the outcome of this check
- See Also:
is(Class)
-
-