com.google.gwt.core.ext.typeinfo.JType.getQualifiedBinaryName()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(97)

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

JType.getQualifiedBinaryName介绍

暂无

代码示例

代码示例来源:origin: net.wetheinter/xapi-components

private String simpleName(final JType type) {
 String binary = type.getQualifiedBinaryName();
 final int last = binary.lastIndexOf('.');
 if (last != -1) {
  binary = binary.substring(last + 1);
 }
 return binary.replace('$', '.');
}

代码示例来源:origin: resty-gwt/resty-gwt

private static boolean isVoidMethod(JMethod method) {
  return VOID_QUALIFIED_NAME.equals(method.getReturnType().getQualifiedBinaryName());
}

代码示例来源:origin: org.fusesource.restygwt/restygwt

private static boolean isVoidMethod(JMethod method) {
  return VOID_QUALIFIED_NAME.equals(method.getReturnType().getQualifiedBinaryName());
}

代码示例来源:origin: com.ebmwebsourcing.geasytools/model-manager

public static Class<?> getClass(JType type){
  if (type.isPrimitive()==null){
    try {
      return Class.forName(type.getQualifiedBinaryName());
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    }
  }else{
    
    try {
      return Class.forName(type.isPrimitive().getQualifiedBoxedSourceName());
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    }
    
  }
  
  return null;
}

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

/**
 * Given a JType, return the binary name of the class that is most proximately
 * assignable to the type. This method will resolve type parameters as well as
 * wildcard types.
 */
public static String getQualifiedBaseBinaryName(JType type) {
 return ensureBaseType(type).getErasedType().getQualifiedBinaryName();
}

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

/**
 * Given a JType, return the binary name of the class that is most proximately
 * assignable to the type. This method will resolve type parameters as well as
 * wildcard types.
 */
public static String getQualifiedBaseBinaryName(JType type) {
 return ensureBaseType(type).getErasedType().getQualifiedBinaryName();
}

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

private static boolean isJUnitTestMethod(JMethod m) {
  return m.isPublic() && m.getName().startsWith("test") && m.getParameters().length == 0
    && m.getReturnType().getQualifiedBinaryName().equals(Void.TYPE.getName());
 }
}

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

private static boolean isJUnitTestMethod(JMethod m) {
  return m.isPublic() && m.getName().startsWith("test") && m.getParameters().length == 0
    && m.getReturnType().getQualifiedBinaryName().equals(Void.TYPE.getName());
 }
}

代码示例来源:origin: fr.putnami.pwt/pwt

public InjectServiceCreator(JType viewType, JField serviceField) {
  this.viewType = viewType;
  this.serviceField = serviceField;
  this.serviceName = serviceField.getType().getQualifiedSourceName();
  Class fieldClass;
  try {
    fieldClass = this.getClass().getClassLoader().loadClass(serviceField.getType().getQualifiedBinaryName());
    if (ServiceProxy.class.isAssignableFrom(fieldClass)) {
      this.declareProxy = false;
      this.proxyTypeName = serviceField.getType().getQualifiedSourceName();
    } else {
      this.proxyTypeName = "_" + serviceField.getName() + "ServiceProxy";
    }
  } catch (ClassNotFoundException e) {
    throw new RuntimeException(e.getMessage(), e);
  }
}

代码示例来源:origin: Putnami/putnami-web-toolkit

public InjectServiceCreator(JType viewType, JField serviceField) {
  this.viewType = viewType;
  this.serviceField = serviceField;
  this.serviceName = serviceField.getType().getQualifiedSourceName();
  Class fieldClass;
  try {
    fieldClass = this.getClass().getClassLoader().loadClass(serviceField.getType().getQualifiedBinaryName());
    if (ServiceProxy.class.isAssignableFrom(fieldClass)) {
      this.declareProxy = false;
      this.proxyTypeName = serviceField.getType().getQualifiedSourceName();
    } else {
      this.proxyTypeName = "_" + serviceField.getName() + "ServiceProxy";
    }
  } catch (ClassNotFoundException e) {
    throw new RuntimeException(e.getMessage(), e);
  }
}

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

public static JConstructor findConstructor(TreeLogger logger,
  JClassType type, List<String> params, boolean declared) {
 loop:
  for (JConstructor ctor : type.getConstructors()) {
    JType[] types = ctor.getParameterTypes();
    if (types.length == params.size()) {
     for (int i = 0, m = types.length; i < m; i++ ) {
      String typeName = types[i].getErasedType().getQualifiedBinaryName();
      while (typeName.startsWith("[")) {
       typeName = typeName.substring(1)+"[]";
      }
      if (!params.get(i).equals(typeName)) {
       logger.log(Type.DEBUG, "constructor with different signature; "
         +"("+params+") mismatches at index "+i+" with value "+typeName); 
       continue loop;
      }
     }
     return ctor;
    }
   }
   return declared || type.getSuperclass() == null ? null: findConstructor(logger, type.getSuperclass(), params, declared);
}

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

