本文整理汇总了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");
}