MCPcopy Index your code
hub / github.com/processing/processing / method

Method method

core/src/processing/core/PApplet.java:3864–3881  ·  view source on GitHub ↗

Call a method in the current class based on its name. Note that the function being called must be public. Inside the PDE, 'public' is automatically added, but when used without the preprocessor, (like from Eclipse) you'll have to do it yourself.

(String name)

Source from the content-addressed store, hash-verified

3862 * (like from Eclipse) you'll have to do it yourself.
3863 */
3864 public void method(String name) {
3865 try {
3866 Method method = getClass().getMethod(name, new Class[] {});
3867 method.invoke(this, new Object[] { });
3868
3869 } catch (IllegalArgumentException e) {
3870 e.printStackTrace();
3871 } catch (IllegalAccessException e) {
3872 e.printStackTrace();
3873 } catch (InvocationTargetException e) {
3874 e.getTargetException().printStackTrace();
3875 } catch (NoSuchMethodException nsme) {
3876 System.err.println("There is no public " + name + "() method " +
3877 "in the class " + getClass().getName());
3878 } catch (Exception e) {
3879 e.printStackTrace();
3880 }
3881 }
3882
3883
3884 /**

Callers 3

runMethod · 0.95
locationToStringMethod · 0.80
printSourceLocationMethod · 0.80

Calls 4

getMethodMethod · 0.80
printStackTraceMethod · 0.45
printlnMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected