Class ModelClassConstructor<M>
java.lang.Object
org.apache.sling.models.impl.model.ModelClassConstructor<M>
-
Constructor Summary
ConstructorsConstructorDescriptionModelClassConstructor
(Constructor<M> constructor, StaticInjectAnnotationProcessorFactory[] processorFactories, DefaultInjectionStrategy defaultInjectionStrategy) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
newInstance
(Object... parameters) Proxies the call toConstructor.newInstance(Object...)
, checking (and setting) accessibility first.
-
Constructor Details
-
ModelClassConstructor
public ModelClassConstructor(Constructor<M> constructor, StaticInjectAnnotationProcessorFactory[] processorFactories, DefaultInjectionStrategy defaultInjectionStrategy)
-
-
Method Details
-
newInstance
public M newInstance(Object... parameters) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException Proxies the call toConstructor.newInstance(Object...)
, checking (and setting) accessibility first.- Parameters:
parameters
- the constructor parameters that are passed toConstructor.newInstance(Object...)
- Returns:
- The constructed object
- Throws:
InstantiationException
- whenConstructor.newInstance(Object...)
would throwIllegalAccessException
- whenConstructor.newInstance(Object...)
would throwIllegalArgumentException
- whenConstructor.newInstance(Object...)
would throwInvocationTargetException
- whenConstructor.newInstance(Object...)
would throw- See Also:
-
getConstructor
-
hasInjectAnnotation
public boolean hasInjectAnnotation() -
getConstructorParameters
-
isCanonicalRecordConstructor
public boolean isCanonicalRecordConstructor()
-