Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Ver los componentes de una clase

Para ver los componentes de una clase

Class.getDeclaredFields(class)
Class.getDeclaredConstructors(class)
Class.getDeclaredMethods(class)

get underlying java instance for a jython object

If you have a PyObject and want to get the underlying Java instance.
All subclasses that we want to use as arguments to java methods must implement __tojava__().

   Object tmp = arg.__tojava__(Number.class):
   if (tmp != Py.NoConversion) {
       long ticks = ((Number) tmp).longValue();
   }