play.utils

## Class Java

- java.lang.Object
- - play.utils.Java

    public class Java
    extends java.lang.Object

Java utils

### Nested Class Summary

Nested Classes
`static class` `Java.FieldWrapper` Field accessor set and get value for a property, using the getter/setter when it exists or direct access otherwise.

### Field Summary

Fields
`protected static play.utils.JavaWithCaching` `_javaWithCaching`
`protected static ApplicationClassloaderState` `_lastKnownApplicationClassloaderState`

### Constructor Summary

Constructors
Constructor and Description
`Java()`

### Method Summary

All Methods Static Methods Concrete Methods
`static java.lang.Object` `deserialize(byte[] b)`
`static java.lang.String[]` `extractInfosFromByteCode(byte[] code)`
`static java.lang.Object` `extractUnderlyingCallable(java.util.concurrent.FutureTask<?> futureTask)` Try to discover what is hidden under a FutureTask (hack)
`static java.util.List<java.lang.reflect.Method>` `findAllAnnotatedMethods(java.lang.Class<?> clazz, java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)` Find all annotated method from a class
`static java.util.List<java.lang.reflect.Method>` `findAllAnnotatedMethods(java.util.List<java.lang.Class> classes, java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)` Find all annotated method from a class
`static void` `findAllFields(java.lang.Class clazz, java.util.Set<java.lang.reflect.Field> found)`
`static Java.FieldWrapper` `getFieldWrapper(java.lang.reflect.Field field)`
`protected static play.utils.JavaWithCaching` `getJavaWithCaching()`
`static java.lang.Object` `invokeChildOrStatic(java.lang.Class<?> clazz, java.lang.String method, java.lang.Object... args)`
`static java.lang.Object` `invokeStatic(java.lang.Class<?> clazz, java.lang.String method)` Invoke a static method
`static java.lang.Object` `invokeStatic(java.lang.Class<?> clazz, java.lang.String method, java.lang.Object... args)` Invoke a static method with args
`static java.lang.Object` `invokeStatic(java.lang.reflect.Method method, java.util.Map<java.lang.String,java.lang.String[]> args)`
`static java.lang.Object` `invokeStatic(java.lang.reflect.Method method, java.lang.Object[] args)`
`static java.lang.Object` `invokeStatic(java.lang.String clazz, java.lang.String method)`
`static java.lang.Object` `invokeStaticOrParent(java.lang.Class<?> clazz, java.lang.String method, java.lang.Object... args)`
`static java.lang.String[]` `parameterNames(java.lang.reflect.Method method)` Retrieve parameter names of a method
`static java.lang.String` `rawJavaType(java.lang.Class clazz)`
`static java.lang.String` `rawMethodSignature(java.lang.reflect.Method method)`
`static byte[]` `serialize(java.lang.Object o)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### _javaWithCaching

    protected static play.utils.JavaWithCaching _javaWithCaching

#### _lastKnownApplicationClassloaderState

    protected static ApplicationClassloaderState _lastKnownApplicationClassloaderState

### Constructor Detail

#### Java

    public Java()

### Method Detail

#### getJavaWithCaching

    protected static play.utils.JavaWithCaching getJavaWithCaching()

#### extractInfosFromByteCode

    public static java.lang.String[] extractInfosFromByteCode(byte[] code)

#### extractUnderlyingCallable

    public static java.lang.Object extractUnderlyingCallable(java.util.concurrent.FutureTask<?> futureTask)

Try to discover what is hidden under a FutureTask (hack)

Field sync first, if not present will try field callable

Parameters:
  `futureTask` - The given tack
Returns:
  Field sync first, if not present will try field callable

#### invokeStatic

    public static java.lang.Object invokeStatic(java.lang.Class<?> clazz,
                                                java.lang.String method)
                                         throws java.lang.Exception

Invoke a static method

Parameters:
  `clazz` - The class
  `method` - The method name
Returns:
  The result
Throws:
  `java.lang.Exception` - if problem occurred during invoking

#### invokeStatic

    public static java.lang.Object invokeStatic(java.lang.String clazz,
                                                java.lang.String method)
                                         throws java.lang.Exception

Throws:
  `java.lang.Exception`

#### invokeStatic

    public static java.lang.Object invokeStatic(java.lang.Class<?> clazz,
                                                java.lang.String method,
                                                java.lang.Object... args)
                                         throws java.lang.Exception

Invoke a static method with args

Parameters:
  `clazz` - The class
  `method` - The method name
  `args` - Arguments
Returns:
  The result
Throws:
  `java.lang.Exception` - if problem occurred during invoking

#### invokeStaticOrParent

    public static java.lang.Object invokeStaticOrParent(java.lang.Class<?> clazz,
                                                        java.lang.String method,
                                                        java.lang.Object... args)
                                                 throws java.lang.Exception

Throws:
  `java.lang.Exception`

#### invokeChildOrStatic

    public static java.lang.Object invokeChildOrStatic(java.lang.Class<?> clazz,
                                                       java.lang.String method,
                                                       java.lang.Object... args)
                                                throws java.lang.Exception

Throws:
  `java.lang.Exception`

#### invokeStatic

    public static java.lang.Object invokeStatic(java.lang.reflect.Method method,
                                                java.util.Map<java.lang.String,java.lang.String[]> args)
                                         throws java.lang.Exception

Throws:
  `java.lang.Exception`

#### invokeStatic

    public static java.lang.Object invokeStatic(java.lang.reflect.Method method,
                                                java.lang.Object[] args)
                                         throws java.lang.Exception

Throws:
  `java.lang.Exception`

#### parameterNames

    public static java.lang.String[] parameterNames(java.lang.reflect.Method method)
                                             throws java.lang.Exception

Retrieve parameter names of a method

Parameters:
  `method` - The given method
Returns:
  Array of parameter names
Throws:
  `java.lang.Exception` - if problem occurred during invoking

#### rawMethodSignature

    public static java.lang.String rawMethodSignature(java.lang.reflect.Method method)

#### rawJavaType

    public static java.lang.String rawJavaType(java.lang.Class clazz)

#### findAllAnnotatedMethods

    public static java.util.List<java.lang.reflect.Method> findAllAnnotatedMethods(java.lang.Class<?> clazz,
                                                                                   java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)

Find all annotated method from a class

Parameters:
  `clazz` - The class
  `annotationType` - The annotation class
Returns:
  A list of method object

#### findAllAnnotatedMethods

    public static java.util.List<java.lang.reflect.Method> findAllAnnotatedMethods(java.util.List<java.lang.Class> classes,
                                                                                   java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)

Find all annotated method from a class

Parameters:
  `classes` - The classes
  `annotationType` - The annotation class
Returns:
  A list of method object

#### findAllFields

    public static void findAllFields(java.lang.Class clazz,
                                     java.util.Set<java.lang.reflect.Field> found)

#### getFieldWrapper

    public static Java.FieldWrapper getFieldWrapper(java.lang.reflect.Field field)

#### serialize

    public static byte[] serialize(java.lang.Object o)
                            throws java.io.IOException

Throws:
  `java.io.IOException`

#### deserialize

    public static java.lang.Object deserialize(byte[] b)
                                        throws java.lang.Exception

Throws:
  `java.lang.Exception`