本文整理了Java中com.google.gwt.user.server.rpc.RPC.getPrimitiveClassFromWrapper
方法的一些代码示例,展示了RPC.getPrimitiveClassFromWrapper
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RPC.getPrimitiveClassFromWrapper
方法的具体详情如下:
包路径:com.google.gwt.user.server.rpc.RPC
类名称:RPC
方法名:getPrimitiveClassFromWrapper
[英]Returns the java.lang.Class for a primitive type given its corresponding wrapper java.lang.Class.
[中]返回java。给定相应的包装器java的基本类型的lang.Class。朗,同学们。
代码示例来源:origin: com.google.gwt/gwt-servlet
public static String encodeResponseForSuccess(Method serviceMethod, Object object,
SerializationPolicy serializationPolicy, int flags) throws SerializationException {
if (serviceMethod == null) {
throw new NullPointerException("serviceMethod cannot be null");
}
if (serializationPolicy == null) {
throw new NullPointerException("serializationPolicy");
}
Class<?> methodReturnType = serviceMethod.getReturnType();
if (methodReturnType != void.class && object != null) {
Class<?> actualReturnType;
if (methodReturnType.isPrimitive()) {
actualReturnType = getPrimitiveClassFromWrapper(object.getClass());
} else {
actualReturnType = object.getClass();
}
if (actualReturnType == null || !methodReturnType.isAssignableFrom(actualReturnType)) {
throw new IllegalArgumentException("Type '" + printTypeName(object.getClass())
+ "' does not match the return type in the method's signature: '"
+ getSourceRepresentation(serviceMethod) + "'");
}
}
return encodeResponse(methodReturnType, object, false, flags, serializationPolicy);
}
代码示例来源:origin: net.wetheinter/gwt-user
public static String encodeResponseForSuccess(Method serviceMethod, Object object,
SerializationPolicy serializationPolicy, int flags) throws SerializationException {
if (serviceMethod == null) {
throw new NullPointerException("serviceMethod cannot be null");
}
if (serializationPolicy == null) {
throw new NullPointerException("serializationPolicy");
}
Class<?> methodReturnType = serviceMethod.getReturnType();
if (methodReturnType != void.class && object != null) {
Class<?> actualReturnType;
if (methodReturnType.isPrimitive()) {
actualReturnType = getPrimitiveClassFromWrapper(object.getClass());
} else {
actualReturnType = object.getClass();
}
if (actualReturnType == null || !methodReturnType.isAssignableFrom(actualReturnType)) {
throw new IllegalArgumentException("Type '" + printTypeName(object.getClass())
+ "' does not match the return type in the method's signature: '"
+ getSourceRepresentation(serviceMethod) + "'");
}
}
return encodeResponse(methodReturnType, object, false, flags, serializationPolicy);
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
public static String encodeResponseForSuccess(Method serviceMethod, Object object,
SerializationPolicy serializationPolicy, int flags) throws SerializationException {
if (serviceMethod == null) {
throw new NullPointerException("serviceMethod cannot be null");
}
if (serializationPolicy == null) {
throw new NullPointerException("serializationPolicy");
}
Class<?> methodReturnType = serviceMethod.getReturnType();
if (methodReturnType != void.class && object != null) {
Class<?> actualReturnType;
if (methodReturnType.isPrimitive()) {
actualReturnType = getPrimitiveClassFromWrapper(object.getClass());
} else {
actualReturnType = object.getClass();
}
if (actualReturnType == null || !methodReturnType.isAssignableFrom(actualReturnType)) {
throw new IllegalArgumentException("Type '" + printTypeName(object.getClass())
+ "' does not match the return type in the method's signature: '"
+ getSourceRepresentation(serviceMethod) + "'");
}
}
return encodeResponse(methodReturnType, object, false, flags, serializationPolicy);
}
内容来源于网络,如有侵权,请联系作者删除!