//System.out.println("sourceClassValidate "+sourceClassValidate);
Expression refExp = (Expression)paramList.get(0);
if(refExp.getType().getType() != TypeConstants.referenceType) // param 0 is the source class
{
logger.severe(Thread.currentThread().getName()+" "+"First param to collect needs to be a reference expression");
throw new IllegalExpressionTypeException(
"first "
+ Messages
.getString("SPL_COLLECT_OPERATION_EXP_EXCEPTION1_MSG")
+ sourceClass);
}
if(refExp instanceof ReferenceExpression)
{
sourceClassValidate = ((ReferenceExpression)refExp).getReferenceTypeName();
referenceExpression = refExp;
ReferenceExpression ref=(ReferenceExpression)refExp;
//System.out.println(" class of refExp is "+ref.getReferenceTypeName());
//refExp.
}
else{
referenceExpression = refExp;
}
Expression assocExp = (Expression)paramList.get(1); // param 1 is the assoc Name
if(assocExp.getType().getType() != TypeConstants.stringType)
{
logger.severe(Thread.currentThread().getName()+" "+"2nd param to collect needs to be a string expression");
throw new IllegalExpressionTypeException(
"second "
+ Messages
.getString("SPL_COLLECT_OPERATION_EXP_EXCEPTION2_MSG"));
}
associationName = (String)assocExp.evaluate();
Expression roleExp = (Expression)paramList.get(2); // param 2 is role 1
if(roleExp.getType().getType() != TypeConstants.stringType)
{
logger.severe(Thread.currentThread().getName()+" "+"3rd param to collect needs to be a string expression");
throw new IllegalExpressionTypeException(
"third "
+ Messages
.getString("SPL_COLLECT_OPERATION_EXP_EXCEPTION2_MSG"));
}
sourceRole = (String)roleExp.evaluate();
roleExp = (Expression)paramList.get(3); // param 3 is role 2
if(roleExp.getType().getType() != TypeConstants.stringType)
{
logger.severe(Thread.currentThread().getName()+" "+"4th param to collect needs to be a string expression");
throw new IllegalExpressionTypeException(
"fourth "
+ Messages
.getString("SPL_COLLECT_OPERATION_EXP_EXCEPTION2_MSG"));
}
targetRole = (String)roleExp.evaluate();
Expression targetClassExp = (Expression)paramList.get(4); // param 4 is the target class name
if(targetClassExp.getType().getType() != TypeConstants.stringType)
{
logger.severe(Thread.currentThread().getName()+" "+"5th param to collect needs to be a string expression");
throw new IllegalExpressionTypeException(
"fifth "
+ Messages
.getString("SPL_COLLECT_OPERATION_EXP_EXCEPTION2_MSG"));
}
targetClassName = (String)targetClassExp.evaluate();