Examples of TypedStringValue


Examples of org.springframework.beans.factory.config.TypedStringValue

      }
      RuntimeBeanReference ref = new RuntimeBeanReference(refName);
      ref.setSource(extractSource(ele));
      return ref;
    } else if (hasValueAttribute) {
      TypedStringValue valueHolder = new TypedStringValue(ele.getAttribute(VALUE_ATTRIBUTE));
      valueHolder.setSource(extractSource(ele));
      return valueHolder;
    } else if (subElement != null) {
      return parsePropertySubElement(subElement, bd);
    } else {
      // Neither child element nor "ref" or "value" attribute found.
View Full Code Here

Examples of org.springframework.beans.factory.config.TypedStringValue

      return parseValueElement(ele, defaultValueType);
    } else if (nodeNameEquals(ele, NULL_ELEMENT)) {
      // It's a distinguished null value. Let's wrap it in a
      // TypedStringValue
      // object in order to preserve the source location.
      TypedStringValue nullHolder = new TypedStringValue(null);
      nullHolder.setSource(extractSource(ele));
      return nullHolder;
    } else if (nodeNameEquals(ele, ARRAY_ELEMENT)) {
      return parseArrayElement(ele, bd);
    } else if (nodeNameEquals(ele, LIST_ELEMENT)) {
      return parseListElement(ele, bd);
View Full Code Here

Examples of org.springframework.beans.factory.config.TypedStringValue

    String typeName = specifiedTypeName;
    if (!StringUtils.hasText(typeName)) {
      typeName = defaultTypeName;
    }
    try {
      TypedStringValue typedValue = buildTypedStringValue(value, typeName);
      typedValue.setSource(extractSource(ele));
      typedValue.setSpecifiedTypeName(specifiedTypeName);
      return typedValue;
    } catch (ClassNotFoundException ex) {
      error("Type class [" + typeName + "] not found for <value> element", ele, ex);
      return value;
    }
View Full Code Here

Examples of org.springframework.beans.factory.config.TypedStringValue

   *
   * @see org.springframework.beans.factory.config.TypedStringValue
   */
  protected TypedStringValue buildTypedStringValue(String value, String targetTypeName)
      throws ClassNotFoundException {
    TypedStringValue typedValue;
    if (!StringUtils.hasText(targetTypeName)) {
      typedValue = new TypedStringValue(value);
    } else {
      typedValue = new TypedStringValue(value, targetTypeName);
    }
    return typedValue;
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.TypedStringValue

   *
   * @see org.springframework.beans.factory.config.TypedStringValue
   */
  protected final Object buildTypedStringValueForMap(String value, String defaultTypeName, Element entryEle) {
    try {
      TypedStringValue typedValue = buildTypedStringValue(value, defaultTypeName);
      typedValue.setSource(extractSource(entryEle));
      return typedValue;
    } catch (ClassNotFoundException ex) {
      error("Type class [" + defaultTypeName + "] not found for Map key/value type", entryEle, ex);
      return value;
    }
View Full Code Here

Examples of org.springframework.beans.factory.config.TypedStringValue

    for (Element propEle : propEles) {
      String key = propEle.getAttribute(KEY_ATTRIBUTE);
      // Trim the text value to avoid unwanted whitespace
      // caused by typical XML formatting.
      String value = DomUtils.getTextValue(propEle).trim();
      TypedStringValue keyHolder = new TypedStringValue(key);
      keyHolder.setSource(extractSource(propEle));
      TypedStringValue valueHolder = new TypedStringValue(value);
      valueHolder.setSource(extractSource(propEle));
      props.put(keyHolder, valueHolder);
    }

    return props;
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.TypedStringValue

                                            .getGenericArgumentValues();
                                   
                                    ConstructorArgumentValues.ValueHolder v
                                        = l.get(0);
                                   
                                    TypedStringValue nss = (TypedStringValue)v.getValue();
                                    v = l.get(1);
                                    TypedStringValue ln = (TypedStringValue)v.getValue();
                                    checked.add(new QName(nss.getValue(), ln.getValue()));
                                } catch (Exception ex) {
                                    //ignore
                                    break;
                                }
                            } else {
View Full Code Here

Examples of org.springframework.beans.factory.config.TypedStringValue

   */
  public static void setValueIfAttributeDefined(BeanDefinitionBuilder builder, Element element,
      String attributeName, String propertyName, boolean emptyStringAllowed) {
    String attributeValue = element.getAttribute(attributeName);
    if (StringUtils.hasText(attributeValue) || (emptyStringAllowed && element.hasAttribute(attributeName))) {
      builder.addPropertyValue(propertyName, new TypedStringValue(attributeValue));
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.TypedStringValue

   */
  public static void setValueIfAttributeDefined(BeanDefinitionBuilder builder, Element element,
      String attributeName, String propertyName, boolean emptyStringAllowed, String defaultPropertyValue) {
    String attributeValue = element.getAttribute(attributeName);
    if (StringUtils.hasText(attributeValue) || (emptyStringAllowed && element.hasAttribute(attributeName))) {
      builder.addPropertyValue(propertyName, new TypedStringValue(attributeValue));
    } else if (StringUtils.hasText(defaultPropertyValue)) {
      builder.addPropertyValue(propertyName, new TypedStringValue(defaultPropertyValue));
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.TypedStringValue

  }

    public static void setPropertyIfAttributePresent(BeanDefinitionBuilder builder, Element element, String attributeName) {
    String attributeValue = element.getAttribute(attributeName);
    if (StringUtils.hasText(attributeValue)) {
      builder.addPropertyValue(Conventions.attributeNameToPropertyName(attributeName), new TypedStringValue(attributeValue));
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.