} else if (value instanceof AnnotationTypeMismatchException) { AnnotationTypeMismatchException e = (AnnotationTypeMismatchException) value; throw new AnnotationTypeMismatchException(e.element(), e.foundType()); } else if (value instanceof ArrayStoreException) { ArrayStoreException e = (ArrayStoreException) value;
/** * {@inheritDoc} */ public Object invoke(Object proxy, Method method, Object[] argument) { if (method.getDeclaringClass() != annotationType) { if (method.getName().equals(HASH_CODE)) { return hashCodeRepresentation(); } else if (method.getName().equals(EQUALS) && method.getParameterTypes().length == 1) { return equalsRepresentation(proxy, argument[0]); } else if (method.getName().equals(TO_STRING)) { return toStringRepresentation(); } else /* if (method.getName().equals("annotationType")) */ { return annotationType; } } Object value = values.get(method).resolve(); if (!asWrapper(method.getReturnType()).isAssignableFrom(value.getClass())) { throw new AnnotationTypeMismatchException(method, value.getClass().toString()); } return value; }
/** * 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()); } }
} else if (value instanceof AnnotationTypeMismatchException) { AnnotationTypeMismatchException e = (AnnotationTypeMismatchException) value; throw new AnnotationTypeMismatchException(e.element(), e.foundType()); } else if (value instanceof ArrayStoreException) { ArrayStoreException e = (ArrayStoreException) value;
protected RuntimeException generateException() { return new AnnotationTypeMismatchException(method, attr.type.toString()); } };
} else if (value instanceof AnnotationTypeMismatchException) { AnnotationTypeMismatchException e = (AnnotationTypeMismatchException) value; throw new AnnotationTypeMismatchException(e.element(), e.foundType()); } else if (value instanceof ArrayStoreException) { ArrayStoreException e = (ArrayStoreException) value;
protected RuntimeException generateException() { return new AnnotationTypeMismatchException(method, attr.type.toString()); } };
} else if (value instanceof AnnotationTypeMismatchException) { AnnotationTypeMismatchException e = (AnnotationTypeMismatchException) value; throw new AnnotationTypeMismatchException(e.element(), e.foundType()); } else if (value instanceof ArrayStoreException) { ArrayStoreException e = (ArrayStoreException) value;
/** * 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()); } }
} else if (value instanceof AnnotationTypeMismatchException) { AnnotationTypeMismatchException e = (AnnotationTypeMismatchException) value; throw new AnnotationTypeMismatchException(e.element(), e.foundType()); } else if (value instanceof ArrayStoreException) { ArrayStoreException e = (ArrayStoreException) value;
@Override public Object invoke(Object proxy, Method method, Object[] argument) { if (method.getDeclaringClass() != annotationType) { if (method.getName().equals(HASH_CODE)) { return hashCodeRepresentation(); } else if (method.getName().equals(EQUALS) && method.getParameterTypes().length == 1) { return equalsRepresentation(proxy, argument[0]); } else if (method.getName().equals(TO_STRING)) { return toStringRepresentation(); } else /* if (method.getName().equals("annotationType")) */ { return annotationType; } } Object value = values.get(method).resolve(); if (!asWrapper(method.getReturnType()).isAssignableFrom(value.getClass())) { throw new AnnotationTypeMismatchException(method, value.getClass().toString()); } return value; }
} else if (value instanceof AnnotationTypeMismatchException) { AnnotationTypeMismatchException e = (AnnotationTypeMismatchException) value; throw new AnnotationTypeMismatchException(e.element(), e.foundType()); } else if (value instanceof ArrayStoreException) { ArrayStoreException e = (ArrayStoreException) value;
/** * 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 * @throws Throwable wrapper throwable */ 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()); } }
} else if (value instanceof AnnotationTypeMismatchException) { AnnotationTypeMismatchException e = (AnnotationTypeMismatchException) value; throw new AnnotationTypeMismatchException(e.element(), e.foundType()); } else if (value instanceof ArrayStoreException) { ArrayStoreException e = (ArrayStoreException) value;
@Override public Object invoke(Object proxy, Method method, Object[] arguments) { if (method.getDeclaringClass() != annotationType) { if (method.getName().equals(HASH_CODE)) { return hashCodeRepresentation(); } else if (method.getName().equals(EQUALS) && method.getParameterTypes().length == 1) { return equalsRepresentation(proxy, arguments[0]); } else if (method.getName().equals(TO_STRING)) { return toStringRepresentation(); } else /* method.getName().equals("annotationType") */ { return annotationType; } } Object value = values.get(method).resolve(); if (!asWrapper(method.getReturnType()).isAssignableFrom(value.getClass())) { throw new AnnotationTypeMismatchException(method, value.getClass().toString()); } return value; }
} else if (value instanceof AnnotationTypeMismatchException) { AnnotationTypeMismatchException e = (AnnotationTypeMismatchException) value; throw new AnnotationTypeMismatchException(e.element(), e.foundType()); } else if (value instanceof ArrayStoreException) { ArrayStoreException e = (ArrayStoreException) value;
/** * 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()); } }