MCPcopy Index your code
hub / github.com/beanshell/beanshell / hasObjectPropertyGetter

Method hasObjectPropertyGetter

src/bsh/Reflect.java:695–711  ·  view source on GitHub ↗
(Class clas, String propName)

Source from the content-addressed store, hash-verified

693
694
695 public static boolean hasObjectPropertyGetter(Class clas, String propName) {
696 if (clas == Primitive.class) {
697 return false;
698 }
699 String getterName = accessorName("get", propName);
700 try {
701 clas.getMethod(getterName, new Class[0]);
702 return true;
703 } catch (NoSuchMethodException e) { /* fall through */ }
704 getterName = accessorName("is", propName);
705 try {
706 Method m = clas.getMethod(getterName, new Class[0]);
707 return (m.getReturnType() == Boolean.TYPE);
708 } catch (NoSuchMethodException e) {
709 return false;
710 }
711 }
712
713
714 public static boolean hasObjectPropertySetter(Class clas, String propName) {

Callers 1

getObjectFieldValueMethod · 0.95

Calls 3

accessorNameMethod · 0.95
getMethodMethod · 0.45
getReturnTypeMethod · 0.45

Tested by

no test coverage detected