本文整理汇总了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);
}
}
示例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);
}
示例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);
}