IProject project = file.getProject();
IDOMNode parentNode = getParentBeanNode(parent);
BeanHelper parentBean = new BeanHelper(parentNode, file, project);
ValidationRuleDefinition ruleDefinition = getValidationRule(project, BeanConstructorArgumentRule.class);
BeanConstructorArgumentRule constructorArgRule = (BeanConstructorArgumentRule) (ruleDefinition != null ? ruleDefinition
.getRule() : null);
if (constructorArgRule != null) {
BeansValidationContextHelper constructorArgContext = new BeansValidationContextHelper(attribute, parent,
contextElement, project, reporter, validator, QuickfixProcessorFactory.CONSTRUCTOR_ARG, false,
reportError, config);
ruleDefinition = getValidationRule(project, BeanConstructorArgumentRule.class);
BeanConstructorArgumentRule argRule = (BeanConstructorArgumentRule) (ruleDefinition != null ? ruleDefinition
.getRule() : null);
if (argRule != null) {
constructorArgContext.setCurrentRuleDefinition(ruleDefinition);
// NodeList childNodes = parentNode.getChildNodes();
// int counter = 0;
// for(int i=0; i<childNodes.getLength(); i++) {
// Node childNode = childNodes.item(i);
// String localName = childNode.getLocalName();
// if (localName != null) {
// if
// (localName.equals(BeansSchemaConstants.ELEM_CONSTRUCTOR_ARG))
// {
// // BeanConstructorArgumentHelper currConstructorArg = new
// BeanConstructorArgumentHelper(counter, (IDOMNode) childNode,
// file, parentBean);
// counter++;
// if (childNode.equals(parent)) {
// BeanConstructorArgumentHelper constructorArg = new
// BeanConstructorArgumentHelper(counter, (IDOMNode) childNode,
// file, parentBean);
// }
// }
// }
// }
argRule.validate(parentBean, constructorArgContext, null);
}
return constructorArgContext.getErrorFound();
}