Package org.springframework.ide.eclipse.quickfix.validator.helper

Examples of org.springframework.ide.eclipse.quickfix.validator.helper.BeanHelper


    ValidationRuleDefinition ruleDefinition = getValidationRule(project, BeanFactoryRule.class);
    BeanFactoryRule rule = (BeanFactoryRule) (ruleDefinition != null ? ruleDefinition.getRule() : null);
    if (rule != null) {

      BeanHelper parentBean = new BeanHelper(parent, file, project);
      parentBean.getBeanDefinition().setFactoryBeanName(attribute.getNodeValue());

      Node factoryMethodAttr = parent.getAttributes().getNamedItem(BeansSchemaConstants.ATTR_FACTORY_METHOD);
      if (factoryMethodAttr != null) {
        parentBean.getBeanDefinition().setFactoryMethodName(factoryMethodAttr.getNodeValue());
      }

      BeansValidationContextHelper context = new BeansValidationContextHelper(attribute, parent, contextElement,
          project, reporter, validator, QuickfixProcessorFactory.FACTORY_BEAN, false, reportError, config);
      context.setCurrentRuleDefinition(ruleDefinition);
View Full Code Here


      BeansEditorValidator validator, String text) {
    IProject project = file.getProject();

    ValidationRuleDefinition ruleDefinition = getValidationRule(project, BeanFactoryRule.class);
    BeanFactoryRule rule = (BeanFactoryRule) (ruleDefinition != null ? ruleDefinition.getRule() : null);
    BeanHelper parentBean = new BeanHelper(parent, file, project);
    parentBean.getBeanDefinition().setFactoryMethodName(text);

    AttrImpl factoryBeanAttr = (AttrImpl) parent.getAttributes().getNamedItem(
        BeansSchemaConstants.ATTR_FACTORY_BEAN);
    if (factoryBeanAttr != null) {
      parentBean.getBeanDefinition().setFactoryBeanName(factoryBeanAttr.getNodeValue());
    }

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

    ValidationRuleDefinition initRuleDefinition = getValidationRule(project, BeanInitDestroyMethodRule.class);
    BeanInitDestroyMethodRule initDestroyMethodRule = (BeanInitDestroyMethodRule) (initRuleDefinition != null ? initRuleDefinition
        .getRule()
        : null);

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

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

    AbstractBeanDefinition beanDefinition = (AbstractBeanDefinition) parentBean.getBeanDefinition();
    if (attribute.getNodeName().equals(BeansSchemaConstants.ATTR_INIT_METHOD)) {
      beanDefinition.setInitMethodName(attribute.getNodeValue());
    }
    else if (attribute.getNodeName().equals(BeansSchemaConstants.ATTR_DESTROY_METHOD)) {
      beanDefinition.setDestroyMethodName(attribute.getNodeValue());
View Full Code Here

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

    BeanHelper parentBean = new BeanHelper(beanNode, file, file.getProject());

    if (attribute.getLocalName().equals(BeansSchemaConstants.ATTR_DEPENDS_ON)) {
      parentBean.getBeanDefinition().setDependsOn(
          StringUtils.tokenizeToStringArray(text,
              BeanDefinitionParserDelegate.MULTI_VALUE_ATTRIBUTE_DELIMITERS));
      element = parentBean;
    }
    else if (attribute.getLocalName().equals(BeansSchemaConstants.ATTR_PARENT)) {
      element = parentBean;
    }
    else if (attribute.getLocalName().equals(BeansSchemaConstants.ATTR_FACTORY_BEAN)) {
      parentBean.getBeanDefinition().setFactoryBeanName(text);
      element = parentBean;
    }
    else if (parent.getLocalName().equals(BeansSchemaConstants.ELEM_CONSTRUCTOR_ARG)
        && attribute.getLocalName().equals(BeansSchemaConstants.ATTR_REF)) {
      BeanConstructorArgumentHelper ctorHelper = new BeanConstructorArgumentHelper(0, parent, file, parentBean);
View Full Code Here

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

  @Override
  public boolean validateAttributeWithConfig(IBeansConfig config, IResourceModelElement contextElement, IFile file,
      AttrImpl attribute, IDOMNode parent, IReporter reporter, boolean reportError,
      BeansEditorValidator validator, String text) {
    IProject project = file.getProject();
    BeanHelper parentBean = new BeanHelper(parent, file, project);

    ValidationRuleDefinition ruleDefinition = getValidationRule(project, BeanClassRule.class);
    BeanClassRule classRule = (BeanClassRule) (ruleDefinition != null ? ruleDefinition.getRule() : null);

    if (classRule != null) {
View Full Code Here

  public boolean validateAttributeWithConfig(IBeansConfig config, IResourceModelElement contextElement, IFile file,
      AttrImpl attribute, IDOMNode parent, IReporter reporter, boolean reportError,
      BeansEditorValidator validator, String text) {
    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);
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.quickfix.validator.helper.BeanHelper

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.