congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ConstructorUtils.constructClass
Code IndexAdd Tabnine to your IDE (free)

How to use
constructClass
method
in
org.azeckoski.reflectutils.ConstructorUtils

Best Java code snippets using org.azeckoski.reflectutils.ConstructorUtils.constructClass (Showing top 16 results out of 315)

origin: azeckoski/reflectutils

/**
 * Construct an object for the class of the given type regardless of whether it has a default constructor,
 * this will construct anything which has a valid class type including primitives,
 * arrays, collections and even classes without default constructors,
 * this will attempt to use the default constructor first if available though.
 * It must be possible to construct the class without knowing something about it beforehand,
 * (i.e. classes with only constructors which require non-null arguments will not be able
 * to be constructed)
 * 
 * @param <T>
 * @param beanClass any object class
 * @return the newly constructed object of the given class type 
 * (if primitive then a wrapped object will be returned which java will unwrap automatically)
 */
public <T> T constructClass(Class<T> beanClass) {
  return getConstructorUtils().constructClass(beanClass);
}
origin: org.azeckoski/reflectutils

/**
 * Construct an object for the class of the given type regardless of whether it has a default constructor,
 * this will construct anything which has a valid class type including primitives,
 * arrays, collections and even classes without default constructors,
 * this will attempt to use the default constructor first if available though.
 * It must be possible to construct the class without knowing something about it beforehand,
 * (i.e. classes with only constructors which require non-null arguments will not be able
 * to be constructed)
 * 
 * @param <T>
 * @param beanClass any object class
 * @return the newly constructed object of the given class type 
 * (if primitive then a wrapped object will be returned which java will unwrap automatically)
 */
public <T> T constructClass(Class<T> beanClass) {
  return getConstructorUtils().constructClass(beanClass);
}
origin: org.azeckoski/reflectutils

  implementationType = ConstructorUtils.getClassFromInterface(implementationType);
convert = getConstructorUtils().constructClass(implementationType);
if ( ConstructorUtils.isClassArray(fromType) ) {
origin: azeckoski/reflectutils

  implementationType = ConstructorUtils.getClassFromInterface(implementationType);
convert = getConstructorUtils().constructClass(implementationType);
if ( ConstructorUtils.isClassArray(fromType) ) {
origin: org.azeckoski/reflectutils

  implementationType = ArrayOrderedMap.class;
convert = (Map<String, Object>) getConstructorUtils().constructClass(implementationType);
if ( ConstructorUtils.isClassArray(fromType) ) {
origin: azeckoski/reflectutils

  implementationType = ArrayOrderedMap.class;
convert = (Map<String, Object>) getConstructorUtils().constructClass(implementationType);
if ( ConstructorUtils.isClassArray(fromType) ) {
origin: azeckoski/reflectutils

  newC = constructClass(type);
} else {
  int paramsCount = params.length;
origin: org.azeckoski/reflectutils

  newC = constructClass(type);
} else {
  int paramsCount = params.length;
origin: org.azeckoski/reflectutils

  && ! ConstructorUtils.isClassSimple(toType) ) {
convert = getConstructorUtils().constructClass(toType);
origin: azeckoski/reflectutils

  && ! ConstructorUtils.isClassSimple(toType) ) {
convert = getConstructorUtils().constructClass(toType);
origin: azeckoski/reflectutils

dest = getConstructorUtils().constructClass(targetType);
origin: org.azeckoski/reflectutils

dest = getConstructorUtils().constructClass(targetType);
origin: org.azeckoski/reflectutils

  nestedBean = getConstructorUtils().constructClass(type);
  setFieldValue(obj, next, nestedBean, false); // need to put this new object into the parent
} catch (RuntimeException e) {
origin: azeckoski/reflectutils

  nestedBean = getConstructorUtils().constructClass(type);
  setFieldValue(obj, next, nestedBean, false); // need to put this new object into the parent
} catch (RuntimeException e) {
origin: org.azeckoski/reflectutils

copy = getConstructorUtils().constructClass(beanClass); // make new list
for (Object element : (Collection) bean) {
  Object clone = internalDeepClone(element, dest, maxDepth, null, currentDepth, ignoreNulls, ignoreTransient);
copy = getConstructorUtils().constructClass(beanClass); // make new map
for (Object key : ((Map) bean).keySet()) {
  if ( fieldNamesToSkip != null
  copy = getConstructorUtils().constructClass(beanClass); // make new bean
origin: azeckoski/reflectutils

copy = getConstructorUtils().constructClass(beanClass); // make new list
for (Object element : (Collection) bean) {
  Object clone = internalDeepClone(element, dest, maxDepth, null, currentDepth, ignoreNulls, ignoreTransient);
copy = getConstructorUtils().constructClass(beanClass); // make new map
for (Object key : ((Map) bean).keySet()) {
  if ( fieldNamesToSkip != null
  copy = getConstructorUtils().constructClass(beanClass); // make new bean
org.azeckoski.reflectutilsConstructorUtilsconstructClass

Javadoc

Construct an object for the class of the given type regardless of whether it has a default constructor, this will construct anything which has a valid class type including primitives, arrays, collections and even classes without default constructors, this will attempt to use the default constructor first if available though, It must be possible to construct the class without knowing something about it beforehand, (i.e. classes with only constructors which require non-null arguments will not be able to be constructed)

Popular methods of ConstructorUtils

  • isClassBean
  • isClassMap
  • isClassSimple
  • isClassArray
  • isClassCollection
  • <init>
    Empty constructor WARNING: use the #getInstance() method to get this rather than recreating it over
  • checkNull
  • classAssignable
    Checks if assignFrom is assignable to assignTo (i.e. this is OK: assignFrom b; assignTo a = (assignT
  • classEquals
    Will compare 2 classes for equality which will make a friendly comparison of types and will happily
  • getClassDataCacher
  • getClassFromInterface
    Gets a valid class which can be constructed from an interface or special cases which cannot be const
  • getDefaultValue
    Get the default value for for a type if one is available OR null if there is no default (since null
  • getClassFromInterface,
  • getDefaultValue,
  • getExtendAndInterfacesForClass,
  • getImmutableDefaults,
  • getImmutableTypes,
  • getInstance,
  • getInterfacesForClass,
  • getPrimitiveDefaults,
  • getPrimitiveToWrapper

Popular in Java

  • Making http post requests using okhttp
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setContentView (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Join (org.hibernate.mapping)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now