Class qClass = ec.getClassLoaderResolver().classForName(qName);
Method method = qClass.getMethod("candidate", new Class[] {});
Object candObj = method.invoke(null, (Object[])null);
if (candObj == null || !(candObj instanceof PersistableExpression))
{
throw new JDOException("Class " + candidateCls.getName() + " has a Query class but the candidate is invalid");
}
return (PersistableExpression)candObj;
}
catch (NoSuchMethodException nsfe)
{
throw new JDOException("Class " + candidateCls.getName() + " has a Query class but the candidate is invalid");
}
catch (InvocationTargetException ite)
{
throw new JDOException("Class " + candidateCls.getName() + " has a Query class but the candidate is invalid");
}
catch (IllegalAccessException iae)
{
throw new JDOException("Class " + candidateCls.getName() + " has a Query class but the candidate is invalid");
}
}