/** * Creates a missing value for the supplied annotation property. * * @param method A method representing an annotation property. * @return An annotation value for a missing property. */ @SuppressWarnings("unchecked") protected static AnnotationValue<?, ?> of(Method method) { return new MissingValue((Class<? extends Annotation>) method.getDeclaringClass(), method.getName()); }
/** * Creates a default value for the given method. * * @param method The method from which to attempt the extraction of a default value. * @return A default value representation. */ private static AnnotationValue<?, ?> defaultValueOf(Method method) { Object defaultValue = method.getDefaultValue(); return defaultValue == null ? MissingValue.of(method) : AnnotationDescription.ForLoadedAnnotation.asValue(defaultValue, method.getReturnType()); }