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

Method getImportedMethod

src/bsh/NameSpace.java:926–953  ·  view source on GitHub ↗
( String name, Class [] sig )

Source from the content-addressed store, hash-verified

924 }
925
926 protected BshMethod getImportedMethod( String name, Class [] sig )
927 throws UtilEvalError
928 {
929 // Try object imports
930 if ( importedObjects != null )
931 for(int i=0; i<importedObjects.size(); i++)
932 {
933 Object object = importedObjects.get(i);
934 Class clas = object.getClass();
935 Method method = Reflect.resolveJavaMethod(
936 getClassManager(), clas, name, sig, false/*onlyStatic*/ );
937 if ( method != null )
938 return new BshMethod( method, object );
939 }
940
941 // Try static imports
942 if ( importedStatic!= null )
943 for(int i=0; i<importedStatic.size(); i++)
944 {
945 Class clas = importedStatic.get(i);
946 Method method = Reflect.resolveJavaMethod(
947 getClassManager(), clas, name, sig, true/*onlyStatic*/ );
948 if ( method != null )
949 return new BshMethod( method, null/*object*/ );
950 }
951
952 return null;
953 }
954
955 protected Variable getImportedVar( String name )
956 throws UtilEvalError

Callers 1

getMethodMethod · 0.95

Calls 5

resolveJavaMethodMethod · 0.95
getClassManagerMethod · 0.95
getClassMethod · 0.80
getMethod · 0.65
sizeMethod · 0.45

Tested by

no test coverage detected