Package org.apache.sling.models.impl.model

# Class ModelClassConstructor<M>

java.lang.Object
org.apache.sling.models.impl.model.ModelClassConstructor<M>

public class ModelClassConstructor<M> extends Object

## Constructor Summary

Constructors
Constructor
Description
`ModelClassConstructor(Constructor<M> constructor, org.apache.sling.models.spi.injectorspecific.StaticInjectAnnotationProcessorFactory[] processorFactories, org.apache.sling.models.annotations.DefaultInjectionStrategy defaultInjectionStrategy)`

## Method Summary

Modifier and Type
Method
Description
`Constructor<M>`
`getConstructor()`
`ConstructorParameter[]`
`getConstructorParameters()`
`boolean`
`hasInjectAnnotation()`
`boolean`
`isCanonicalRecordConstructor()`
`M`
`newInstance(Object... parameters)`
Proxies the call to `Constructor.newInstance(Object...)`, checking (and setting) accessibility first.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ModelClassConstructor

public ModelClassConstructor(Constructor<M> constructor, org.apache.sling.models.spi.injectorspecific.StaticInjectAnnotationProcessorFactory[] processorFactories, org.apache.sling.models.annotations.DefaultInjectionStrategy defaultInjectionStrategy)

## Method Details

### newInstance

public M newInstance(Object... parameters) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
Proxies the call to `Constructor.newInstance(Object...)`, checking (and setting) accessibility first.

Parameters:
  `parameters` - the constructor parameters that are passed to `Constructor.newInstance(Object...)`
Returns:
  The constructed object
Throws:
  `InstantiationException` - when `Constructor.newInstance(Object...)` would throw
  `IllegalAccessException` - when `Constructor.newInstance(Object...)` would throw
  `IllegalArgumentException` - when `Constructor.newInstance(Object...)` would throw
  `InvocationTargetException` - when `Constructor.newInstance(Object...)` would throw
See Also:
  - `Constructor.newInstance(Object...)`

### getConstructor

public Constructor<M> getConstructor()

### hasInjectAnnotation

public boolean hasInjectAnnotation()

### getConstructorParameters

public ConstructorParameter[] getConstructorParameters()

### isCanonicalRecordConstructor

public boolean isCanonicalRecordConstructor()