本文整理匯總了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);
}
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例5: getBundleContentPattern
import org.springframework.util.ObjectUtils; //導入方法依賴的package包/類
protected String[] getBundleContentPattern() {
return (String[]) ObjectUtils.addObjectToArray(super.getBundleContentPattern(), "namespace/**/*");
}
示例6: getBundleContentPattern
import org.springframework.util.ObjectUtils; //導入方法依賴的package包/類
protected String[] getBundleContentPattern() {
return (String[]) ObjectUtils.addObjectToArray(super.getBundleContentPattern(), "bundleclasspath/**/*");
}
示例7: getBundleContentPattern
import org.springframework.util.ObjectUtils; //導入方法依賴的package包/類
protected String[] getBundleContentPattern() {
return ObjectUtils.addObjectToArray(super.getBundleContentPattern(),
"org/eclipse/gemini/blueprint/iandt/io/BaseIoTest.class");
}