/** * Reads {@link AnnotationData annotation data} on provided type. * If annotation is not presented, <code>null</code> is returned. */ public D readAnnotationData(Class<?> type) { A annotation = type.getAnnotation(annotationClass); if (annotation == null) { return null; } return createAnnotationData(annotation); }
/** * Reads boolean element from the annotation. */ protected boolean readBoolean(A annotation, String name, boolean defaultValue) { Boolean value = (Boolean) readElement(annotation, name); if (value == null) { return defaultValue; } return value.booleanValue(); }
/** * Reads string element from the annotation. Empty strings are detected * and default value is returned instead. */ protected String readString(A annotation, String name, String defaultValue) { String value = readStringElement(annotation, name); if (StringUtil.isEmpty(value)) { value = defaultValue; } return value; }
/** * Need to override to make java compiler happy. */ @Override public ActionAnnotationData<A> readAnnotationData(AccessibleObject accessibleObject) { return super.readAnnotationData(accessibleObject); }
/** * Need to override to make java compiler happy. */ @Override public TransactionAnnotationData<A> readAnnotationData(AccessibleObject accessibleObject) { return super.readAnnotationData(accessibleObject); }
/** * 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); }
/** * Reads int element from the annotation. */ protected int readInt(A annotation, String name, int defaultValue) { Integer value = (Integer) readElement(annotation, name); if (value == null) { return defaultValue; } return value.intValue(); }
/** * Reads string element from the annotation. Empty strings are detected * and default value is returned instead. */ protected String readString(A annotation, String name, String defaultValue) { String value = readStringElement(annotation, name); if (StringUtil.isEmpty(value)) { value = defaultValue; } return value; }
/** * Reads {@link AnnotationData annotation data} on provided type. * If annotation is not presented, <code>null</code> is returned. */ public D readAnnotationData(Class<?> type) { A annotation = type.getAnnotation(annotationClass); if (annotation == null) { return null; } return createAnnotationData(annotation); }
/** * Reads boolean element from the annotation. */ protected boolean readBoolean(A annotation, String name, boolean defaultValue) { Boolean value = (Boolean) readElement(annotation, name); if (value == null) { return defaultValue; } return value.booleanValue(); }
/** * 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); }
/** * Reads int element from the annotation. */ protected int readInt(A annotation, String name, int defaultValue) { Integer value = (Integer) readElement(annotation, name); if (value == null) { return defaultValue; } return value.intValue(); }