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

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

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

JPackage.getName介绍

暂无

代码示例

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

public ReflectionCacheSourceCreator (TreeLogger logger, GeneratorContext context, JClassType type) {
  this.logger = logger;
  this.context = context;
  this.type = type;
  this.packageName = type.getPackage().getName();
  this.simpleName = type.getSimpleSourceName() + "Generated";
  logger.log(Type.INFO, type.getQualifiedSourceName());
}

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

public ReflectionCacheSourceCreator (TreeLogger logger, GeneratorContext context, JClassType type) {
  this.logger = logger;
  this.context = context;
  this.type = type;
  this.packageName = type.getPackage().getName();
  this.simpleName = type.getSimpleSourceName() + "Generated";
  logger.log(Type.INFO, type.getQualifiedSourceName());
}

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

private void createProxy (JClassType type) {
  ClassSourceFileComposerFactory composer = new ClassSourceFileComposerFactory(type.getPackage().getName(),
    type.getSimpleSourceName() + "Proxy");
  PrintWriter printWriter = context.tryCreate(logger, packageName, simpleName);
  if (printWriter == null) {
    return;
  }
  SourceWriter writer = composer.createSourceWriter(context, printWriter);
  writer.commit(logger);
}

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

private void createProxy (JClassType type) {
  ClassSourceFileComposerFactory composer = new ClassSourceFileComposerFactory(type.getPackage().getName(),
    type.getSimpleSourceName() + "Proxy");
  PrintWriter printWriter = context.tryCreate(logger, packageName, simpleName);
  if (printWriter == null) {
    return;
  }
  SourceWriter writer = composer.createSourceWriter(context, printWriter);
  writer.commit(logger);
}

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

/**
 * Converts a package relative path into an absolute path.
 *
 * @param pkg the package
 * @param path a path relative to the package
 * @return an absolute path
 */
private static String getPathRelativeToPackage(JPackage pkg, String path) {
 return pkg.getName().replace('.', '/') + '/' + path;
}

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

String path = method.getEnclosingType().getPackage().getName().replace('.', '/') + '/';
URL preferredUrl = ResourceGeneratorUtil
  .tryFindResource(logger, context.getGeneratorContext(), context, path + preferredFile);

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

/**
 * Converts a package relative path into an absolute path.
 *
 * @param pkg the package
 * @param path a path relative to the package
 * @return an absolute path
 */
private static String getPathRelativeToPackage(JPackage pkg, String path) {
 return pkg.getName().replace('.', '/') + '/' + path;
}

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

@Override
 public String getPackageName() {
  return delegate.getEnclosingType().getPackage().getName();
 }
}

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

private PrintWriter getPrintWriter(TreeLogger logger, GeneratorContext ctx, String targetQualifiedName) {
    String packageName = this.binderType.getPackage().getName();
    String className = this.binderProxySimpleName;
    return ctx.tryCreate(logger, packageName, className);
  }
}

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

public String[] generateClassName(JType t) {
 String[] ret = new String[3];
 JClassType c = t.isClassOrInterface();
 ret[0] = c.getPackage().getName();
 ret[1] = c.getName().replace('.', '_') + "_XmlBuilder";
 ret[2] = ret[0] + "." + ret[1];
 return ret;
}

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

private void writePackage(IndentedWriter w) {
 String packageName = baseClass.getPackage().getName();
 if (packageName.length() > 0) {
  w.write("package %1$s;", packageName);
  w.newline();
 }
}

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

public void setPeerType(JClassType type) {
  assert type.isParameterized() == null && type.isRawType() == null;
  toReturn.peerType = type;
  String packageName = type.getPackage().getName();
  if (packageName.startsWith("java")) {
   packageName = "emul." + packageName;
  }
  toReturn.packageName = packageName;
  beanSimpleSourceName = type.getName().replace('.', '_') + "AutoBean";
 }
}

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

public void setPeerType(JClassType type) {
  assert type.isParameterized() == null && type.isRawType() == null;
  toReturn.peerType = type;
  String packageName = type.getPackage().getName();
  if (packageName.startsWith("java")) {
   packageName = "emul." + packageName;
  }
  toReturn.packageName = packageName;
  beanSimpleSourceName = type.getName().replace('.', '_') + "AutoBean";
 }
}

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

@Override
public String getPackageName() {
 if (_packageName != null) {
  return _packageName;
 }
 _packageName = getEnclosedMetaObject().isClassOrInterface().getPackage().getName();
 return _packageName;
}

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

@Override
public String getPackageName() {
 if (_packageName != null) {
  return _packageName;
 }
 _packageName = getEnclosedMetaObject().isClassOrInterface().getPackage().getName();
 return _packageName;
}

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

private boolean checkAlreadyGenerated(TypeOracle typeOracle, JClassType serviceAsync) {
 JPackage serviceIntfPkg = serviceAsync.getPackage();
 String packageName = serviceIntfPkg == null ? "" : serviceIntfPkg.getName();
 return typeOracle.findType(packageName, getProxySimpleName()) != null;
}

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

public String[] generateClassName(JType t) {
 String[] ret = new String[4];
 JClassType c = t.isClassOrInterface();
 ret[0] = c.getPackage().getName();
 ret[1] = c.getName().replace('.', '_') + "_JsonBuilder";
 ret[2] = ret[0] + "." + ret[1];
 ret[3] = classNameToJsonName(c.getName());
 return ret;
}

代码示例来源:origin: junkdog/artemis-odb

public ReflectionCacheSourceCreator (TreeLogger logger, GeneratorContext context, JClassType type) {
  this.logger = logger;
  this.context = context;
  this.type = type;
  this.packageName = type.getPackage().getName();
  this.simpleName = type.getSimpleSourceName() + "Generated";
  logger.log(Type.INFO, type.getQualifiedSourceName());
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-gwt

public ReflectionCacheSourceCreator (TreeLogger logger, GeneratorContext context, JClassType type) {
  this.logger = logger;
  this.context = context;
  this.type = type;
  this.packageName = type.getPackage().getName();
  this.simpleName = type.getSimpleSourceName() + "Generated";
  logger.log(Type.INFO, type.getQualifiedSourceName());
}

代码示例来源:origin: junkdog/artemis-odb

private void createProxy (JClassType type) {
  ClassSourceFileComposerFactory composer = new ClassSourceFileComposerFactory(type.getPackage().getName(),
    type.getSimpleSourceName() + "Proxy");
  PrintWriter printWriter = context.tryCreate(logger, packageName, simpleName);
  if (printWriter == null) {
    return;
  }
  SourceWriter writer = composer.createSourceWriter(context, printWriter);
  writer.commit(logger);
}

相关文章