public static JConstructor findConstructor(final TreeLogger logger,
  final JClassType type, final List<String> params, final boolean declared) {
 loop:
  for (final JConstructor ctor : type.getConstructors()) {
    final JType[] types = ctor.getParameterTypes();
    if (types.length == params.size()) {
     for (int i = 0, m = types.length; i < m; i++ ) {
      String typeName = types[i].getErasedType().getQualifiedBinaryName();
      while (typeName.startsWith("[")) {
       typeName = typeName.substring(1)+"[]";
      }
      if (!params.get(i).equals(typeName)) {
       logger.log(Type.DEBUG, "constructor with different signature; "
         +"("+params+") mismatches at index "+i+" with value "+typeName);
       continue loop;
      }
     }
     return ctor;
    }
   }
   return declared || type.getSuperclass() == null ? null: findConstructor(logger, type.getSuperclass(), params, declared);
}

代码示例来源:origin: errai/errai

@Override
public String getFullyQualifiedName() {
 if (fqcn != null)  {
  return fqcn;
 }
 if (isArray()) {
  if (getOuterComponentType().isPrimitive()) {
   fqcn = getInternalName();
  }
  else {
   fqcn = getInternalName().replace('/', '.');
  }
 }
 else {
  fqcn = getEnclosedMetaObject().getQualifiedBinaryName();
 }
 return fqcn;
}

代码示例来源:origin: org.jboss.errai/errai-codegen-gwt

@Override
public String getFullyQualifiedName() {
 if (fqcn != null)  {
  return fqcn;
 }
 if (isArray()) {
  if (getOuterComponentType().isPrimitive()) {
   fqcn = getInternalName();
  }
  else {
   fqcn = getInternalName().replace('/', '.');
  }
 }
 else {
  fqcn = getEnclosedMetaObject().getQualifiedBinaryName();
 }
 return fqcn;
}

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

if (types.length == params.size()) {
 for (int i = 0, m = types.length; i < m; i++ ) {
  String typeName = types[i].getErasedType().getQualifiedBinaryName();
  while (typeName.startsWith("[")) {
   typeName = typeName.substring(1)+"[]";

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

if (types.length == params.size()) {
 for (int i = 0, m = types.length; i < m; i++ ) {
  String typeName = types[i].getErasedType().getQualifiedBinaryName();
  while (typeName.startsWith("[")) {
   typeName = typeName.substring(1)+"[]";

代码示例来源:origin: resty-gwt/resty-gwt

protected String toFormStringExpression(JParameter argument, Style classStyle) throws UnableToCompleteException {
  JType type = argument.getType();
  String expr = argument.getName();
  if (type.isPrimitive() != null) {
    return "\"\"+" + expr;
  }
  if (STRING_TYPE == type) {
    return expr;
  }
  if (type.isClass() != null && isOverlayArrayType(type.isClass())) {
    return "(new " + JSON_ARRAY_CLASS + "(" + expr + ")).toString()";
  }
  if (type.isClass() != null && OVERLAY_VALUE_TYPE.isAssignableFrom(type.isClass())) {
    return "(new " + JSON_OBJECT_CLASS + "(" + expr + ")).toString()";
  }
  if ((!isThrowable(type) && type.getQualifiedBinaryName().startsWith("java.lang.")) || type.isEnum() != null) {
    return String.format("(%s != null ? %s.toString() : null)", expr, expr);
  }
  Json jsonAnnotation = getAnnotation(argument, Json.class);
  Style style = jsonAnnotation != null ? jsonAnnotation.style() : classStyle;
  return locator.encodeExpression(type, expr, style) + ".toString()";
}

代码示例来源:origin: org.fusesource.restygwt/restygwt

protected String toFormStringExpression(JParameter argument, Style classStyle) throws UnableToCompleteException {
  JType type = argument.getType();
  String expr = argument.getName();
  if (type.isPrimitive() != null) {
    return "\"\"+" + expr;
  }
  if (STRING_TYPE == type) {
    return expr;
  }
  if (type.isClass() != null && isOverlayArrayType(type.isClass())) {
    return "(new " + JSON_ARRAY_CLASS + "(" + expr + ")).toString()";
  }
  if (type.isClass() != null && OVERLAY_VALUE_TYPE.isAssignableFrom(type.isClass())) {
    return "(new " + JSON_OBJECT_CLASS + "(" + expr + ")).toString()";
  }
  if ((!isThrowable(type) && type.getQualifiedBinaryName().startsWith("java.lang.")) || type.isEnum() != null) {
    return String.format("(%s != null ? %s.toString() : null)", expr, expr);
  }
  Json jsonAnnotation = getAnnotation(argument, Json.class);
  Style style = jsonAnnotation != null ? jsonAnnotation.style() : classStyle;
  return locator.encodeExpression(type, expr, style) + ".toString()";
}

相关文章