test_class.declarator: callbacks = new OCInvocationCallbacks(new JavaImplementor())
test_class.modifier: private
test_class.original_string: private OCInvocationCallbacks callbacks = new OCInvocationCallbacks(new JavaImplementor());
test_class.type: OCInvocationCallbacks
test_class.var_name: callbacks
test_class.file: rococoa/rococoa-core/src/test/java/org/rococoa/internal/OCInvocationCallbacksTest.java
test_class.identifier: OCInvocationCallbacksTest
test_case.body: @Test public void testMethodForSelector() throws SecurityException, NoSuchMethodException {
          assertNull(callbacks.methodForSelector("nosuch"));
          assertEquals(
              JavaImplementor.class.getDeclaredMethod("returnsIDTakesVoid"),                
              callbacks.methodForSelector("returnsIDTakesVoid"));
          assertEquals(
              JavaImplementor.class.getDeclaredMethod("returnsVoidTakesInt", int.class),                
              callbacks.methodForSelector("returnsVoidTakesInt:"));
          assertEquals(
              JavaImplementor.class.getDeclaredMethod("returnsVoidTakesInt_andInt", int.class, int.class),
              callbacks.methodForSelector("returnsVoidTakesInt:andInt:"));
          // wrong number of args
          assertNull(callbacks.methodForSelector("returnsVoidTakesVoid:")); 
          assertNull(callbacks.methodForSelector("returnsVoidTakesInt"));
      }
test_case.class_method_signature: OCInvocationCallbacksTest.testMethodForSelector()
test_case.full_signature: @Test public void testMethodForSelector()
test_case.identifier: testMethodForSelector
test_case.invocations: assertNull methodForSelector assertEquals getDeclaredMethod methodForSelector assertEquals getDeclaredMethod methodForSelector assertEquals getDeclaredMethod methodForSelector assertNull methodForSelector assertNull methodForSelector
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMethodForSelector()
focal_class.declarator: logging = Logger.getLogger("org.rococoa.callback")
focal_class.modifier: private static
focal_class.original_string: private static Logger logging = Logger.getLogger("org.rococoa.callback");
focal_class.type: Logger
focal_class.var_name: logging
focal_class.declarator: javaObject
focal_class.modifier: private final
focal_class.original_string: private final Object javaObject;
focal_class.type: Object
focal_class.var_name: javaObject
focal_class.declarator: methodSignatureCallback =
          new RococoaLibrary.MethodSignatureCallback() {
              public String callback(String selectorName) {
                  if (logging.isLoggable(Level.FINEST)) {
                      logging.finest(String.format("callback wanting methodSignature for selector %s", selectorName));
                  }
                  return methodSignatureForSelector(selectorName);
              }
      }
focal_class.modifier: public final
focal_class.original_string: public final RococoaLibrary.MethodSignatureCallback methodSignatureCallback =
          new RococoaLibrary.MethodSignatureCallback() {
              public String callback(String selectorName) {
                  if (logging.isLoggable(Level.FINEST)) {
                      logging.finest(String.format("callback wanting methodSignature for selector %s", selectorName));
                  }
                  return methodSignatureForSelector(selectorName);
              }
      };
focal_class.type: RococoaLibrary.MethodSignatureCallback
focal_class.var_name: methodSignatureCallback
focal_class.declarator: selectorInvokedCallback =
          new RococoaLibrary.SelectorInvokedCallback() {
              public void callback(String selectorName, ID nsInvocation) {
                  if (logging.isLoggable(Level.FINEST)) {
                      logging.finest(String.format("callback invoking %s on %s", selectorName, javaObject));
                  }
                  callMethod(javaObject, selectorName, Rococoa.wrap(nsInvocation, NSInvocation.class));
              }
      }
