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

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

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

JType.getQualifiedSourceName介绍

暂无

代码示例

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

public int compare (JType o1, JType o2) {
    return o1.getQualifiedSourceName().compareTo(o2.getQualifiedSourceName());
  }
});

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

public int compare (JType o1, JType o2) {
    return o1.getQualifiedSourceName().compareTo(o2.getQualifiedSourceName());
  }
});

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

private String getType (JType type) {
  if (!isVisible(type)) return null;
  return type.getErasedType().getQualifiedSourceName() + ".class";
}

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

private String getType (JType type) {
  if (!isVisible(type)) return null;
  return type.getErasedType().getQualifiedSourceName() + ".class";
}

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

private void newArrayC () {
  p("public Object newArray (Type t, int size) {");
  p("    if (t != null) {");
  SwitchedCodeBlock pc = new SwitchedCodeBlock("t.id");
  for (JType type : types) {
    if (type.getQualifiedSourceName().equals("void")) continue;
    if (type.getQualifiedSourceName().endsWith("Void")) continue;
    String arrayType = type.getErasedType().getQualifiedSourceName() + "[size]";
    if (arrayType.contains("[]")) {
      arrayType = type.getErasedType().getQualifiedSourceName();
      arrayType = arrayType.replaceFirst("\\[\\]", "[size]") + "[]";
    }
    pc.add(typeNames2typeIds.get(type.getQualifiedSourceName()), "return new " + arrayType + ";");
  }
  pc.print();
  p("    }");
  p("    throw new RuntimeException(\"Couldn't create array\");");
  p("}");
}

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

private void newArrayC () {
  p("public Object newArray (Type t, int size) {");
  p("    if (t != null) {");
  SwitchedCodeBlock pc = new SwitchedCodeBlock("t.id");
  for (JType type : types) {
    if (type.getQualifiedSourceName().equals("void")) continue;
    if (type.getQualifiedSourceName().endsWith("Void")) continue;
    String arrayType = type.getErasedType().getQualifiedSourceName() + "[size]";
    if (arrayType.contains("[]")) {
      arrayType = type.getErasedType().getQualifiedSourceName();
      arrayType = arrayType.replaceFirst("\\[\\]", "[size]") + "[]";
    }
    pc.add(typeNames2typeIds.get(type.getQualifiedSourceName()), "return new " + arrayType + ";");
  }
  pc.print();
  p("    }");
  p("    throw new RuntimeException(\"Couldn't create array\");");
  p("}");
}

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

