Package org.springframework.ide.eclipse.beans.core.internal.model.validation.rules

Examples of org.springframework.ide.eclipse.beans.core.internal.model.validation.rules.BeanConstructorArgumentRule


      problemIdToIgnore.add("MISSING_CONSTRUCTOR_ARG_NAME");
      BeansValidationContextHelper constructorArgContext = new BeansValidationContextHelper(attribute, parent,
          contextElement, project, reporter, validator, QuickfixProcessorFactory.CONSTRUCTOR_ARG, true,
          reportError, config, problemIdToIgnore);
      ruleDefinition = getValidationRule(project, BeanConstructorArgumentRule.class);
      BeanConstructorArgumentRule argRule = (BeanConstructorArgumentRule) (ruleDefinition != null ? ruleDefinition
          .getRule() : null);
      if (argRule != null) {
        constructorArgContext.setCurrentRuleDefinition(ruleDefinition);
        argRule.validate(parentBean, constructorArgContext, null);
      }

      BeansValidationContextHelper requiredContext = new BeansValidationContextHelper(attribute, parent,
          contextElement, project, reporter, validator, QuickfixProcessorFactory.REQUIRED_PROPERTY, false,
          reportError, config);
View Full Code Here


    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();
    }
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.beans.core.internal.model.validation.rules.BeanConstructorArgumentRule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.