@Override public boolean includeMethod(Method m) { return ClassUtil.hasGetterSignature(m); } }
@SuppressWarnings("deprecation") @Override public boolean includeMethod(Method m) { if (super.includeMethod(m)) { return true; } if (!ClassUtil.hasGetterSignature(m)) { return false; } // but furthermore, only accept Collections & Maps, for now Class<?> rt = m.getReturnType(); if (Collection.class.isAssignableFrom(rt) || Map.class.isAssignableFrom(rt)) { return true; } return false; } }
@Override public boolean includeMethod(Method m) { return ClassUtil.hasGetterSignature(m); } }
@SuppressWarnings("deprecation") @Override public boolean includeMethod(Method m) { if (super.includeMethod(m)) { return true; } if (!ClassUtil.hasGetterSignature(m)) { return false; } // but furthermore, only accept Collections & Maps, for now Class<?> rt = m.getReturnType(); if (Collection.class.isAssignableFrom(rt) || Map.class.isAssignableFrom(rt)) { return true; } return false; } }
public boolean includeMethod(Method m) { return ClassUtil.hasGetterSignature(m); } }
public boolean includeMethod(Method m) { return ClassUtil.hasGetterSignature(m); } }
@Override public boolean includeMethod(Method m) { return ClassUtil.hasGetterSignature(m); } }
@Override public boolean includeMethod(Method m) { return ClassUtil.hasGetterSignature(m); } }
public boolean includeMethod(Method m) { if (super.includeMethod(m)) { return true; } if (!ClassUtil.hasGetterSignature(m)) { return false; } // but furthermore, only accept Collections & Maps, for now Class<?> rt = m.getReturnType(); if (Collection.class.isAssignableFrom(rt) || Map.class.isAssignableFrom(rt)) { return true; } return false; } }
@Override public boolean includeMethod(Method m) { if (super.includeMethod(m)) { return true; } if (!ClassUtil.hasGetterSignature(m)) { return false; } // but furthermore, only accept Collections & Maps, for now Class<?> rt = m.getReturnType(); if (Collection.class.isAssignableFrom(rt) || Map.class.isAssignableFrom(rt)) { return true; } return false; } }
@SuppressWarnings("deprecation") @Override public boolean includeMethod(Method m) { if (super.includeMethod(m)) { return true; } if (!ClassUtil.hasGetterSignature(m)) { return false; } // but furthermore, only accept Collections & Maps, for now Class<?> rt = m.getReturnType(); if (Collection.class.isAssignableFrom(rt) || Map.class.isAssignableFrom(rt)) { return true; } return false; } }
@SuppressWarnings("deprecation") @Override public boolean includeMethod(Method m) { if (super.includeMethod(m)) { return true; } if (!ClassUtil.hasGetterSignature(m)) { return false; } // but furthermore, only accept Collections & Maps, for now Class<?> rt = m.getReturnType(); if (Collection.class.isAssignableFrom(rt) || Map.class.isAssignableFrom(rt)) { return true; } return false; } }
/** * Method for locating the getter method that is annotated with * {@link org.codehaus.jackson.annotate.JsonValue} annotation, * if any. If multiple ones are found, * an error is reported by throwing {@link IllegalArgumentException} */ public AnnotatedMethod findJsonValueMethod() { AnnotatedMethod found = null; for (AnnotatedMethod am : _classInfo.memberMethods()) { // must be marked with "JsonValue" (or similar) if (!_annotationIntrospector.hasAsValueAnnotation(am)) { continue; } if (found != null) { throw new IllegalArgumentException("Multiple methods with active 'as-value' annotation ("+found.getName()+"(), "+am.getName()+")"); } // Also, must have getter signature /* 18-May-2009, tatu: Should this be moved to annotation * introspector, to give better error message(s)? For now * will leave here, may want to reconsider in future. */ if (!ClassUtil.hasGetterSignature(am.getAnnotated())) { throw new IllegalArgumentException("Method "+am.getName()+"() marked with an 'as-value' annotation, but does not have valid getter signature (non-static, takes no args, returns a value)"); } found = am; } return found; }
/** * Method for locating the getter method that is annotated with * {@link org.codehaus.jackson.annotate.JsonValue} annotation, * if any. If multiple ones are found, * an error is reported by throwing {@link IllegalArgumentException} */ public AnnotatedMethod findJsonValueMethod() { AnnotatedMethod found = null; for (AnnotatedMethod am : _classInfo.memberMethods()) { // must be marked with "JsonValue" (or similar) if (!_annotationIntrospector.hasAsValueAnnotation(am)) { continue; } if (found != null) { throw new IllegalArgumentException("Multiple methods with active 'as-value' annotation ("+found.getName()+"(), "+am.getName()+")"); } // Also, must have getter signature /* 18-May-2009, tatu: Should this be moved to annotation * introspector, to give better error message(s)? For now * will leave here, may want to reconsider in future. */ if (!ClassUtil.hasGetterSignature(am.getAnnotated())) { throw new IllegalArgumentException("Method "+am.getName()+"() marked with an 'as-value' annotation, but does not have valid getter signature (non-static, takes no args, returns a value)"); } found = am; } return found; }