HasAnnotation( ) method
- Last Updated: March 13, 2026
- 1 minute read
- OpenEdge
- Version 13.1
- Documentation
Determines whether an annotation of a specified type is associated with the reflected class or class member. This method is primarily intended for marker annotations (annotation classes with no properties), where the presence of the annotation is sufficient.
By default, HasAnnotation() checks only the annotations that are
directly present on the reflected element. An overloaded form allows you to search
for the element in the inheritance hierarchy. When hierarchical searching is
enabled, the runtime searches the current element first and then checks inherited
versions of the element until it finds an annotation of the requested type.
Constructors are not inherited, so hierarchical searching has no effect when
reflecting on a constructor.
The method raises an error if the specified type is unknown or is not compatible with
Progress.Lang.Annotation.
Return type: LOGICAL
Access: Read-only
Applies to: Progress.Lang.Class class, Progress.Reflect.Constructor class, Progress.Reflect.Event class, Progress.Reflect.Method class, Progress.Reflect.Property class, Progress.Reflect.Variable class
Syntax
|
|
- annotationType
- A
Progress.Lang.Classobject that identifies the annotation class to test for. - searchInherited
- A LOGICAL value that specifies whether to search for the element in the
inheritance hierarchy for an annotation of the given type. If
TRUE, the runtime searches inherited versions of the element until it finds a matching annotation.
See also
ANNOTATION statement, [ ] Strongly typed annotation, Progress.Lang.Annotation class, Progress.Lang.Class class, GetAnnotation( ) method, GetAnnotations( ) method, IsAnnotation( ) method