Object

org.clapper.classutil

ClassUtil

Related Doc: package classutil

Permalink

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
Visibility
  1. Public
  2. All

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

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

    Permalink

    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

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

    Permalink

    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.

    cls

    The class (type)

    returns

    its string signature

    Annotations
    @SuppressWarnings()
  7. def clone(): AnyRef

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

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

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

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

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

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

    Permalink

    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

  14. final def isInstanceOf[T0]: Boolean

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

    Permalink

    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

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

    Permalink

    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

  17. def isPrimitive(obj: Any): Boolean

    Permalink

    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.

  18. def isSetter(m: Method): Boolean

    Permalink

    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

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

    Permalink

    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

  20. def methodSignature(method: Method): String

    Permalink

    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

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

    Permalink

    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

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

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

    Permalink

    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

  24. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

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

    Permalink

    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

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

    Permalink
    Definition Classes
    AnyRef
  28. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped