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


Java ObjectUtils.nullSafeToString方法代码示例

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


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

示例1: invoke

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
	if (ReflectionUtils.isEqualsMethod(method)) {
		// Only consider equal when proxies are identical.
		return (proxy == args[0]);
	}
	else if (ReflectionUtils.isHashCodeMethod(method)) {
		// Use hashCode of reference proxy.
		return System.identityHashCode(proxy);
	}
	else if (!initialized && ReflectionUtils.isToStringMethod(method)) {
		return "Early singleton proxy for interfaces " +
				ObjectUtils.nullSafeToString(getEarlySingletonInterfaces());
	}
	try {
		return method.invoke(getSingletonInstance(), args);
	}
	catch (InvocationTargetException ex) {
		throw ex.getTargetException();
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:AbstractFactoryBean.java

示例2: obtainDefaultPersistenceUnitInfo

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
@Override
public PersistenceUnitInfo obtainDefaultPersistenceUnitInfo() {
	if (this.persistenceUnitInfoNames.isEmpty()) {
		throw new IllegalStateException("No persistence units parsed from " +
				ObjectUtils.nullSafeToString(this.persistenceXmlLocations));
	}
	if (this.persistenceUnitInfos.isEmpty()) {
		throw new IllegalStateException("All persistence units from " +
				ObjectUtils.nullSafeToString(this.persistenceXmlLocations) + " already obtained");
	}
	if (this.persistenceUnitInfos.size() > 1) {
		return obtainPersistenceUnitInfo(this.defaultPersistenceUnitName);
	}
	PersistenceUnitInfo pui = this.persistenceUnitInfos.values().iterator().next();
	this.persistenceUnitInfos.clear();
	return pui;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:DefaultPersistenceUnitManager.java

示例3: arrayToDelimitedString

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
/**
 * Convenience method to return a String array as a delimited (e.g. CSV)
 * String. E.g. useful for {@code toString()} implementations.
 * @param arr the array to display
 * @param delim the delimiter to use (probably a ",")
 * @return the delimited String
 */
public static String arrayToDelimitedString(Object[] arr, String delim) {
	if (ObjectUtils.isEmpty(arr)) {
		return "";
	}
	if (arr.length == 1) {
		return ObjectUtils.nullSafeToString(arr[0]);
	}
	StringBuilder sb = new StringBuilder();
	for (int i = 0; i < arr.length; i++) {
		if (i > 0) {
			sb.append(delim);
		}
		sb.append(arr[i]);
	}
	return sb.toString();
}
 
开发者ID:vindell,项目名称:spring-boot-starter-disruptor,代码行数:24,代码来源:StringUtils.java

示例4: raiseNoSuchBeanDefinitionException

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
/**
 * Raise a NoSuchBeanDefinitionException for an unresolvable dependency.
 */
private void raiseNoSuchBeanDefinitionException(
		Class<?> type, String dependencyDescription, DependencyDescriptor descriptor)
		throws NoSuchBeanDefinitionException {

	throw new NoSuchBeanDefinitionException(type, dependencyDescription,
			"expected at least 1 bean which qualifies as autowire candidate for this dependency. " +
			"Dependency annotations: " + ObjectUtils.nullSafeToString(descriptor.getAnnotations()));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:DefaultListableBeanFactory.java

示例5: find

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
public Object find(RequestContext requestContext) {
    val key = ObjectUtils.nullSafeToString(keyExpression.evaluate(requestContext));
    return values.get(key);
}
 
开发者ID:int128,项目名称:httpstub,代码行数:5,代码来源:CompiledTable.java

示例6: toString

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
@Override
public String toString() {
	return getClass().getName() + ": advice [" + getAdvice() +
			"], pointcut patterns " + ObjectUtils.nullSafeToString(this.patterns);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:RegexpMethodPointcutAdvisor.java

示例7: toString

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
@Override
public String toString() {
	return getClass().getName() + ": patterns " + ObjectUtils.nullSafeToString(this.patterns) +
			", excluded patterns " + ObjectUtils.nullSafeToString(this.excludedPatterns);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:AbstractRegexpMethodPointcut.java

示例8: contextKeyString

import org.springframework.util.ObjectUtils; //导入方法依赖的package包/类
/**
 * Subclasses can override this to return a String representation of their
 * context key for use in caching and logging.
 * @param contextKey the context key
 */
protected String contextKeyString(Object contextKey) {
	return ObjectUtils.nullSafeToString(contextKey);
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:9,代码来源:AbstractSpringContextTests.java


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