Examples of TypedStringValue


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

      }
    }
    else if (DomUtils.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 (DomUtils.nodeNameEquals(ele, LIST_ELEMENT)) {
      return parseListElement(ele, bd);
    }
View Full Code Here

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

   */
  protected Object buildTypedStringValue(String value, String targetTypeName, Element ele)
      throws ClassNotFoundException {

    ClassLoader classLoader = this.readerContext.getBeanClassLoader();
    TypedStringValue typedValue = null;
    if (!StringUtils.hasText(targetTypeName)) {
      typedValue = new TypedStringValue(value);
    }
    else if (classLoader != null) {
      Class targetType = ClassUtils.forName(targetTypeName, classLoader);
      typedValue = new TypedStringValue(value, targetType);
    }
    else {
      typedValue = new TypedStringValue(value, targetTypeName);
    }
    typedValue.setSource(extractSource(ele));
    return typedValue;
  }
View Full Code Here

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

      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

    for (int i = 0; i < methods.size(); i++) {
      Element methodEle = (Element) methods.get(i);

      String name = methodEle.getAttribute("name");
      TypedStringValue nameHolder = new TypedStringValue(name);
      nameHolder.setSource(parserContext.extractSource(methodEle));

      RuleBasedTransactionAttribute attribute = new RuleBasedTransactionAttribute();
      String propagation = methodEle.getAttribute(PROPAGATION);
      String isolation = methodEle.getAttribute(ISOLATION);
      String timeout = methodEle.getAttribute(TIMEOUT);
View Full Code Here

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

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

      }
    }
    else if (DomUtils.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 (DomUtils.nodeNameEquals(ele, LIST_ELEMENT)) {
      return parseListElement(ele, bd);
    }
View Full Code Here

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

   */
  protected Object buildTypedStringValue(String value, String targetTypeName, Element ele)
      throws ClassNotFoundException {

    ClassLoader classLoader = this.readerContext.getBeanClassLoader();
    TypedStringValue typedValue = null;
    if (!StringUtils.hasText(targetTypeName)) {
      typedValue = new TypedStringValue(value);
    }
    else if (classLoader != null) {
      Class targetType = ClassUtils.forName(targetTypeName, classLoader);
      typedValue = new TypedStringValue(value, targetType);
    }
    else {
      typedValue = new TypedStringValue(value, targetTypeName);
    }
    typedValue.setSource(extractSource(ele));
    return typedValue;
  }
View Full Code Here

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

      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

      }
      return copy;
    }
    else if (value instanceof TypedStringValue) {
      // Convert value to target type here.
      TypedStringValue typedStringValue = (TypedStringValue) value;
      try {
        Class resolvedTargetType = resolveTargetType(typedStringValue);
        if (resolvedTargetType != null) {
          return this.typeConverter.convertIfNecessary(typedStringValue.getValue(), resolvedTargetType, null);
        }
        else {
          // No target type specified - no conversion necessary...
          return typedStringValue.getValue();
        }
      }
      catch (Throwable ex) {
        // Improve the message by showing the context.
        throw new BeanCreationException(
View Full Code Here

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

    NodeList childNodes = element.getChildNodes();
    for (int i = 0; i < childNodes.getLength(); i++) {
      Node node = childNodes.item(i);
      if (node instanceof Element) {
        Element includeElement = (Element) node;
        TypedStringValue valueHolder = new TypedStringValue(includeElement.getAttribute("name"));
        valueHolder.setSource(parserContext.extractSource(includeElement));
        includePatterns.add(valueHolder);
      }
    }
    if (!includePatterns.isEmpty()) {
      includePatterns.setSource(parserContext.extractSource(element));
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.