// create a new instance of this UDF class with the operands stored in the object to replace:
returnconstructor.newInstance((Object)(((DefaultUDF)objToReplace).getParameters()));/* note: without this class, each item of the given array will be considered as a single parameter. */
}catch(Exceptionex){
// IF NO INSTANCE CAN BE CREATED...
// ...keep the error for further report:
errors.addException(newUnresolvedFunction("Impossible to represent the function \""+((DefaultUDF)objToReplace).getName()+"\": the following error occured while creating this representation: \""+((exinstanceofInvocationTargetException)?"["+ex.getCause().getClass().getSimpleName()+"] "+ex.getCause().getMessage():ex.getMessage())+"\"",(DefaultUDF)objToReplace));
thrownewIllegalArgumentException("The given class ("+udfClass.getName()+") does not provide any constructor with a single parameter of type ADQLOperand[]!");
}
// Set the new UDF class:
this.udfClass=udfClass;
}catch(SecurityExceptione){
thrownewIllegalArgumentException("A security problem occurred while trying to get constructor from the class "+udfClass.getName()+": "+e.getMessage());
}catch(NoSuchMethodExceptione){
thrownewIllegalArgumentException("The given class ("+udfClass.getName()+") does not provide any constructor with a single parameter of type ADQLOperand[]!");
}
}
/**
* <p>Let parsing the serialized form of a function definition.</p>