_init.addProgram(program);
}
public void addBuilderProgram(ConfigProgram program)
{
QName name = program.getQName();
if (name == null) {
addInitProgram(program);
return;
}
Class<?> cl = createClass(name);
if (cl == null) {
}
else if (Annotation.class.isAssignableFrom(cl)) {
ConfigType<?> type = TypeFactory.getType(cl);
Object bean = type.create(null, name);
Node node = getProgramNode(program);
if (node != null)
XmlConfigContext.getCurrent().configureNode(node, bean, type);
Annotation ann = (Annotation) type.replaceObject(bean);
addAnnotation(ann);
return;
}
if (name.getNamespaceURI().equals(_name.getNamespaceURI())) {
if (_configType.getAttribute(name) != null)
addInitProgram(program);
else {
throw new ConfigException(L.l("'{0}' is an unknown field for '{1}'",
name.getLocalName(), _class.getName()));
}
}
else
throw new ConfigException(L.l("'{0}' is an unknown field name. Fields must belong to the same namespace as the class",
name.getCanonicalName()));
}