org.clapper.classutil

ClassUtil

object ClassUtil

Some general-purpose class-related utility functions.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ClassUtil
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def beanName(m: Method): String

    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.

    m

    the method

    returns

    the bean name

    See also

    scalaAccessorMethods

  8. def classSignature(cls: Class[_]): String

    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
    cls

    The class (type)

    returns

    its string signature

  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  15. def isGetter(m: Method): Boolean

    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).

    m

    the method

    returns

    true or false

  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. def isOfType[T](v: Any)(implicit arg0: ClassTag[T]): Boolean

    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))
    T

    the type against which to check the value

    v

    the value to check

    returns

    whether or not value conforms to type T

  18. def isPrimitive[T](cls: Class[T])(implicit arg0: ClassTag[T]): Boolean

    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.

    cls

    the class

    returns

    true if the class represents a primitive, false if not

  19. def isPrimitive(obj: Any): Boolean

    Determine whether an object is a primitive or not.

    Determine whether an object is a primitive or not.

    obj

    the object

    returns

    true if its class is a primitive, false if not.

  20. def isSetter(m: Method): Boolean

    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.

    m

    the method

    returns

    true or false

  21. def loadClass(classLoader: ClassLoader, className: String, classBytes: Array[Byte]): Class[_]

    Convenience method to load a class from an array of class bytes.

    Convenience method to load a class from an array of class bytes.

    classLoader

    the class loader to use

    className

    the name of the class

    classBytes

    the class's byte code

    returns

    the loaded class

  22. def methodSignature(method: Method): String

    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

    method, from java.lang.reflect

    returns

    its string signature

  23. def methodSignature(returnType: Class[_], paramTypes: Array[Class[_]]): String

    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

    returnType

    the method's return type

    paramTypes

    the methods parameter types. An empty array signifies a method that takes no parameters.

    returns

    its string signature

  24. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  25. def nonFinalPublicMethods(cls: Class[_]): Seq[Method]

    Get a sequence of all public, non-final methods in a class.

    Get a sequence of all public, non-final methods in a class.

    cls

    the class

    returns

    the sequence of methods

  26. final def notify(): Unit

    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  28. def scalaAccessorMethods(cls: Class[_]): Seq[Method]

    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.

    cls

    the class

    returns

    The sequence of methods

  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  30. def toString(): String

    Definition Classes
    AnyRef → Any
  31. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped