當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。