/** * {@inheritDoc} */ public Void resolve() { throw new IncompleteAnnotationException(annotationType, property); }
Object value = element.validateValue(); if (value == null) { throw new IncompleteAnnotationException(klazz, name);
throw new IncompleteAnnotationException(annotationType, memberName);
@Override public Void resolve() { throw new IncompleteAnnotationException(annotationType, property); } }
@Override public Void resolve() { throw new IncompleteAnnotationException(annotationType, property); }
static private FuncInfo getFuncInfo(Method method) throws IncompleteAnnotationException { FuncInfo annotation = method.getAnnotation(FuncInfo.class); if (annotation != null) return annotation; throw new IncompleteAnnotationException(FuncInfo.class, "Method " + method.getName()); }
static private FuncInfo getFuncInfo(Method method) throws IncompleteAnnotationException { FuncInfo annotation = method.getAnnotation(FuncInfo.class); if (annotation != null) return annotation; throw new IncompleteAnnotationException(FuncInfo.class, "Method " + method.getName()); }
@Override public int hashCode() { int result = 0; for (Method m : type.getDeclaredMethods()) { Object o = m.getDefaultValue(); if (null == o) { throw new IncompleteAnnotationException(type, m.getName()); } result += AnnotationUtil.hashMember(m.getName(), o); } return result; }
@Override public int hashCode() { int result = 0; for (Method m : type.getDeclaredMethods()) { Object o = m.getDefaultValue(); if (null == o) { throw new IncompleteAnnotationException(type, m.getName()); } result += AnnotationUtil.hashMember(m.getName(), o); } return result; }
/** * 注册自定义的消息类型 * * @param messageType */ public static void registerAVIMMessageType(Class<? extends AVIMTypedMessage> messageType) { AVIMMessageType type = messageType.getAnnotation(AVIMMessageType.class); if (type == null) { throw new IncompleteAnnotationException(AVIMMessageType.class, "type"); } int messageTypeValue = type.type(); messageTypesRepository.put(messageTypeValue, messageType); try { Method initializeMethod = messageType.getDeclaredMethod("computeFieldAttribute", Class.class); initializeMethod.setAccessible(true); initializeMethod.invoke(null, messageType); } catch (Exception e) { LOGGER.d("failed to initialize message Fields"); } }
public Object invoke(Object proxy, Method method, Object[] args) { String member = method.getName(); Class<?>[] paramTypes = method.getParameterTypes(); // Handle Object and Annotation methods if (member.equals("equals") && paramTypes.length == 1 && paramTypes[0] == Object.class) return equalsImpl(args[0]); assert paramTypes.length == 0; if (member.equals("toString")) return toStringImpl(); if (member.equals("hashCode")) return hashCodeImpl(); if (member.equals("annotationType")) return type; // Handle annotation member accessors Object result = memberValues.get(member); if (result == null) throw new IncompleteAnnotationException(type, member); // if (result instanceof ExceptionProxy) // throw ((ExceptionProxy) result).generateException(); if (result.getClass().isArray() && Array.getLength(result) != 0) result = cloneArray(result); return result; }
/** * 注册自定义的消息类型 * * @param messageType */ public static void registerAVIMMessageType(Class<? extends AVIMTypedMessage> messageType) { AVIMMessageType type = messageType.getAnnotation(AVIMMessageType.class); if (type == null) { throw new IncompleteAnnotationException(AVIMMessageType.class, "type"); } int messageTypeValue = type.type(); messageTypesRepository.put(messageTypeValue, messageType); try { Method initializeMethod = messageType.getDeclaredMethod("computeFieldAttribute", Class.class); initializeMethod.setAccessible(true); initializeMethod.invoke(null, messageType); } catch (Exception e) { if (AVOSCloud.showInternalDebugLog()) { LogUtil.avlog.d("failed to initialize message Fields"); } } }
public Object invoke(Object proxy, Method method, Object[] args) { String member = method.getName(); Class[] paramTypes = method.getParameterTypes(); // Handle Object and Annotation methods if (member.equals("equals") && paramTypes.length == 1 && paramTypes[0] == Object.class) return equalsImpl(args[0]); assert paramTypes.length == 0; if (member.equals("toString")) return toStringImpl(); if (member.equals("hashCode")) return hashCodeImpl(); if (member.equals("annotationType")) return type; // Handle annotation member accessors Object result = memberValues.get(member); if (result == null) throw new IncompleteAnnotationException(type, member); // if (result instanceof ExceptionProxy) // throw ((ExceptionProxy) result).generateException(); if (result.getClass().isArray() && Array.getLength(result) != 0) result = cloneArray(result); return result; }
Object value = element.validateValue(); if (value == null) { throw new IncompleteAnnotationException(klazz, name);
Object value = element.validateValue(); if (value == null) { throw new IncompleteAnnotationException(klazz, name);
Object value = element.validateValue(); if (value == null) { throw new IncompleteAnnotationException(klazz, name);
Object value = element.validateValue(); if (value == null) { throw new IncompleteAnnotationException(klazz, name);
Object value = element.validateValue(); if (value == null) { throw new IncompleteAnnotationException(klazz, name);
Object value = element.validateValue(); if (value == null) { throw new IncompleteAnnotationException(klazz, name);
@Override public Object invoke(Object proxy, Method method, Object[] args) { Class<?>[] paramTypes = method.getParameterTypes(); assert paramTypes.length == 0: Arrays.toString(paramTypes); String member = method.getName(); if (member.equals("toString")) { return toStringImpl(); } if (member.equals("annotationType")) { return type; } // Handle annotation member accessors PsiAnnotationMemberValue value = myAnnotation.findAttributeValue(member); if (value == null) { throw new IncompleteAnnotationException(type, member+". (Unable to find attribute in '"+myAnnotation.getText()+"')"); } Object result = JavaPsiFacade.getInstance(myAnnotation.getProject()).getConstantEvaluationHelper().computeConstantExpression(value); if (result == null) { throw new IncompleteAnnotationException(type, member+". (Unable to evaluate annotation value '"+value+"')"); } // todo arrays return result; }