@Override public final <A extends Annotation> A getAnnotation(Class<A> annotationClass) { return accessibleObject.getAnnotation(annotationClass); }
@Override public final <A extends Annotation> A getAnnotation(Class<A> annotationClass) { return accessibleObject.getAnnotation(annotationClass); }
@Override public final <A extends Annotation> A getAnnotation(Class<A> annotationClass) { return accessibleObject.getAnnotation(annotationClass); }
public Annotation callAccessibleObjectGetAnnotation(AccessibleObject m, Class<? extends Annotation> annotClass) { return m.getAnnotation(annotClass); } public boolean callAccessibleObjectIsAnnotationPresent(AccessibleObject m, Class<? extends Annotation> annotClass) {
@Override public final <A extends Annotation> A getAnnotation(Class<A> annotationClass) { return accessibleObject.getAnnotation(annotationClass); }
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) { return accessible.getAnnotation(annotationClass); } public String getName() { return name; }
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { if (annotationType == null) { throw new NullPointerException("annotationType == null"); } return getAnnotation(annotationType) != null; }
/** * Reads {@link AnnotationData annotation data} on provided accessible object. * If annotation is not presented, <code>null</code> is returned. */ public D readAnnotationData(AccessibleObject accessibleObject) { A annotation = accessibleObject.getAnnotation(annotationClass); if (annotation == null) { return null; } return createAnnotationData(annotation); }
@Override protected Annotation findAutowiredAnnotation(AccessibleObject ao) { if (ao.getAnnotation(BatchProperty.class) != null) { return null; } return super.findAutowiredAnnotation(ao); } }
@Override public String getName() { if (this.accessible.isAnnotationPresent(ManagedAttribute.class)) { String name = this.accessible.getAnnotation(ManagedAttribute.class).name(); if (!name.isEmpty()) return name; } if (this.accessible.isAnnotationPresent(Property.class)) { String name = this.accessible.getAnnotation(Property.class).name(); if (!name.isEmpty()) return name; } return null; }
@Override public String getDescription() { if (this.accessible.isAnnotationPresent(ManagedAttribute.class)) { return this.accessible.getAnnotation(ManagedAttribute.class).description(); } if (this.accessible.isAnnotationPresent(Property.class)) { return this.accessible.getAnnotation(Property.class).description(); } return this.accessible.toString(); }
Property annotation = ao.getAnnotation(Property.class) ; if (annotation == null) { throw new IllegalArgumentException("@Property annotation is required for checking dependencies;" +
/** * DFS of dependency graph formed by Property annotations and dependsUpon parameter * This is used to create a list of Properties in dependency order */ static void addPropertyToDependencyList(List<AccessibleObject> orderedList, Map<String, AccessibleObject> props, Stack<AccessibleObject> stack, AccessibleObject obj) { if (orderedList.contains(obj)) return ; if (stack.search(obj) > 0) { throw new RuntimeException("Deadlock in @Property dependency processing") ; } // record the fact that we are processing obj stack.push(obj) ; // process dependencies for this object before adding it to the list Property annotation = obj.getAnnotation(Property.class) ; String dependsClause = annotation.dependsUpon() ; StringTokenizer st = new StringTokenizer(dependsClause, ",") ; while (st.hasMoreTokens()) { String token = st.nextToken().trim(); AccessibleObject dep = props.get(token) ; // if null, throw exception addPropertyToDependencyList(orderedList, props, stack, dep) ; } // indicate we're done with processing dependencies stack.pop() ; // we can now add in dependency order orderedList.add(obj) ; }
private static String annotatedName(AccessibleObject obj) { if (obj.isAnnotationPresent(PropertyName.class)) { PropertyName annotation = obj.getAnnotation(PropertyName.class); return annotation.value(); } return null; }
private static boolean isManagedAttribute(AccessibleObject object) { return object.isAnnotationPresent(ManagedAttribute.class) || (object.isAnnotationPresent(Property.class) && object.getAnnotation(Property.class).exposeAsManagedAttribute()); } }
private Annotation findAutowiredAnnotation(AccessibleObject ao) { for (Class<? extends Annotation> type : this.autowiredAnnotationTypes) { Annotation annotation = ao.getAnnotation(type); if (annotation != null) { return annotation; } } return null; }
public static boolean isRequired(AccessibleObject object) { return object.getAnnotation(org.mule.runtime.extension.api.annotation.param.Optional.class) == null; }
protected String getFilename(AccessibleObject method) { PartFilename fname = method.getAnnotation(PartFilename.class); return fname == null ? null : fname.value(); }
@SuppressWarnings(value = "unchecked") public static MediaType getConsumes(Class declaring, AccessibleObject method) { Consumes consume = method.getAnnotation(Consumes.class); if (consume == null) { consume = (Consumes) declaring.getAnnotation(Consumes.class); if (consume == null) return null; } return MediaType.valueOf(consume.value()[0]); }
/** * Creates a ParamField object * @param member a field or method which has {@link Field} annotation */ public ParamField(AccessibleObject member) throws TikaConfigException { if (member instanceof java.lang.reflect.Field) { field = (java.lang.reflect.Field) member; } else { setter = (Method) member; } Field annotation = member.getAnnotation(Field.class); required = annotation.required(); name = retrieveParamName(annotation); type = retrieveType(); }