focal_class.modifier: public final
focal_class.original_string: public final RococoaLibrary.SelectorInvokedCallback selectorInvokedCallback =
          new RococoaLibrary.SelectorInvokedCallback() {
              public void callback(String selectorName, ID nsInvocation) {
                  if (logging.isLoggable(Level.FINEST)) {
                      logging.finest(String.format("callback invoking %s on %s", selectorName, javaObject));
                  }
                  callMethod(javaObject, selectorName, Rococoa.wrap(nsInvocation, NSInvocation.class));
              }
      };
focal_class.type: RococoaLibrary.SelectorInvokedCallback
focal_class.var_name: selectorInvokedCallback
focal_class.file: rococoa/rococoa-core/src/main/java/org/rococoa/internal/OCInvocationCallbacks.java
focal_class.identifier: OCInvocationCallbacks
focal_class.class_method_signature: OCInvocationCallbacks.OCInvocationCallbacks(Object javaObject)
focal_class.full_signature: public  OCInvocationCallbacks(Object javaObject)
focal_class.identifier: OCInvocationCallbacks
focal_class.modifiers: public
focal_class.parameters: (Object javaObject)
focal_class.signature:  OCInvocationCallbacks(Object javaObject)
focal_class.class_method_signature: OCInvocationCallbacks.methodSignatureForSelector(String selectorName)
focal_class.full_signature: protected String methodSignatureForSelector(String selectorName)
focal_class.identifier: methodSignatureForSelector
focal_class.modifiers: protected
focal_class.parameters: (String selectorName)
focal_class.return: String
focal_class.signature: String methodSignatureForSelector(String selectorName)
focal_class.class_method_signature: OCInvocationCallbacks.methodForSelector(String selectorName)
focal_class.full_signature: protected Method methodForSelector(String selectorName)
focal_class.identifier: methodForSelector
focal_class.modifiers: protected
focal_class.parameters: (String selectorName)
focal_class.return: Method
focal_class.signature: Method methodForSelector(String selectorName)
focal_class.class_method_signature: OCInvocationCallbacks.ocMethodSignatureAsString(Method method)
focal_class.full_signature: protected String ocMethodSignatureAsString(Method method)
focal_class.identifier: ocMethodSignatureAsString
focal_class.modifiers: protected
focal_class.parameters: (Method method)
focal_class.return: String
focal_class.signature: String ocMethodSignatureAsString(Method method)
focal_class.class_method_signature: OCInvocationCallbacks.callMethod(Object o, String selectorName, NSInvocation invocation)
focal_class.full_signature: private void callMethod(Object o, String selectorName, NSInvocation invocation)
focal_class.identifier: callMethod
focal_class.modifiers: private
focal_class.parameters: (Object o, String selectorName, NSInvocation invocation)
focal_class.return: void
focal_class.signature: void callMethod(Object o, String selectorName, NSInvocation invocation)
focal_class.class_method_signature: OCInvocationCallbacks.methodNameForSelector(String selectorName)
focal_class.full_signature: private String methodNameForSelector(String selectorName)
focal_class.identifier: methodNameForSelector
focal_class.modifiers: private
focal_class.parameters: (String selectorName)
focal_class.return: String
focal_class.signature: String methodNameForSelector(String selectorName)
focal_class.class_method_signature: OCInvocationCallbacks.argsForFrom(Method method, NSInvocation invocation, NSMethodSignature nsMethodSignature)
focal_class.full_signature: private Object[] argsForFrom(Method method, NSInvocation invocation, NSMethodSignature nsMethodSignature)
focal_class.identifier: argsForFrom
focal_class.modifiers: private
focal_class.parameters: (Method method, NSInvocation invocation, NSMethodSignature nsMethodSignature)
focal_class.return: Object[]
focal_class.signature: Object[] argsForFrom(Method method, NSInvocation invocation, NSMethodSignature nsMethodSignature)
focal_class.class_method_signature: OCInvocationCallbacks.javaObjectForOCArgument(NSInvocation invocation,
              int indexInInvocation, String objCArgumentTypeAsString, Class<?> javaParameterType)
