if ( o == null ) {
throw new ProcessingException("LayoutDescription with name '" + layoutName + "' not found.");
}
DefaultLayoutDescription layoutDescription = (DefaultLayoutDescription)o[0];
Layout layout = null;
try {
Class clazz = ClassUtils.loadClass( layoutDescription.getClassName() );
layout = (Layout)clazz.newInstance();
} catch (Exception e) {
throw new ProcessingException("Unable to create new instance", e );
}
String id = null;
if ( layoutDescription.createId() ) {
synchronized (this) {
id = layoutName + '-' + idCounter;
idCounter += 1;
}
}
layout.initialize( layoutName, id );
layout.setDescription( layoutDescription );
layout.setAspectDataHandler((AspectDataHandler)o[1]);
if ( layout instanceof CompositeLayout ) {
CompositeLayout composite = (CompositeLayout)layout;
composite.setItemClassName(layoutDescription.getItemClassName());
}