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);
    }
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);
    }
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

   */
  protected TypedStringValue buildTypedStringValue(String value, String targetTypeName)
      throws ClassNotFoundException {

    ClassLoader classLoader = this.readerContext.getBeanClassLoader();
    TypedStringValue typedValue;
    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);
    }
    return typedValue;
  }
View Full Code Here

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

   * Build a typed String value Object for the given raw value.
   * @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

    if (StringUtils.hasText(refreshCheckDelay)) {
      bd.getPropertyValues().add("defaultRefreshCheckDelay", new Long(refreshCheckDelay));
    }
    String proxyTargetClass = element.getAttribute(PROXY_TARGET_CLASS_ATTRIBUTE);
    if (StringUtils.hasText(proxyTargetClass)) {
      bd.getPropertyValues().add("defaultProxyTargetClass", new TypedStringValue(proxyTargetClass, Boolean.class));
    }
    return null;
  }
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

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

    List<Element> cacheableCacheMethods = DomUtils.getChildElementsByTagName(definition, CACHEABLE_ELEMENT);

    for (Element opElement : cacheableCacheMethods) {
      String name = prop.merge(opElement, parserContext.getReaderContext());
      TypedStringValue nameHolder = new TypedStringValue(name);
      nameHolder.setSource(parserContext.extractSource(opElement));
      CacheOperation op = prop.merge(opElement, parserContext.getReaderContext(), new CacheableOperation());

      Collection<CacheOperation> col = cacheOpMap.get(nameHolder);
      if (col == null) {
        col = new ArrayList<CacheOperation>(2);
        cacheOpMap.put(nameHolder, col);
      }
      col.add(op);
    }

    List<Element> evictCacheMethods = DomUtils.getChildElementsByTagName(definition, CACHE_EVICT_ELEMENT);

    for (Element opElement : evictCacheMethods) {
      String name = prop.merge(opElement, parserContext.getReaderContext());
      TypedStringValue nameHolder = new TypedStringValue(name);
      nameHolder.setSource(parserContext.extractSource(opElement));
      CacheEvictOperation op = prop.merge(opElement, parserContext.getReaderContext(), new CacheEvictOperation());

      String wide = opElement.getAttribute("all-entries");
      if (StringUtils.hasText(wide)) {
        op.setCacheWide(Boolean.valueOf(wide.trim()));
      }

      String after = opElement.getAttribute("before-invocation");
      if (StringUtils.hasText(after)) {
        op.setBeforeInvocation(Boolean.valueOf(after.trim()));
      }

      Collection<CacheOperation> col = cacheOpMap.get(nameHolder);
      if (col == null) {
        col = new ArrayList<CacheOperation>(2);
        cacheOpMap.put(nameHolder, col);
      }
      col.add(op);
    }

    List<Element> putCacheMethods = DomUtils.getChildElementsByTagName(definition, CACHE_PUT_ELEMENT);

    for (Element opElement : putCacheMethods) {
      String name = prop.merge(opElement, parserContext.getReaderContext());
      TypedStringValue nameHolder = new TypedStringValue(name);
      nameHolder.setSource(parserContext.extractSource(opElement));
      CacheOperation op = prop.merge(opElement, parserContext.getReaderContext(), new CachePutOperation());

      Collection<CacheOperation> col = cacheOpMap.get(nameHolder);
      if (col == null) {
        col = new ArrayList<CacheOperation>(2);
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
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.