本文整理汇总了Java中org.springframework.util.ReflectionUtils.isHashCodeMethod方法的典型用法代码示例。如果您正苦于以下问题:Java ReflectionUtils.isHashCodeMethod方法的具体用法?Java ReflectionUtils.isHashCodeMethod怎么用?Java ReflectionUtils.isHashCodeMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.util.ReflectionUtils
的用法示例。
在下文中一共展示了ReflectionUtils.isHashCodeMethod方法的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);
}
}
示例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);
}
}
示例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();
}
}
示例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);
}
}
示例5: isHashCodeMethod
import org.springframework.util.ReflectionUtils; //导入方法依赖的package包/类
/**
* Determine whether the given method is a "hashCode" method.
* @see java.lang.Object#hashCode
*/
public static boolean isHashCodeMethod(Method method) {
return ReflectionUtils.isHashCodeMethod(method);
}