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

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


    if (context.getErrorFound()) {
      return true;
    }

    ValidationRuleDefinition depracationRuleDefinition = getValidationRule(project, BeanDeprecationRule.class);
    BeanDeprecationRule deprecationRule = (BeanDeprecationRule) (depracationRuleDefinition != null ? depracationRuleDefinition
        .getRule()
        : null);

    context = new BeansValidationContextHelper(attribute, parent, config, project, reporter, validator,
        QuickfixProcessorFactory.DEPRECATED, false, reportError, config);

    if (deprecationRule != null) {
      context.setCurrentRuleDefinition(depracationRuleDefinition);
      deprecationRule.validate(parentBean, context, null);
    }

    return context.getErrorFound();

  }
View Full Code Here


    ValidationRuleDefinition propertyRuleDefinition = getValidationRule(project, BeanPropertyRule.class);
    BeanPropertyRule propertyRule = (BeanPropertyRule) (propertyRuleDefinition != null ? propertyRuleDefinition
        .getRule() : null);

    ValidationRuleDefinition depracationRuleDefinition = getValidationRule(project, BeanDeprecationRule.class);
    BeanDeprecationRule deprecationRule = (BeanDeprecationRule) (depracationRuleDefinition != null ? depracationRuleDefinition
        .getRule() : null);

    IDOMNode parentBeanNode = getParentBeanNode(parent);
    if (parentBeanNode == null) {
      return false;
    }

    BeanHelper parentBean = new BeanHelper(parentBeanNode, file, project);

    BeansValidationContextHelper context = new BeansValidationContextHelper(attribute, parent, contextElement,
        project, reporter, validator, QuickfixProcessorFactory.PROPERTY, false, reportError, config);
    BeanPropertyHelper property = new BeanPropertyHelper(parent, file, parentBean);

    if (propertyRule != null) {
      context.setCurrentRuleDefinition(propertyRuleDefinition);
      propertyRule.validate(property, context, null);
    }

    if (context.getErrorFound()) {
      return true;
    }

    context = new BeansValidationContextHelper(attribute, parent, contextElement, project, reporter, validator,
        QuickfixProcessorFactory.DEPRECATED, false, reportError, config);

    ITextRegion valueRegion = attribute.getValueRegion();

    AbstractBeanDefinition mergedBd = (AbstractBeanDefinition) BeansModelUtils.getMergedBeanDefinition(parentBean,
        context.getContextElement());

    // For non-factory beans validate it's init-method and
    // destroy-method
    String mergedClassName = mergedBd.getBeanClassName();

    if (valueRegion != null && mergedClassName != null) {
      // add rename refactoring option
      validator.createAndAddEmptyMessage(valueRegion, parent, "", reporter,
          QuickfixProcessorFactory.RENAME_PROPERTY, null, new ValidationProblemAttribute("CLASS",
              mergedClassName));
    }

    if (deprecationRule != null) {
      context.setCurrentRuleDefinition(depracationRuleDefinition);
      deprecationRule.validate(property, context, null);
    }

    return context.getErrorFound();
  }
View Full Code Here

      BeansValidationContextHelper deprecatedContext = new BeansValidationContextHelper(attribute, parent,
          contextElement, project, reporter, validator, QuickfixProcessorFactory.DEPRECATED, false,
          reportError, config);
      ruleDefinition = getValidationRule(project, BeanDeprecationRule.class);
      BeanDeprecationRule deprecationRule = (BeanDeprecationRule) (ruleDefinition != null ? ruleDefinition
          .getRule() : null);

      if (deprecationRule != null) {
        classContext.setCurrentRuleDefinition(ruleDefinition);
        deprecationRule.validate(parentBean, deprecatedContext, null);
      }

      Set<String> problemIdToIgnore = new HashSet<String>();
      problemIdToIgnore.add("MISSING_CONSTRUCTOR_ARG_NAME");
      BeansValidationContextHelper constructorArgContext = new BeansValidationContextHelper(attribute, parent,
View Full Code Here

TOP

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

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.