focal_class.full_signature: private Object javaObjectForOCArgument(NSInvocation invocation,
              int indexInInvocation, String objCArgumentTypeAsString, Class<?> javaParameterType)
focal_class.identifier: javaObjectForOCArgument
focal_class.modifiers: private
focal_class.parameters: (NSInvocation invocation,
              int indexInInvocation, String objCArgumentTypeAsString, Class<?> javaParameterType)
focal_class.return: Object
focal_class.signature: Object javaObjectForOCArgument(NSInvocation invocation,
              int indexInInvocation, String objCArgumentTypeAsString, Class<?> javaParameterType)
focal_class.class_method_signature: OCInvocationCallbacks.putResultIntoInvocation(NSInvocation invocation, String typeToReturnToObjC, Object result)
focal_class.full_signature: private void putResultIntoInvocation(NSInvocation invocation, String typeToReturnToObjC, Object result)
focal_class.identifier: putResultIntoInvocation
focal_class.modifiers: private
focal_class.parameters: (NSInvocation invocation, String typeToReturnToObjC, Object result)
focal_class.return: void
focal_class.signature: void putResultIntoInvocation(NSInvocation invocation, String typeToReturnToObjC, Object result)
focal_class.class_method_signature: OCInvocationCallbacks.bufferForReturn(Object methodCallResult)
focal_class.full_signature: private Memory bufferForReturn(Object methodCallResult)
focal_class.identifier: bufferForReturn
focal_class.modifiers: private
focal_class.parameters: (Object methodCallResult)
focal_class.return: Memory
focal_class.signature: Memory bufferForReturn(Object methodCallResult)
focal_class.class_method_signature: OCInvocationCallbacks.countColons(String selectorName)
focal_class.full_signature: private int countColons(String selectorName)
focal_class.identifier: countColons
focal_class.modifiers: private
focal_class.parameters: (String selectorName)
focal_class.return: int
focal_class.signature: int countColons(String selectorName)
focal_class.class_method_signature: OCInvocationCallbacks.stringForType(Class<?> clas)
focal_class.full_signature: private String stringForType(Class<?> clas)
focal_class.identifier: stringForType
focal_class.modifiers: private
focal_class.parameters: (Class<?> clas)
focal_class.return: String
focal_class.signature: String stringForType(Class<?> clas)
focal_method.body: protected Method methodForSelector(String selectorName) {
          if (null == selectorName) {
              logging.severe("methodForSelector called with null selectorName");
              return null;
          }
          int parameterCount = countColons(selectorName);
          String methodName = methodNameForSelector(selectorName);
          try {
              Method[] methods = javaObject.getClass().getMethods();
              for (Method method : methods) {
                  if (method.getName().equals(methodName) && method.getParameterTypes().length == parameterCount) {
                      boolean match = true;
                      if(null == stringForType(method.getReturnType())) {
                          match = false;
                      }
                      if(match) {
                          for (Class<?> parameterType : method.getParameterTypes()) {
                              if(null == stringForType(parameterType)) {
                                  match = false;
                                  break;
                              }
                          }
                      }
                      if(match) {
                          return method;
                      }
                  }
              }
              logging.fine("No method " + methodName + " for selector:" + selectorName);
              return null;
          } catch (Exception e) {
              logging.log(Level.SEVERE, "Exception finding methodForSelector", e);
              return null;
          }
      }
focal_method.class_method_signature: OCInvocationCallbacks.methodForSelector(String selectorName)
focal_method.full_signature: protected Method methodForSelector(String selectorName)
focal_method.identifier: methodForSelector
focal_method.invocations: severe countColons methodNameForSelector getMethods getClass equals getName getParameterTypes stringForType getReturnType getParameterTypes stringForType fine log
focal_method.modifiers: protected
focal_method.parameters: (String selectorName)
focal_method.return: Method
focal_method.signature: Method methodForSelector(String selectorName)