Object

dagr.commons.reflect

ReflectionUtil

Related Doc: package reflect

Permalink

object ReflectionUtil

Provides generic utility methods related to Java and Scala reflection.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ReflectionUtil
  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. val SpecialEmptyOrNoneToken: String

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def constructFromString(resultType: Class[_], unitType: Class[_], value: String*): Try[Any]

    Permalink

    Constructs one or more objects from Strings.

    Constructs one or more objects from Strings. Supports building any unitType class that either:

    1. Has a one-arg constructor that takes a String 2. Has a one-arg apply() method that takes a String in it's Companion object 3. Is a JavaEnum 4. Is java.nio.file.Path
    resultType

    the type that must be assignable to, from the return of this function (may be a collection or a single-valued type)

    unitType

    either the same as resultType or when resultType is a collection, the type of elements in the collection

    value

    one or more strings from which to construct objects. More than one string should only be given for collections.

    returns

    an object constructed from the string.

  8. def enumOptions(clazz: Class[_ <: Enum[_ <: Enum[_]]]): Try[Seq[Enum[_ <: Enum[_]]]]

    Permalink

    Gets all the options for an enumeration.

  9. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def findJavaAnnotation[T <: Annotation](clazz: Class[_], annotationClazz: Class[T]): Option[T]

    Permalink

    Gets the annotation of type T of the class clazz

  13. def findScalaAnnotation[A <: ClassfileAnnotation](sym: scala.reflect.api.JavaUniverse.Symbol)(implicit evidence: scala.reflect.api.JavaUniverse.TypeTag[A]): Option[A]

    Permalink

    Finds and hydrates a static scala classfile annotation on the provided symbol.

    Finds and hydrates a static scala classfile annotation on the provided symbol. If the symbol isn't annotated with the specified annotation, None is returned. If it is annotated then the annotation value is reified and an instance returned.

  14. def findScalaAnnotation[A <: ClassfileAnnotation, C](implicit evA: scala.reflect.api.JavaUniverse.TypeTag[A], evC: scala.reflect.api.JavaUniverse.TypeTag[C]): Option[A]

    Permalink

    Finds and instantiates a scala classfile annotation of type A, on a class of type C.

    Finds and instantiates a scala classfile annotation of type A, on a class of type C. This method is preferred when, in code, the _type_ of class is known directly. Otherwise see the version which takes an annotated symbol instead of a type.

  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. def hasScalaAnnotation[A <: ClassfileAnnotation, C](implicit evA: scala.reflect.api.JavaUniverse.TypeTag[A], evC: scala.reflect.api.JavaUniverse.TypeTag[C]): Boolean

    Permalink

    Returns true if the class of type C the symbol is annotated with a scala classfile annotation of type A, otherwise returns false.

  17. def hasScalaAnnotation[A <: ClassfileAnnotation](sym: scala.reflect.api.JavaUniverse.Symbol)(implicit evidence: scala.reflect.api.JavaUniverse.TypeTag[A]): Boolean

    Permalink

    Returns true if the symbol (class, field, arg) is annotated with a scala classfile annotation of the provided type, otherwise returns false.

  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. def ifPrimitiveThenWrapper(typ: Class[_]): Class[_]

    Permalink

    Ensures that the wrapper class is used for primitive classes.

  20. def isCollectionClass(clazz: Class[_]): Boolean

    Permalink

    Returns true if the class is subclass of a collection class (Seq, Set or java.util.Collection)

  21. def isEmptyCollection(value: Any): Boolean

    Permalink

    True if the value is a collection class and is empty, false otherwise.

    True if the value is a collection class and is empty, false otherwise. Throws a IllegalArgumentException if the value is not a supported collection class (Seq, Set or java.util.Collection).

  22. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  23. def isJavaCollectionClass(clazz: Class[_]): Boolean

    Permalink

    Returns true if the class is a subclass of java.util.Collection

  24. def isSeqClass(clazz: Class[_]): Boolean

    Permalink

    Returns true if the class is a subclass of Seq

  25. def isSetClass(clazz: Class[_]): Boolean

    Permalink

    Returns true if the class is a subclass of Set

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

    Permalink
    Definition Classes
    AnyRef
  27. def newJavaCollectionInstance[T <: Collection[_]](clazz: Class[_ <: T], args: Seq[AnyRef]): T

    Permalink

    Creates a new instance of various java collections.

    Creates a new instance of various java collections. Will inspect the type given to see if there is a no-arg constructor and will use that if possible. If there is no constructor it will attempt to determine the appropriate concrete class to instantiate and return that.

  28. def newScalaCollection[T <: Iterable[_]](clazz: Class[T], args: Seq[Any]): T

    Permalink

    Instantiates a new Scala collection of the desired type with the provided arguments.

  29. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  31. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  33. def typeTagToClass[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): Class[T]

    Permalink

    Converts a type tag to a class

  34. def typeToClass(typ: scala.reflect.api.JavaUniverse.Type): Class[_]

    Permalink

    Takes a Type symbol that represents a concrete class and returns the Class object associated with it.

  35. final def wait(): Unit

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped