/** * Validates contained value against its member definition * and if ok returns the value. * Otherwise, if the value type mismatches definition * or the value itself describes an error, * throws appropriate exception. * <br> Note, this method may return null if this element was constructed * with such value. * * @see #rethrowError() * @see #copyValue() * @return actual valid value or null if no value */ public Object validateValue() throws Throwable { if (tag == ERROR) { rethrowError(); } if (value == NO_VALUE) { return null; } if (elementType == value.getClass() || elementType.isInstance(value)) { // nested annotation value return copyValue(); } else { throw new AnnotationTypeMismatchException(definingMethod, value.getClass().getName()); } }
/** * Validates contained value against its member definition * and if ok returns the value. * Otherwise, if the value type mismatches definition * or the value itself describes an error, * throws appropriate exception. * <br> Note, this method may return null if this element was constructed * with such value. * * @see #rethrowError() * @see #copyValue() * @return actual valid value or null if no value */ public Object validateValue() throws Throwable { if (tag == ERROR) { rethrowError(); } if (value == NO_VALUE) { return null; } if (elementType == value.getClass() || elementType.isInstance(value)) { // nested annotation value return copyValue(); } else { throw new AnnotationTypeMismatchException(definingMethod, value.getClass().getName()); } }
/** * Validates contained value against its member definition * and if ok returns the value. * Otherwise, if the value type mismatches definition * or the value itself describes an error, * throws appropriate exception. * <br> Note, this method may return null if this element was constructed * with such value. * * @see #rethrowError() * @see #copyValue() * @return actual valid value or null if no value */ public Object validateValue() throws Throwable { if (tag == ERROR) { rethrowError(); } if (value == NO_VALUE) { return null; } if (elementType == value.getClass() || elementType.isInstance(value)) { // nested annotation value return copyValue(); } else { throw new AnnotationTypeMismatchException(definingMethod, value.getClass().getName()); } }
/** * Validates contained value against its member definition * and if ok returns the value. * Otherwise, if the value type mismatches definition * or the value itself describes an error, * throws appropriate exception. * <br> Note, this method may return null if this element was constructed * with such value. * * @see #rethrowError() * @see #copyValue() * @return actual valid value or null if no value */ public Object validateValue() throws Throwable { if (tag == ERROR) { rethrowError(); } if (value == NO_VALUE) { return null; } if (elementType == value.getClass() || elementType.isInstance(value)) { // nested annotation value return copyValue(); } else { throw new AnnotationTypeMismatchException(definingMethod, value.getClass().getName()); } }
/** * Validates contained value against its member definition * and if ok returns the value. * Otherwise, if the value type mismatches definition * or the value itself describes an error, * throws appropriate exception. * <br> Note, this method may return null if this element was constructed * with such value. * * @see #rethrowError() * @see #copyValue() * @return actual valid value or null if no value */ public Object validateValue() throws Throwable { if (tag == ERROR) { rethrowError(); } if (value == NO_VALUE) { return null; } if (elementType == value.getClass() || elementType.isInstance(value)) { // nested annotation value return copyValue(); } else { throw new AnnotationTypeMismatchException(definingMethod, value.getClass().getName()); } }
/** * Validates contained value against its member definition * and if ok returns the value. * Otherwise, if the value type mismatches definition * or the value itself describes an error, * throws appropriate exception. * <br> Note, this method may return null if this element was constructed * with such value. * * @see #rethrowError() * @see #copyValue() * @return actual valid value or null if no value */ public Object validateValue() throws Throwable { if (tag == ERROR) { rethrowError(); } if (value == NO_VALUE) { return null; } if (elementType == value.getClass() || elementType.isInstance(value)) { // nested annotation value return copyValue(); } else { throw new AnnotationTypeMismatchException(definingMethod, value.getClass().getName()); } }
/** * Validates contained value against its member definition * and if ok returns the value. * Otherwise, if the value type mismatches definition * or the value itself describes an error, * throws appropriate exception. * <br> Note, this method may return null if this element was constructed * with such value. * * @see #rethrowError() * @see #copyValue() * @return actual valid value or null if no value */ public Object validateValue() throws Throwable { if (tag == ERROR) { rethrowError(); } if (value == NO_VALUE) { return null; } if (elementType == value.getClass() || elementType.isInstance(value)) { // nested annotation value return copyValue(); } else { throw new AnnotationTypeMismatchException(definingMethod, value.getClass().getName()); } }