public String okNameForIsGetter(AnnotatedMethod am, String name) { if (name.startsWith("is")) { // plus, must return boolean... Class<?> rt = am.getRawType(); if (rt != Boolean.class && rt != Boolean.TYPE) { return null; } return mangleGetterName(am, name.substring(2)); } // no, not a match by name return null; }
public String okNameForIsGetter(AnnotatedMethod am, String name) { if (name.startsWith("is")) { // plus, must return boolean... Class<?> rt = am.getReturnType(); if (rt != Boolean.class && rt != Boolean.TYPE) { return null; } return mangleGetterName(am, name.substring(2)); } // no, not a match by name return null; }
public String okNameForGetter(AnnotatedMethod am, String name) { if (name.startsWith("get")) { /* 16-Feb-2009, tatu: To handle [JACKSON-53], need to block * CGLib-provided method "getCallbacks". Not sure of exact * safe critieria to get decent coverage without false matches; * but for now let's assume there's no reason to use any * such getter from CGLib. * But let's try this approach... */ if ("getCallbacks".equals(name)) { if (isCglibGetCallbacks(am)) { return null; } } else if ("getMetaClass".equals(name)) { /* 30-Apr-2009, tatu: [JACKSON-103], need to suppress * serialization of a cyclic (and useless) reference */ if (isGroovyMetaClassGetter(am)) { return null; } } return mangleGetterName(am, name.substring(3)); } return null; }
public String okNameForGetter(AnnotatedMethod am, String name) { if (name.startsWith("get")) { /* 16-Feb-2009, tatu: To handle [JACKSON-53], need to block * CGLib-provided method "getCallbacks". Not sure of exact * safe criteria to get decent coverage without false matches; * but for now let's assume there's no reason to use any * such getter from CGLib. * But let's try this approach... */ if ("getCallbacks".equals(name)) { if (isCglibGetCallbacks(am)) { return null; } } else if ("getMetaClass".equals(name)) { /* 30-Apr-2009, tatu: [JACKSON-103], need to suppress * serialization of a cyclic (and useless) reference */ if (isGroovyMetaClassGetter(am)) { return null; } } return mangleGetterName(am, name.substring(3)); } return null; }