) throws InitializationException
{
try
{
WorkflowElementCfgDefn definition;
ClassPropertyDefinition propertyDefinition;
// I cannot use the parameterized type WorflowElement<?>
// because it would break the line WorkflowElement.class below.
// Use SuppressWarning because we know the cast is safe.
@SuppressWarnings("unchecked")
Class<? extends WorkflowElement> workflowElementClass;
definition = WorkflowElementCfgDefn.getInstance();
propertyDefinition =
definition.getJavaClassPropertyDefinition();
workflowElementClass =
propertyDefinition.loadClass(className, WorkflowElement.class);
// Again, use SuppressWarning because we know the cast is safe
@SuppressWarnings("unchecked")
WorkflowElement<? extends WorkflowElementCfg> workflowElement =
(WorkflowElement<? extends WorkflowElementCfg>)
workflowElementClass.newInstance();