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


Java ObjectUtils.addObjectToArray方法代码示例

本文整理汇总了Java中org.springframework.util.ObjectUtils.addObjectToArray方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectUtils.addObjectToArray方法的具体用法?Java ObjectUtils.addObjectToArray怎么用?Java ObjectUtils.addObjectToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.util.ObjectUtils的用法示例。


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

示例1: addSyntheticDependsOn

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
private void addSyntheticDependsOn(BeanDefinition definition, String beanName) {
	if (StringUtils.hasText(beanName)) {
		String[] dependsOn = definition.getDependsOn();
		if (dependsOn != null && dependsOn.length > 0) {
			for (String dependOn : dependsOn) {
				if (beanName.equals(dependOn)) {
					return;
				}
			}
		}

		// add depends on
		dependsOn = (String[]) ObjectUtils.addObjectToArray(dependsOn, beanName);
		definition.setDependsOn(dependsOn);
		Collection<String> markers = (Collection<String>) definition.getAttribute(SYNTHETIC_DEPENDS_ON);
		if (markers == null) {
			markers = new ArrayList<String>(2);
			definition.setAttribute(SYNTHETIC_DEPENDS_ON, markers);
		}
		markers.add(beanName);
	}
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:23,代码来源:CycleOrderingProcessor.java

示例2: SimpleServiceJDKProxyCreator

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
public SimpleServiceJDKProxyCreator(BundleContext context, Class<?>[] classes, ClassLoader loader) {
	// add Spring-DM proxies
	Object[] obj = ObjectUtils.addObjectToArray(classes, ImportedOsgiServiceProxy.class);
	this.classes = (Class[]) ObjectUtils.addObjectToArray(obj, SpringProxy.class);
	System.out.println("given classes " + ObjectUtils.nullSafeToString(classes) + " | resulting classes "
			+ ObjectUtils.nullSafeToString(this.classes));
	this.loader = loader;
	this.context = context;
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:10,代码来源:SimpleServiceJDKProxyCreator.java

示例3: prepareScriptBeans

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
/**
 * Prepare the script beans in the internal BeanFactory that this
 * post-processor uses. Each original bean definition will be split
 * into a ScriptFactory definition and a scripted object definition.
 * @param bd the original bean definition in the main BeanFactory
 * @param scriptFactoryBeanName the name of the internal ScriptFactory bean
 * @param scriptedObjectBeanName the name of the internal scripted object bean
 */
protected void prepareScriptBeans(BeanDefinition bd, String scriptFactoryBeanName, String scriptedObjectBeanName) {

	// Avoid recreation of the script bean definition in case of a prototype.
	synchronized (this.scriptBeanFactory) {
		if (!this.scriptBeanFactory.containsBeanDefinition(scriptedObjectBeanName)) {

			this.scriptBeanFactory.registerBeanDefinition(scriptFactoryBeanName,
					createScriptFactoryBeanDefinition(bd));
			ScriptFactory scriptFactory = this.scriptBeanFactory
					.getBean(scriptFactoryBeanName, ScriptFactory.class);
			ScriptSource scriptSource = getScriptSource(scriptFactoryBeanName,
					scriptFactory.getScriptSourceLocator());
			Class<?>[] interfaces = scriptFactory.getScriptInterfaces();

			Class<?>[] scriptedInterfaces = interfaces;
			if (scriptFactory.requiresConfigInterface() && !bd.getPropertyValues().isEmpty()) {
				Class<?> configInterface = createConfigInterface(bd, interfaces);
				scriptedInterfaces = ObjectUtils.addObjectToArray(interfaces, configInterface);
			}

			BeanDefinition objectBd = createScriptedObjectBeanDefinition(bd, scriptFactoryBeanName, scriptSource,
					scriptedInterfaces);
			long refreshCheckDelay = resolveRefreshCheckDelay(bd);
			if (refreshCheckDelay >= 0) {
				objectBd.setScope(BeanDefinition.SCOPE_PROTOTYPE);
			}

			this.scriptBeanFactory.registerBeanDefinition(scriptedObjectBeanName, objectBd);
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:40,代码来源:ScriptFactoryPostProcessor.java

示例4: addDependsOn

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
/**
 * Append the specified bean name to the list of beans that this definition
 * depends on.
 */
public BeanDefinitionBuilder addDependsOn(String beanName) {
	if (this.beanDefinition.getDependsOn() == null) {
		this.beanDefinition.setDependsOn(new String[] {beanName});
	}
	else {
		String[] added = ObjectUtils.addObjectToArray(this.beanDefinition.getDependsOn(), beanName);
		this.beanDefinition.setDependsOn(added);
	}
	return this;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:BeanDefinitionBuilder.java

示例5: getBundleContentPattern

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
protected String[] getBundleContentPattern() {
	return (String[]) ObjectUtils.addObjectToArray(super.getBundleContentPattern(), "namespace/**/*");
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:4,代码来源:EmbeddedNamespaceLibraryTest.java

示例6: getBundleContentPattern

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
protected String[] getBundleContentPattern() {
	return (String[]) ObjectUtils.addObjectToArray(super.getBundleContentPattern(), "bundleclasspath/**/*");
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:4,代码来源:OSGI799Test.java

示例7: getBundleContentPattern

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
protected String[] getBundleContentPattern() {
	return ObjectUtils.addObjectToArray(super.getBundleContentPattern(),
		"org/eclipse/gemini/blueprint/iandt/io/BaseIoTest.class");
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:5,代码来源:BaseIoTest.java


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