Class DefaultConstructor<T>

java.lang.Object
org.apache.cayenne.reflect.DefaultConstructor<T>

public final class DefaultConstructor<T> extends Object
A cached handle to the no-arg constructor of a class. Resolving a constructor via Class.getDeclaredConstructor(Class[]) is comparatively expensive (a lookup, a defensive copy and an access check), so callers that instantiate the same class repeatedly should resolve it once and keep this object around.
Since:
5.0
  • Constructor Details

    • DefaultConstructor

      public DefaultConstructor(Class<T> type)
  • Method Details

    • getType

      public Class<T> getType()
    • newInstance

      public T newInstance()