public class JavaNewInstanceOperation extends Object
JavaModule related to dynamic objects instantiation.| Constructor and Description |
|---|
JavaNewInstanceOperation() |
| Modifier and Type | Method and Description |
|---|---|
Object |
newInstance(ConstructorIdentifier identifier,
Map<String,org.mule.runtime.api.metadata.TypedValue<Object>> args)
Operation that allows the user to create a new instance of the given
class
The identifier of the Constructor to be used includes the class and constructor names,
being the constructor a full description of its signature including the types of each parameter. |
@Alias(value="new") @Throws(value=JavaNewInstanceErrorProvider.class) @OutputResolver(output=ConstructorTypeResolver.class) @Execution(value=CPU_LITE) public Object newInstance(@ParameterGroup(name="Constructor") @MetadataKeyId(value=ConstructorTypeResolver.class) ConstructorIdentifier identifier, @Optional @NullSafe @Content @TypeResolver(value=ConstructorTypeResolver.class) Map<String,org.mule.runtime.api.metadata.TypedValue<Object>> args) throws ClassNotFoundModuleException, NoSuchConstructorModuleException, ArgumentMismatchModuleException, InvocationModuleException, NonInstantiableTypeModuleException
class
The identifier of the Constructor to be used includes the class and constructor names,
being the constructor a full description of its signature including the types of each parameter.
For example, if we want to invoke the constructor Foo(String name, int age)
which belongs to Class org.bar.Foo, then the identifier of the method will be "Foo(String,int)"
identifier - the unique identifier for the constructor to be invokedargs - the arguments used to invoke the given ConstructorclassClassNotFoundModuleException - if the given class is not found in the current contextNoSuchConstructorModuleException - if the given class does not declare a constructor with the given signatureArgumentMismatchModuleException - if the method requires a different set of arguments than the ones providedInvocationModuleException - if an error occurs during the execution of the methodNonInstantiableTypeModuleException - if the given class is not instantiableCopyright © 2025 MuleSoft, Inc.. All rights reserved.