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