Given a method, produce its Java Bean name.
Given a method, produce its Java Bean name. Assumes that the method is already known to be a valid Scala accessor method.
the method
the bean name
Generate a runtime signature for a class (type).
Generate a runtime signature for a class (type). For instance:
java.lang.String -> Ljava/lang/String; int -> I
Throws an exception (Exception
) if it can't map the class name to
a signature.
The class (type)
its string signature
Determine if a method is a getter.
Determine if a method is a getter. A getter is defined as any method
that has no parameters, returns a value, and isn't in one of the
methods to be ignored (like toString
).
the method
true
or false
Determine if a value is of, or is assignable to, a specified type.
Determine if a value is of, or is assignable to, a specified type. Works with generics. Example of use:
val value: Any = ... assert(isOfType[Map[String,Int]](value))
the type against which to check the value
the value to check
whether or not value
conforms to type T
Determine whether a class represents an underlying primitive or not.
Determine whether a class represents an underlying primitive or not.
For instance, Int
, Float
and Unit
all represent underlying
primitives. Note that Java classes are considered primitives if they
*are*, in fact, primitives, or if they represent boxed forms of
primitives.
the class
true
if the class represents a primitive, false
if not
Determine whether an object is a primitive or not.
Determine whether an object is a primitive or not.
the object
true
if its class is a primitive, false
if not.
Determine if a method is a setter.
Determine if a method is a setter. A getter is defined as any method that has a single parameter, returns no value, and isn't in one of the methods to be ignored.
the method
true
or false
Convenience method to load a class from an array of class bytes.
Convenience method to load a class from an array of class bytes.
the class loader to use
the name of the class
the class's byte code
the loaded class
Generate a runtime signature for a method.
Generate a runtime signature for a method. See, for instance: http://journals.ecs.soton.ac.uk/java/tutorial/native1.1/implementing/method.html
method, from java.lang.reflect
its string signature
Generate a runtime signature for a method.
Generate a runtime signature for a method. See, for instance: http://journals.ecs.soton.ac.uk/java/tutorial/native1.1/implementing/method.html
the method's return type
the methods parameter types. An empty array signifies a method that takes no parameters.
its string signature
Get a sequence of all public, non-final methods in a class.
Get a sequence of all public, non-final methods in a class.
the class
the sequence of methods
Get a list of all public getters and setters in a Scala class.
Get a list of all public getters and setters in a Scala class.
the class
The sequence of methods
Some general-purpose class-related utility functions.