ceylon.language.meta.optionalAnnotation.ceylon Maven / Gradle / Ivy
import ceylon.language.meta.model { Class }
// Do we really need this? Isn't annotations sufficient?
"The value of given optional annotation type on the given program element,
or null if the program element was not annotated with that annotation type.
For example:
// Does the process declaration have the Shared annotation?
value isShared = optionalAnnotation(`SharedAnnotation`, `value process`) exists;
"
shared Value? optionalAnnotation(
Class> annotationType,
ProgramElement programElement)
given Value satisfies OptionalAnnotation
given ProgramElement satisfies Annotated {
return annotations(annotationType, programElement);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy