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


Java ReflectionUtils.isToStringMethod方法代码示例

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


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

示例1: invoke

import org.springframework.util.ReflectionUtils; //导入方法依赖的package包/类
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
	if (ReflectionUtils.isEqualsMethod(method)) {
		return (isProxyForSameRubyObject(args[0]));
	}
	else if (ReflectionUtils.isHashCodeMethod(method)) {
		return this.rubyObject.hashCode();
	}
	else if (ReflectionUtils.isToStringMethod(method)) {
		String toStringResult = this.rubyObject.toString();
		if (!StringUtils.hasText(toStringResult)) {
			toStringResult = ObjectUtils.identityToString(this.rubyObject);
		}
		return "JRuby object [" + toStringResult + "]";
	}
	try {
		IRubyObject[] rubyArgs = convertToRuby(args);
		IRubyObject rubyResult =
				this.rubyObject.callMethod(this.ruby.getCurrentContext(), method.getName(), rubyArgs);
		return convertFromRuby(rubyResult, method.getReturnType());
	}
	catch (RaiseException ex) {
		throw new JRubyExecutionException(ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:JRubyScriptUtils.java

示例2: invoke

import org.springframework.util.ReflectionUtils; //导入方法依赖的package包/类
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
	if (ReflectionUtils.isEqualsMethod(method)) {
		return (isProxyForSameBshObject(args[0]));
	}
	else if (ReflectionUtils.isHashCodeMethod(method)) {
		return this.xt.hashCode();
	}
	else if (ReflectionUtils.isToStringMethod(method)) {
		return "BeanShell object [" + this.xt + "]";
	}
	try {
		Object result = this.xt.invokeMethod(method.getName(), args);
		if (result == Primitive.NULL || result == Primitive.VOID) {
			return null;
		}
		if (result instanceof Primitive) {
			return ((Primitive) result).getValue();
		}
		return result;
	}
	catch (EvalError ex) {
		throw new BshExecutionException(ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:BshScriptUtils.java

示例3: invoke

import org.springframework.util.ReflectionUtils; //导入方法依赖的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

示例4: invoke

import org.springframework.util.ReflectionUtils; //导入方法依赖的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 service locator proxy.
		return System.identityHashCode(proxy);
	}
	else if (ReflectionUtils.isToStringMethod(method)) {
		return "Service locator: " + serviceLocatorInterface.getName();
	}
	else {
		return invokeServiceLocatorMethod(method, args);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:ServiceLocatorFactoryBean.java

示例5: isToStringMethod

import org.springframework.util.ReflectionUtils; //导入方法依赖的package包/类
/**
 * Determine whether the given method is a "toString" method.
 * @see java.lang.Object#toString()
 */
public static boolean isToStringMethod(Method method) {
	return ReflectionUtils.isToStringMethod(method);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:AopUtils.java


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