Class AppliedOnClassAnnotationObject
- All Implemented Interfaces:
Annotation
onClass() property.
This class extends AppliedAnnotationObject to provide both string-based targeting (via AppliedAnnotationObject.on())
and type-safe class-based targeting (via onClass()).
Difference between on and onClass :
AppliedAnnotationObject.on()- Returns string-based targets (e.g.,"com.example.MyClass" )
Useful for:- Configuration files where class references aren't available
- Targeting classes that may not be loaded yet
- Pattern matching or wildcard targeting
onClass()- Returns Class object targets (e.g.,MyClass. )class
Useful for:- Type-safe programmatic configuration
- Direct class references in code
- Avoiding string-based name matching
Example:
Notes:
- The
AppliedAnnotationObject.on()method returns string representations of ALL targets (both string-based and class-based) - The
onClass()method returns only the Class object targets - When using
BuilderT.on(Class...), classes are converted to strings and stored inAppliedAnnotationObject.on() - When using
BuilderT.onClass(Class...), classes are stored as Class objects inonClass()
See Also:
AppliedAnnotationObject- Parent class documentation- Overview > juneau-commons > Annotations
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.juneau.commons.annotation.AppliedAnnotationObject
AppliedAnnotationObject.Builder, AppliedAnnotationObject.BuilderC, AppliedAnnotationObject.BuilderM, AppliedAnnotationObject.BuilderMF, AppliedAnnotationObject.BuilderT, AppliedAnnotationObject.BuilderTM, AppliedAnnotationObject.BuilderTMF, AppliedAnnotationObject.BuilderTMFC -
Constructor Summary
ConstructorsConstructorDescriptionConstructor. -
Method Summary
Methods inherited from class org.apache.juneau.commons.annotation.AppliedAnnotationObject
onMethods inherited from class org.apache.juneau.commons.annotation.AnnotationObject
annotationType, equals, hashCode, propertyMap, toString
-
Constructor Details
-
AppliedOnClassAnnotationObject
Constructor.- Parameters:
b- The builder used to instantiate the fields of this class.
-
-
Method Details
-
onClass
The targets this annotation applies to.- Returns:
- The targets this annotation applies to.
-