当前位置: 首页>>代码示例>>Java>>正文


Java ManagedArray类代码示例

本文整理汇总了Java中org.springframework.beans.factory.support.ManagedArray的典型用法代码示例。如果您正苦于以下问题:Java ManagedArray类的具体用法?Java ManagedArray怎么用?Java ManagedArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ManagedArray类属于org.springframework.beans.factory.support包,在下文中一共展示了ManagedArray类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseArrayElement

import org.springframework.beans.factory.support.ManagedArray; //导入依赖的package包/类
/**
 * Parse an array element.
 */
public Object parseArrayElement(Element arrayEle, BeanDefinition bd) {
	String elementType = arrayEle.getAttribute(VALUE_TYPE_ATTRIBUTE);
	NodeList nl = arrayEle.getChildNodes();
	ManagedArray target = new ManagedArray(elementType, nl.getLength());
	target.setSource(extractSource(arrayEle));
	target.setElementTypeName(elementType);
	target.setMergeEnabled(parseMergeAttribute(arrayEle));
	parseCollectionElements(nl, target, bd, elementType);
	return target;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:BeanDefinitionParserDelegate.java

示例2: createStream

import org.springframework.beans.factory.support.ManagedArray; //导入依赖的package包/类
private XStream createStream() {
	XStream stream = new XStream();
	stream.registerConverter(new BeanDefinitionConverter(stream.getMapper()));
	stream.registerConverter(new BeanDefinitionHolderConverter(stream.getMapper()));
	stream.registerConverter(new TypedStringValueConverter());
	stream.registerConverter(new ManagedCollectionConverter(stream.getMapper()));
	stream.registerConverter(new ManagedMapConverter(stream.getMapper()));
	stream.registerConverter(new RuntimeBeanReferenceConverter());
	stream.alias("map", ManagedMap.class);
	stream.alias("list", ManagedList.class);
	stream.alias("set", ManagedSet.class);
	stream.alias("array", ManagedArray.class);
	stream.aliasType("bean", BeanDefinition.class);
	stream.alias("bean", BeanDefinitionHolder.class);
	stream.alias("ref", RuntimeBeanReference.class);
	return stream;
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:18,代码来源:BeanDefinitionWriterServiceImpl.java

示例3: parseArrayElement

import org.springframework.beans.factory.support.ManagedArray; //导入依赖的package包/类
/**
 * Parse an array element.
 */
public Object parseArrayElement(Element arrayEle, BeanDefinition bd) {
	String elementType = arrayEle.getAttribute(BeanDefinitionParserDelegate.VALUE_TYPE_ATTRIBUTE);
	NodeList nl = arrayEle.getChildNodes();
	ManagedArray target = new ManagedArray(elementType, nl.getLength());
	target.setSource(extractSource(arrayEle));
	target.setElementTypeName(elementType);
	target.setMergeEnabled(parseMergeAttribute(arrayEle));
	parseCollectionElements(nl, target, bd, elementType);
	return target;
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:14,代码来源:BlueprintParser.java

示例4: visitCollection

import org.springframework.beans.factory.support.ManagedArray; //导入依赖的package包/类
/**
 * Determines what kind of collection (or array) the given value is and call handlers based on the determined type
 *
 * @param value collection value to process
 * @param propertyName name of the property which has the collection value
 * @param nestedBeanStack stack of bean containers which contains the collection property
 */
protected void visitCollection(Object value, String propertyName, Stack<BeanDefinitionHolder> nestedBeanStack) {
    if (value instanceof Object[] || (value instanceof ManagedArray)) {
        visitArray(value, propertyName, nestedBeanStack);
    } else if (value instanceof List) {
        visitList((List<?>) value, propertyName, nestedBeanStack);
    } else if (value instanceof Set) {
        visitSet((Set<?>) value, propertyName, nestedBeanStack);
    } else if (value instanceof Map) {
        visitMap((Map<?, ?>) value, propertyName, nestedBeanStack);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:DictionaryBeanFactoryPostProcessor.java

示例5: visitArray

import org.springframework.beans.factory.support.ManagedArray; //导入依赖的package包/类
/**
 * Iterates through the array values and calls helpers to process the value
 *
 * @param array the array to process
 * @param propertyName name of the property which has the array value
 * @param nestedBeanStack stack of bean containers which contains the array property
 */
protected void visitArray(Object array, String propertyName, Stack<BeanDefinitionHolder> nestedBeanStack) {
    Object[] arrayVal = null;
    if (array instanceof ManagedArray) {
        arrayVal = (Object[]) ((ManagedArray) array).getSource();
    } else {
        arrayVal = (Object[]) array;
    }

    Object[] newArray = new Object[arrayVal.length];
    for (int i = 0; i < arrayVal.length; i++) {
        Object elem = arrayVal[i];

        if (isStringValue(elem)) {
            elem = processArrayStringPropertyValue(propertyName, arrayVal, getString(elem), i, nestedBeanStack,
                    beanProcessors);
        } else {
            elem = visitPropertyValue(propertyName, elem, nestedBeanStack);
        }

        newArray[i] = elem;
    }

    if (array instanceof ManagedArray) {
        ((ManagedArray) array).setSource(newArray);
    } else {
        array = newArray;
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:36,代码来源:DictionaryBeanFactoryPostProcessor.java

示例6: isCollectionValue

import org.springframework.beans.factory.support.ManagedArray; //导入依赖的package包/类
/**
 * Indicate whether the given value is a collection
 *
 * @param value value to test
 * @return boolean true if the value is a collection, false if not
 */
protected boolean isCollectionValue(Object value) {
    boolean isCollection = false;

    if (value instanceof Object[] || (value instanceof ManagedArray) || (value instanceof List) ||
            (value instanceof Set) || (value instanceof Map)) {
        isCollection = true;
    }

    return isCollection;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:DictionaryBeanFactoryPostProcessor.java

示例7: canConvert

import org.springframework.beans.factory.support.ManagedArray; //导入依赖的package包/类
public boolean canConvert(Class type) {
	return type.equals(ManagedList.class) || type.equals(ManagedArray.class) || type.equals(ManagedSet.class);
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:4,代码来源:BeanDefinitionWriterServiceImpl.java


注:本文中的org.springframework.beans.factory.support.ManagedArray类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。