com.google.gwt.user.server.rpc.RPC.printTypeName()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.7k)|赞(0)|评价(0)|浏览(241)

本文整理了Java中com.google.gwt.user.server.rpc.RPC.printTypeName方法的一些代码示例,展示了RPC.printTypeName的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RPC.printTypeName方法的具体详情如下:
包路径:com.google.gwt.user.server.rpc.RPC
类名称:RPC
方法名:printTypeName

RPC.printTypeName介绍

[英]Straight copy from com.google.gwt.dev.util.TypeInfo#getSourceRepresentation(Class) to avoid runtime dependency on gwt-dev.
[中]直接从com复制。谷歌。gwt。dev.util。TypeInfo#getSourceRepresentation(类),以避免运行时对gwt-dev的依赖。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. private static String formatMethodNotFoundErrorMessage(Class<?> serviceIntf,
  2. String serviceMethodName, Class<?>[] parameterTypes) {
  3. StringBuffer sb = new StringBuffer();
  4. sb.append("Could not locate requested method '");
  5. sb.append(serviceMethodName);
  6. sb.append("(");
  7. for (int i = 0; i < parameterTypes.length; ++i) {
  8. if (i > 0) {
  9. sb.append(", ");
  10. }
  11. sb.append(printTypeName(parameterTypes[i]));
  12. }
  13. sb.append(")'");
  14. sb.append(" in interface '");
  15. sb.append(printTypeName(serviceIntf));
  16. sb.append("'");
  17. return sb.toString();
  18. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. private static String formatIllegalAccessErrorMessage(Object target, Method serviceMethod) {
  2. StringBuffer sb = new StringBuffer();
  3. sb.append("Blocked attempt to access inaccessible method '");
  4. sb.append(getSourceRepresentation(serviceMethod));
  5. sb.append("'");
  6. if (target != null) {
  7. sb.append(" on target '");
  8. sb.append(printTypeName(target.getClass()));
  9. sb.append("'");
  10. }
  11. sb.append("; this is either misconfiguration or a hack attempt");
  12. return sb.toString();
  13. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. private static String formatIllegalArgumentErrorMessage(Object target, Method serviceMethod,
  2. Object[] args) {
  3. StringBuffer sb = new StringBuffer();
  4. sb.append("Blocked attempt to invoke method '");
  5. sb.append(getSourceRepresentation(serviceMethod));
  6. sb.append("'");
  7. if (target != null) {
  8. sb.append(" on target '");
  9. sb.append(printTypeName(target.getClass()));
  10. sb.append("'");
  11. }
  12. sb.append(" with invalid arguments");
  13. if (args != null && args.length > 0) {
  14. sb.append(Arrays.asList(args));
  15. }
  16. return sb.toString();
  17. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. return printTypeName(componentType) + "[]";

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. public static String encodeResponseForSuccess(Method serviceMethod, Object object,
  2. SerializationPolicy serializationPolicy, int flags) throws SerializationException {
  3. if (serviceMethod == null) {
  4. throw new NullPointerException("serviceMethod cannot be null");
  5. }
  6. if (serializationPolicy == null) {
  7. throw new NullPointerException("serializationPolicy");
  8. }
  9. Class<?> methodReturnType = serviceMethod.getReturnType();
  10. if (methodReturnType != void.class && object != null) {
  11. Class<?> actualReturnType;
  12. if (methodReturnType.isPrimitive()) {
  13. actualReturnType = getPrimitiveClassFromWrapper(object.getClass());
  14. } else {
  15. actualReturnType = object.getClass();
  16. }
  17. if (actualReturnType == null || !methodReturnType.isAssignableFrom(actualReturnType)) {
  18. throw new IllegalArgumentException("Type '" + printTypeName(object.getClass())
  19. + "' does not match the return type in the method's signature: '"
  20. + getSourceRepresentation(serviceMethod) + "'");
  21. }
  22. }
  23. return encodeResponse(methodReturnType, object, false, flags, serializationPolicy);
  24. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. + serviceIntfName + "', which is not implemented by '" + printTypeName(type)
  2. + "'; this is either misconfiguration or a hack attempt");
  3. + printTypeName(serviceIntf)
  4. + "', which doesn't extend RemoteService; this is either "
  5. + "misconfiguration or a hack attempt");

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. private static String formatIllegalAccessErrorMessage(Object target, Method serviceMethod) {
  2. StringBuffer sb = new StringBuffer();
  3. sb.append("Blocked attempt to access inaccessible method '");
  4. sb.append(getSourceRepresentation(serviceMethod));
  5. sb.append("'");
  6. if (target != null) {
  7. sb.append(" on target '");
  8. sb.append(printTypeName(target.getClass()));
  9. sb.append("'");
  10. }
  11. sb.append("; this is either misconfiguration or a hack attempt");
  12. return sb.toString();
  13. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. private static String formatMethodNotFoundErrorMessage(Class<?> serviceIntf,
  2. String serviceMethodName, Class<?>[] parameterTypes) {
  3. StringBuffer sb = new StringBuffer();
  4. sb.append("Could not locate requested method '");
  5. sb.append(serviceMethodName);
  6. sb.append("(");
  7. for (int i = 0; i < parameterTypes.length; ++i) {
  8. if (i > 0) {
  9. sb.append(", ");
  10. }
  11. sb.append(printTypeName(parameterTypes[i]));
  12. }
  13. sb.append(")'");
  14. sb.append(" in interface '");
  15. sb.append(printTypeName(serviceIntf));
  16. sb.append("'");
  17. return sb.toString();
  18. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. private static String formatIllegalAccessErrorMessage(Object target, Method serviceMethod) {
  2. StringBuffer sb = new StringBuffer();
  3. sb.append("Blocked attempt to access inaccessible method '");
  4. sb.append(getSourceRepresentation(serviceMethod));
  5. sb.append("'");
  6. if (target != null) {
  7. sb.append(" on target '");
  8. sb.append(printTypeName(target.getClass()));
  9. sb.append("'");
  10. }
  11. sb.append("; this is either misconfiguration or a hack attempt");
  12. return sb.toString();
  13. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. private static String formatMethodNotFoundErrorMessage(Class<?> serviceIntf,
  2. String serviceMethodName, Class<?>[] parameterTypes) {
  3. StringBuffer sb = new StringBuffer();
  4. sb.append("Could not locate requested method '");
  5. sb.append(serviceMethodName);
  6. sb.append("(");
  7. for (int i = 0; i < parameterTypes.length; ++i) {
  8. if (i > 0) {
  9. sb.append(", ");
  10. }
  11. sb.append(printTypeName(parameterTypes[i]));
  12. }
  13. sb.append(")'");
  14. sb.append(" in interface '");
  15. sb.append(printTypeName(serviceIntf));
  16. sb.append("'");
  17. return sb.toString();
  18. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. private static String formatIllegalArgumentErrorMessage(Object target, Method serviceMethod,
  2. Object[] args) {
  3. StringBuffer sb = new StringBuffer();
  4. sb.append("Blocked attempt to invoke method '");
  5. sb.append(getSourceRepresentation(serviceMethod));
  6. sb.append("'");
  7. if (target != null) {
  8. sb.append(" on target '");
  9. sb.append(printTypeName(target.getClass()));
  10. sb.append("'");
  11. }
  12. sb.append(" with invalid arguments");
  13. if (args != null && args.length > 0) {
  14. sb.append(Arrays.asList(args));
  15. }
  16. return sb.toString();
  17. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. private static String formatIllegalArgumentErrorMessage(Object target, Method serviceMethod,
  2. Object[] args) {
  3. StringBuffer sb = new StringBuffer();
  4. sb.append("Blocked attempt to invoke method '");
  5. sb.append(getSourceRepresentation(serviceMethod));
  6. sb.append("'");
  7. if (target != null) {
  8. sb.append(" on target '");
  9. sb.append(printTypeName(target.getClass()));
  10. sb.append("'");
  11. }
  12. sb.append(" with invalid arguments");
  13. if (args != null && args.length > 0) {
  14. sb.append(Arrays.asList(args));
  15. }
  16. return sb.toString();
  17. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. return printTypeName(componentType) + "[]";

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. return printTypeName(componentType) + "[]";

代码示例来源:origin: net.wetheinter/gwt-user

  1. public static String encodeResponseForSuccess(Method serviceMethod, Object object,
  2. SerializationPolicy serializationPolicy, int flags) throws SerializationException {
  3. if (serviceMethod == null) {
  4. throw new NullPointerException("serviceMethod cannot be null");
  5. }
  6. if (serializationPolicy == null) {
  7. throw new NullPointerException("serializationPolicy");
  8. }
  9. Class<?> methodReturnType = serviceMethod.getReturnType();
  10. if (methodReturnType != void.class && object != null) {
  11. Class<?> actualReturnType;
  12. if (methodReturnType.isPrimitive()) {
  13. actualReturnType = getPrimitiveClassFromWrapper(object.getClass());
  14. } else {
  15. actualReturnType = object.getClass();
  16. }
  17. if (actualReturnType == null || !methodReturnType.isAssignableFrom(actualReturnType)) {
  18. throw new IllegalArgumentException("Type '" + printTypeName(object.getClass())
  19. + "' does not match the return type in the method's signature: '"
  20. + getSourceRepresentation(serviceMethod) + "'");
  21. }
  22. }
  23. return encodeResponse(methodReturnType, object, false, flags, serializationPolicy);
  24. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. public static String encodeResponseForSuccess(Method serviceMethod, Object object,
  2. SerializationPolicy serializationPolicy, int flags) throws SerializationException {
  3. if (serviceMethod == null) {
  4. throw new NullPointerException("serviceMethod cannot be null");
  5. }
  6. if (serializationPolicy == null) {
  7. throw new NullPointerException("serializationPolicy");
  8. }
  9. Class<?> methodReturnType = serviceMethod.getReturnType();
  10. if (methodReturnType != void.class && object != null) {
  11. Class<?> actualReturnType;
  12. if (methodReturnType.isPrimitive()) {
  13. actualReturnType = getPrimitiveClassFromWrapper(object.getClass());
  14. } else {
  15. actualReturnType = object.getClass();
  16. }
  17. if (actualReturnType == null || !methodReturnType.isAssignableFrom(actualReturnType)) {
  18. throw new IllegalArgumentException("Type '" + printTypeName(object.getClass())
  19. + "' does not match the return type in the method's signature: '"
  20. + getSourceRepresentation(serviceMethod) + "'");
  21. }
  22. }
  23. return encodeResponse(methodReturnType, object, false, flags, serializationPolicy);
  24. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. + serviceIntfName + "', which is not implemented by '" + printTypeName(type)
  2. + "'; this is either misconfiguration or a hack attempt");
  3. + printTypeName(serviceIntf)
  4. + "', which doesn't extend RemoteService; this is either "
  5. + "misconfiguration or a hack attempt");

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. + serviceIntfName + "', which is not implemented by '" + printTypeName(type)
  2. + "'; this is either misconfiguration or a hack attempt");
  3. + printTypeName(serviceIntf)
  4. + "', which doesn't extend RemoteService; this is either "
  5. + "misconfiguration or a hack attempt");

相关文章