Package org.springframework.beans

Examples of org.springframework.beans.BeanMetadataAttribute


      Node node = nl.item(i);
      if (node instanceof Element && DomUtils.nodeNameEquals(node, META_ELEMENT)) {
        Element metaElement = (Element) node;
        String key = metaElement.getAttribute(KEY_ATTRIBUTE);
        String value = metaElement.getAttribute(VALUE_ATTRIBUTE);
        BeanMetadataAttribute attribute = new BeanMetadataAttribute(key, value);
        attribute.setSource(extractSource(metaElement));
        attributeAccessor.addMetadataAttribute(attribute);
      }
    }
  }
View Full Code Here


        if (node instanceof Element && DomUtils.nodeNameEquals(node, QUALIFIER_ATTRIBUTE_ELEMENT)) {
          Element attributeEle = (Element) node;
          String attributeName = attributeEle.getAttribute(KEY_ATTRIBUTE);
          String attributeValue = attributeEle.getAttribute(VALUE_ATTRIBUTE);
          if (StringUtils.hasLength(attributeName) && StringUtils.hasLength(attributeValue)) {
            BeanMetadataAttribute attribute = new BeanMetadataAttribute(attributeName, attributeValue);
            attribute.setSource(extractSource(attributeEle));
            qualifier.addMetadataAttribute(attribute);
          }
          else {
            error("Qualifier 'attribute' tag must have a 'name' and 'value'", attributeEle);
            return;
View Full Code Here

      Node node = nl.item(i);
      if (isCandidateElement(node) && nodeNameEquals(node, META_ELEMENT)) {
        Element metaElement = (Element) node;
        String key = metaElement.getAttribute(KEY_ATTRIBUTE);
        String value = metaElement.getAttribute(VALUE_ATTRIBUTE);
        BeanMetadataAttribute attribute = new BeanMetadataAttribute(key, value);
        attribute.setSource(extractSource(metaElement));
        attributeAccessor.addMetadataAttribute(attribute);
      }
    }
  }
View Full Code Here

        if (isCandidateElement(node) && nodeNameEquals(node, QUALIFIER_ATTRIBUTE_ELEMENT)) {
          Element attributeEle = (Element) node;
          String attributeName = attributeEle.getAttribute(KEY_ATTRIBUTE);
          String attributeValue = attributeEle.getAttribute(VALUE_ATTRIBUTE);
          if (StringUtils.hasLength(attributeName) && StringUtils.hasLength(attributeValue)) {
            BeanMetadataAttribute attribute = new BeanMetadataAttribute(attributeName, attributeValue);
            attribute.setSource(extractSource(attributeEle));
            qualifier.addMetadataAttribute(attribute);
          }
          else {
            error("Qualifier 'attribute' tag must have a 'name' and 'value'", attributeEle);
            return;
View Full Code Here

        for (Method method : annotationType.getMethods()) {
          if (method.getParameterTypes().length == 0 && method.getDeclaringClass() != Object.class) {
            try {
              String attrName = method.getName();
              Object attrValue = method.invoke(annotation);
              md.addMetadataAttribute(new BeanMetadataAttribute(attrName, attrValue));
            }
            catch (Exception e) {
              throw new UnsupportedOperationException("handle me gracefully", e);
            }
          }
View Full Code Here

    return false;
  }

  public boolean isGeneratedElementName() {
    if (definition instanceof AbstractBeanDefinition) {
      BeanMetadataAttribute attribute = ((AbstractBeanDefinition) definition)
          .getMetadataAttribute(UniqueBeanNameGenerator.GENERATED_BEAN_NAME_PROPERTY);
      if (attribute != null && attribute.getValue() instanceof Boolean) {
        return ((Boolean) attribute.getValue()).booleanValue();
      }
    }
    return false;
  }
View Full Code Here

  public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
    String name = generateBeanName(definition, config);

    // Store a maker that the bean name was auto-generated
    if (definition instanceof AbstractBeanDefinition) {
      BeanMetadataAttribute attribute = new BeanMetadataAttribute(
          GENERATED_BEAN_NAME_PROPERTY, Boolean.TRUE);
      attribute.setSource(this);
      ((AbstractBeanDefinition) definition).addMetadataAttribute(attribute);
    }

    return name;
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.BeanMetadataAttribute

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.