当前位置: 首页>>代码示例>>Java>>正文


Java ErrorManager.logError方法代码示例

本文整理汇总了Java中com.google.gwt.inject.rebind.ErrorManager.logError方法的典型用法代码示例。如果您正苦于以下问题:Java ErrorManager.logError方法的具体用法?Java ErrorManager.logError怎么用?Java ErrorManager.logError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.inject.rebind.ErrorManager的用法示例。


在下文中一共展示了ErrorManager.logError方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ProviderMethodBinding

import com.google.gwt.inject.rebind.ErrorManager; //导入方法依赖的package包/类
ProviderMethodBinding(ErrorManager errorManager, GuiceUtil guiceUtil,
    MethodCallUtil methodCallUtil, ProviderMethod<?> providerMethod, Context context) {
  super(context, TypeLiteral.get(providerMethod.getMethod().getDeclaringClass()));

  this.guiceUtil = guiceUtil;

  this.methodCallUtil = methodCallUtil;
  this.moduleType = providerMethod.getInstance().getClass();
  Method method = providerMethod.getMethod();
  this.providerMethod = MethodLiteral.get(method, TypeLiteral.get(method.getDeclaringClass()));
  this.targetKey = providerMethod.getKey();

  if (!ReflectUtil.hasAccessibleDefaultConstructor(method.getDeclaringClass())) {
    errorManager.logError(
        "Cannot invoke a @Provides method on a module without a default constructor.  "
            + "Gin must be able to create the module at runtime in order to invoke an instance "
            + "method.  Method name: %s",
        method);
  }
}
 
开发者ID:google-code-export,项目名称:google-gin,代码行数:21,代码来源:ProviderMethodBinding.java

示例2: GinjectorFragmentOutputter

import com.google.gwt.inject.rebind.ErrorManager; //导入方法依赖的package包/类
@Inject
GinjectorFragmentOutputter(GeneratorContext ctx, GinjectorFragmentContext.Factory ginjectorFragmentContextFactory, ErrorManager errorManager,
                           TreeLogger logger, SourceWriteUtil.Factory sourceWriteUtilFactory, @Assisted GinjectorBindings bindings,
                           @Assisted FragmentPackageName fragmentPackageName, @Assisted("ginjectorPackageName") String ginjectorPackageName,
                           @Assisted("ginjectorClassName") String ginjectorClassName) {

    this.ctx = ctx;
    this.errorManager = errorManager;
    this.logger = logger;
    this.sourceWriteUtil = sourceWriteUtilFactory.create(bindings);

    this.fragmentPackageName = fragmentPackageName;
    this.ginjectorClassName = ginjectorClassName;
    this.nameGenerator = bindings.getNameGenerator();

    fragmentClassName = nameGenerator.getFragmentClassName(ginjectorClassName, fragmentPackageName);
    if (fragmentClassName.contains(".")) {
        errorManager.logError("Internal error: the fragment class name \"%s\" contains a full stop.", fragmentClassName);
    }

    PrintWriter printWriter = ctx.tryCreate(logger, fragmentPackageName.toString(), fragmentClassName);
    if (printWriter == null) {
        // Something is very wrong! We already created this fragment, but the
        // GinjectorBindingsOutputter should only create each fragment once.
        // Something bad will probably happen later on if we continue, so just
        // abort.
        logger.log(TreeLogger.Type.ERROR, "The fragment " + fragmentPackageName + "." + fragmentClassName + " already exists.");
        throw new IllegalStateException("The fragment " + fragmentClassName + " already exists.");
    }

    ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(fragmentPackageName.toString(), fragmentClassName);

    composerFactory.addImport(GWT.class.getCanonicalName());
    composerFactory.addImport(ginjectorPackageName + "." + ginjectorClassName);
    writer = composerFactory.createSourceWriter(ctx, printWriter);

    injectorWriteContext = ginjectorFragmentContextFactory.create(bindings, fragmentPackageName, writer);
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:39,代码来源:GinjectorFragmentOutputter.java

示例3: GinjectorFragmentOutputter

import com.google.gwt.inject.rebind.ErrorManager; //导入方法依赖的package包/类
@Inject
GinjectorFragmentOutputter(
    GeneratorContext ctx,
    GinjectorFragmentContext.Factory ginjectorFragmentContextFactory,
    ErrorManager errorManager,
    TreeLogger logger,
    SourceWriteUtil.Factory sourceWriteUtilFactory,
    @Assisted GinjectorBindings bindings,
    @Assisted FragmentPackageName fragmentPackageName,
    @Assisted("ginjectorPackageName") String ginjectorPackageName,
    @Assisted("ginjectorClassName") String ginjectorClassName) {

  this.ctx = ctx;
  this.errorManager = errorManager;
  this.logger = logger;
  this.sourceWriteUtil = sourceWriteUtilFactory.create(bindings);

  this.fragmentPackageName = fragmentPackageName;
  this.ginjectorClassName = ginjectorClassName;
  this.nameGenerator = bindings.getNameGenerator();

  fragmentClassName = nameGenerator.getFragmentClassName(ginjectorClassName, fragmentPackageName);
  if (fragmentClassName.contains(".")) {
    errorManager.logError("Internal error: the fragment class name \"%s\" contains a full stop.",
        fragmentClassName);
  }

  PrintWriter printWriter =
      ctx.tryCreate(logger, fragmentPackageName.toString(), fragmentClassName);
  if (printWriter == null) {
    // Something is very wrong!  We already created this fragment, but the
    // GinjectorBindingsOutputter should only create each fragment once.
    // Something bad will probably happen later on if we continue, so just
    // abort.
    logger.log(TreeLogger.Type.ERROR, "The fragment " + fragmentPackageName + "." +
        fragmentClassName + " already exists.");
    throw new IllegalStateException("The fragment " + fragmentClassName + " already exists.");
  }

  ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(
      fragmentPackageName.toString(), fragmentClassName);

  composerFactory.addImport(GWT.class.getCanonicalName());
  composerFactory.addImport(ginjectorPackageName + "." + ginjectorClassName);
  writer = composerFactory.createSourceWriter(ctx, printWriter);

  injectorWriteContext = ginjectorFragmentContextFactory.create(bindings, fragmentPackageName,
      writer);
}
 
开发者ID:google-code-export,项目名称:google-gin,代码行数:50,代码来源:GinjectorFragmentOutputter.java


注:本文中的com.google.gwt.inject.rebind.ErrorManager.logError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。