public Object endElement(Object o, QName qName, ElementBinding element)
{
AbstractBeanMetaData bean = (AbstractBeanMetaData) o;
if (bean.getBean() == null && bean.isAbstract() == false && bean.getParent() == null)
{
ConstructorMetaData constructor = bean.getConstructor();
if (constructor == null)
throw new IllegalArgumentException("Bean should have a class attribute or a constructor element.");
if (constructor.getFactoryMethod() == null)
{
if (constructor.getValue() == null)
throw new IllegalArgumentException("Bean should have a class attribute or the constructor element should have either a factoryMethod attribute or embedded value.");
}
else if (constructor.getFactory() == null && constructor.getFactoryClass() == null)
throw new IllegalArgumentException("Bean should have a class attribute or the constructor element should have one of a factoryClass attribute or a factory element, or embedded value.");
}
return bean;
}