# Get functions / variables / classes from Processing and user

**URL:** <https://discourse.processing.org/t/get-functions-variables-classes-from-processing-and-user/30100>\
**Category:** Development\
**Created:** [May 14, 2021, 3:25pm UTC](https://discourse.processing.org/t/get-functions-variables-classes-from-processing-and-user/30100 "2021-05-14T15:25:15Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Ov3rM1nD](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/ov3rm1nd/32/1756_2.png) [@Ov3rM1nD](https://discourse.processing.org/u/Ov3rM1nD)\
**Post date:** [May 14, 2021, 5:47pm UTC](https://discourse.processing.org/t/get-functions-variables-classes-from-processing-and-user/30100/5 "2021-05-14T17:47:17Z")

</div>

Here is my approach:

```auto
import java.lang.reflect.Method;
import java.util.Collections;

void setup() {
  printMethods(getClass().getMethods()); // all default processing methods
  printMethods(getClass().getDeclaredMethods()); // user methods
  exit();
}

String clean(String str) {
  str = str.substring(str.lastIndexOf('.') + 1);
  return str.replaceAll("[^\\w]", "");
}

void printMethods(Method[] list) {
  ArrayList<String> result = new ArrayList();

  for (Method m : list) {
    String methodName = clean(m.getName());  
    String returnType = clean(m.getReturnType().toString());
    String params = "";
    for (Class p : m.getParameterTypes()) {
      params += clean(p.getName()) + " ";
    }

    result.add(methodName + "(" + params.trim() + ") : " + returnType);
  }

  Collections.sort(result);

  for (String s : result) println(s);
}

```

in short, you can do this through Java Reflections.

---

_[View the full topic](https://discourse.processing.org/t/get-functions-variables-classes-from-processing-and-user/30100)._