if (type.getQualifiedSourceName().contains("-")) {
  nesting--;
  return;
String name = type.getQualifiedSourceName();
try {
  ConfigurationProperty prop;
out(type.getErasedType().getQualifiedSourceName(), nesting);

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

if (type.getQualifiedSourceName().contains("-")) {
  nesting--;
  return;
String name = type.getQualifiedSourceName();
try {
  ConfigurationProperty prop;
out(type.getErasedType().getQualifiedSourceName(), nesting);

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

private String createTypeGenerator (JType t) {
  sb.setLength(0);
  int id = nextTypeId++;
  typeNames2typeIds.put(t.getErasedType().getQualifiedSourceName(), id);
  JClassType c = t.isClass();
  String name = t.getErasedType().getQualifiedSourceName();
  String superClass = null;
  if (c != null && (isVisible(c.getSuperclass())))
    boolean used = false;
    for (JType i : c.getFlattenedSupertypeHierarchy()) {
      if (!isVisible(i) || i.equals(t) || "java.lang.Object".equals(i.getErasedType().getQualifiedSourceName())) continue;
      if (used) assignables += ", ";
      assignables += i.getErasedType().getQualifiedSourceName() + ".class";
      used = true;
      if (!isVisible(i) || i.equals(t)) continue;
      if (used) interfaces += ", ";
      interfaces += i.getErasedType().getQualifiedSourceName() + ".class";
      used = true;

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

private String createTypeGenerator (JType t) {
  sb.setLength(0);
  int id = nextTypeId++;
  typeNames2typeIds.put(t.getErasedType().getQualifiedSourceName(), id);
  JClassType c = t.isClass();
  String name = t.getErasedType().getQualifiedSourceName();
  String superClass = null;
  if (c != null && (isVisible(c.getSuperclass())))
    boolean used = false;
    for (JType i : c.getFlattenedSupertypeHierarchy()) {
      if (!isVisible(i) || i.equals(t) || "java.lang.Object".equals(i.getErasedType().getQualifiedSourceName())) continue;
      if (used) assignables += ", ";
      assignables += i.getErasedType().getQualifiedSourceName() + ".class";
      used = true;
      if (!isVisible(i) || i.equals(t)) continue;
      if (used) interfaces += ", ";
      interfaces += i.getErasedType().getQualifiedSourceName() + ".class";
      used = true;

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

@Override
 public String createAssignment(TreeLogger logger, ResourceContext context,
   JMethod method) throws UnableToCompleteException {
  JClassType gwtType = context.getGeneratorContext().getTypeOracle().findType(
    GWT.class.getName());
  assert gwtType != null;

  return gwtType.getQualifiedSourceName() + ".create("
    + method.getReturnType().getQualifiedSourceName() + ".class)";
 }
}

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

if (referenceType == null) {
 throw new NotFoundException("Cannot resolve member " + pathElement
   + " on type " + currentType.getQualifiedSourceName());
   + pathElement + " in type " + currentType.getQualifiedSourceName());
   + expectedReturnType.getQualifiedSourceName() + " found "
   + currentMethod.getReturnType().getQualifiedSourceName());

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

&& toImplement.getParameters().length == 0) {
 writeDefAssignment(logger, sw, toImplement, sheet);
} else if (toImplement.getReturnType().getQualifiedSourceName()
  .equals("java.lang.String")
  && toImplement.getParameters().length == 0) {

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

String initializer;
if (writer.getDesignTime().isDesignTime()) {
 String typeName = factoryMethod.getReturnType().getQualifiedSourceName();
 initializer = writer.getDesignTime().getProvidedFactory(typeName,
   factoryMethod.getName(),

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

protected String getResourceImplAsString(TreeLogger logger, ResourceContext context,
  JMethod method, Map<JMethod, String> actualReplacements,
  JClassType cssResourceSubtype,
  CssStylesheet stylesheet) throws UnableToCompleteException {
 SourceWriter sw = new StringSourceWriter();
 // Write the expression to create the subtype.
 sw.println("new " + method.getReturnType().getQualifiedSourceName()
   + "() {");
 sw.indent();
 // Methods defined by CssResource interface
 writeEnsureInjected(sw);
 writeGetName(method, sw);
 // Create the Java expression that generates the CSS
 writeGetText(logger, context, method, sw);
 // getOverridableMethods is used to handle CssResources extending
 // non-CssResource types. See the discussion in computeReplacementsForType.
 writeUserMethods(logger, sw, stylesheet,
   cssResourceSubtype.getOverridableMethods(), actualReplacements);
 sw.outdent();
 sw.println("}");
 return sw.toString();
}

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

@Override
public String createAssignment(TreeLogger logger, ResourceContext context, JMethod method)
  throws UnableToCompleteException {
 CssParsingResult cssParsingResult = cssParsingResultMap.get(method);
 CssTree cssTree = cssParsingResult.tree;
 RenamingResult renamingResult = doClassRenaming(cssTree, method, logger, context);
 // TODO : Should we foresee configuration properties for simplifyCss and eliminateDeadCode
 // booleans ?
 ConstantDefinitions constantDefinitions = optimizeTree(cssParsingResult, context, true, true,
   logger);
 checkErrors();
 Set<String> externalClasses = revertRenamingOfExternalClasses(cssTree, renamingResult);
 checkErrors();
 // Validate that classes not assigned to one of the interface methods are external
 validateExternalClasses(externalClasses, renamingResult.externalClassCandidate, method, logger);
 SourceWriter sw = new StringSourceWriter();
 sw.println("new " + method.getReturnType().getQualifiedSourceName() + "() {");
 sw.indent();
 Map<JMethod, String> actualReplacements = writeMethods(logger, context, method, sw, constantDefinitions,
   cssParsingResult.originalConstantNameMapping, renamingResult.mapping);
 sw.outdent();
 sw.println("}");
 CssResourceGenerator.outputCssMapArtifact(logger, context, method, actualReplacements);
 return sw.toString();
}

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

static String noGetterMessage(String propertyName, JType proxyType) {
 return String.format(
   "Could not find a getter for path %s in proxy type %s", propertyName,
   proxyType.getQualifiedSourceName());
}

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

/**
  * Check if the specified parameter type represents a {@link SafeUri}.
  *
  * @param parameterType the Java parameter type
  * @return true if the type represents a {@link SafeUri}
  */
 private boolean isSafeUri(JType parameterType) {
  return parameterType.getQualifiedSourceName().equals(SAFE_URI_FQCN);
 }
}

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

private static String simplify(final com.google.gwt.core.ext.typeinfo.JParameter[] params) {
 final StringBuilder b = new StringBuilder();
 for (final com.google.gwt.core.ext.typeinfo.JParameter param : params) {
  b.append(param.getType().getErasedType().getQualifiedSourceName().charAt(0));
 }
 return b.toString();
}

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

protected <T extends JType> void appendClassArray(final MethodBuffer out,
  final T[] types,
  final ReflectionGeneratorContext ctx) {
 int i = types.length;
 final String[] names = new String[i];
 for (; i-- > 0;) {
  names[i] = types[i].getErasedType().getQualifiedSourceName();
 }
 final ConstPoolGenerator constPool = ctx.getConstPool();
 constPool.arrayOfClasses(ctx.getLogger(), out, names);
}

相关文章