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


Java TreeLogger.branch方法代码示例

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


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

示例1: getTestCases

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
public static List<TestCase> getTestCases(TreeLogger logger, GeneratorContext context)
        throws UnableToCompleteException {
    if (DEBUG) logger = logger.branch(TreeLogger.WARN, "Getting test cases", null, null);
    TypeOracle oracle = context.getTypeOracle();
    JClassType jsTestCaseClass = oracle.findType(JsTestCase.class.getName());

    List<TestCase> testCases = new ArrayList<TestCase>();

    for (JClassType classType : oracle.getTypes()) {
        if (classType.equals(jsTestCaseClass) || !classType.isAssignableTo(jsTestCaseClass)) {
            continue;
        }

        if (classType.getEnclosingType() != null) {
            if (DEBUG) logger.log(TreeLogger.WARN, "Skipping nested class: " +
                    classType.getEnclosingType().getName() + "." + classType.getName());
            continue;
        }

        if (DEBUG) logger.log(TreeLogger.WARN, "Found class: " + classType.getName());
        testCases.add(new TestCase(classType, findTests(logger, context, classType)));
    }
    return testCases;
}
 
开发者ID:chromium,项目名称:dom-distiller,代码行数:25,代码来源:JsTestEntryGenerator.java

示例2: findTests

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
public static List<JMethod> findTests(
        TreeLogger logger, GeneratorContext context, JClassType classType)
        throws UnableToCompleteException {
    if (DEBUG) logger = logger.branch(TreeLogger.WARN,
            "Finding tests for class: " + classType.getName());

    List<JMethod> tests = new ArrayList<JMethod>();
    for (JMethod method : classType.getMethods()) {
        if (method.getName().startsWith("test")) {
            if (DEBUG) logger.log(TreeLogger.WARN, "Found test: " + method.getName());
            verifyTestSignature(logger, classType, method);
            tests.add(method);
        }
    }
    return tests;
}
 
开发者ID:chromium,项目名称:dom-distiller,代码行数:17,代码来源:JsTestEntryGenerator.java

示例3: doEmitCompilation

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
@Override
protected Collection<Artifact<?>> doEmitCompilation(TreeLogger logger,
    LinkerContext context, CompilationResult result, ArtifactSet artifacts)
    throws UnableToCompleteException {

  String[] js = result.getJavaScript();
  if (js.length != 1) {
    logger.branch(TreeLogger.ERROR, getMultiFragmentWarningMessage(), null);
    throw new UnableToCompleteException();
  }

  Collection<Artifact<?>> toReturn = new ArrayList<Artifact<?>>();
  toReturn.add(new Script(result.getStrongName(), js[0]));
  toReturn.addAll(emitSelectionInformation(result.getStrongName(), result));
  return toReturn;
}
 
开发者ID:metteo,项目名称:gwt-worker,代码行数:17,代码来源:SingleScriptLinker.java

示例4: logPermutationProperties

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
/**
 * Output the deferred binding properties to the logger to help the user of
 * this linker determine what is causing multiple compilation permutations.
 * 
 * @param logger
 *            the TreeLogger to record to
 * @param properties
 *            The deferred binding properties
 */
protected void logPermutationProperties(TreeLogger logger,
		SortedSet<SelectionProperty> properties) {
	TreeLogger branch = logger.branch(TreeLogger.INFO,
			"Deferred binding properties of current " + "module:");

	for (SelectionProperty property : properties) {
		String name = property.getName();
		String value = property.tryGetValue();
		String prefix = null;
		if (value == null) {
			value = "?";
			if (property.isDerived()) {
				prefix = " ! ";
			} else {
				prefix = "!! ";
			}
		} else {
			prefix = "   ";
		}

		branch.log(TreeLogger.INFO, prefix + name + "=" + value);
	}
}
 
开发者ID:metteo,项目名称:gwt-worker,代码行数:33,代码来源:SingleScriptWorkerLinker.java

示例5: emitSelectionScript

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
@Override
protected EmittedArtifact emitSelectionScript(TreeLogger logger,
    LinkerContext context, ArtifactSet artifacts)
    throws UnableToCompleteException {
    logger = logger.branch(TreeLogger.DEBUG, "Building gadget manifest",
            null);

    String bootstrap = "<script>" +
        context.optimizeJavaScript(logger,
            generateSelectionScript(logger, context, artifacts)) +
        "</script>\n" + "<div id=\"__gwt_gadget_content_div\"></div>";

    // Read the content
    StringBuffer manifest = new StringBuffer();

    try {
        BufferedReader in = new BufferedReader(new InputStreamReader(
                    manifestArtifact.getContents(logger)));

        for (String line = in.readLine(); line != null;
                line = in.readLine()) {
            manifest.append(line).append("\n");
        }

        in.close();
    } catch (IOException e) {
        logger.log(TreeLogger.ERROR, "Unable to read manifest stub", e);
        throw new UnableToCompleteException();
    }

    replaceAll(manifest, "__BOOTSTRAP__", bootstrap);

    return emitString(logger, manifest.toString(),
        manifestArtifact.getPartialPath());
}
 
开发者ID:kebernet,项目名称:shortyz,代码行数:36,代码来源:GadgetLinker.java

示例6: generateIncrementally

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
@Override
public RebindResult generateIncrementally(TreeLogger logger,
                                          GeneratorContext generatorContext,
                                          String typeName)
  throws UnableToCompleteException {

  TypeOracle typeOracle = generatorContext.getTypeOracle();
  assert (typeOracle != null);

  JClassType originalType = typeOracle.findType(typeName);
  if (originalType == null) {
    logger.log(TreeLogger.ERROR,
               "Unable to find metadata for type '" + typeName + "'");
    throw new UnableToCompleteException();
  }

  if (originalType.isInterface() == null) {
    logger.log(TreeLogger.ERROR,
               "'" + typeName + "' is not a interface");
    throw new UnableToCompleteException();
  }

  TreeLogger moduleLogger = logger.branch(TreeLogger.DEBUG,
                                          "Generating client proxy for remote service interface '" + originalType.getQualifiedSourceName() + "'",
                                          null);

  return create(originalType,
                moduleLogger,
                generatorContext,
                typeName);
}
 
开发者ID:mvp4g,项目名称:mvp4g,代码行数:32,代码来源:Mvp4gRunAsyncGenerator.java

示例7: generateIncrementally

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
@Override
public RebindResult generateIncrementally(TreeLogger logger,
                                          GeneratorContext generatorContext,
                                          String moduleClass)
  throws UnableToCompleteException {

  TypeOracle typeOracle = generatorContext.getTypeOracle();
  assert (typeOracle != null);

  JClassType module = typeOracle.findType(moduleClass);
  if (module == null) {
    logger.log(TreeLogger.ERROR,
               "Unable to find metadata for module class '" + moduleClass + "'");
    throw new UnableToCompleteException();
  }

  if (module.isInterface() == null) {
    logger.log(TreeLogger.ERROR,
               "'" + moduleClass + "' is not a interface");
    throw new UnableToCompleteException();
  }

  TreeLogger moduleLogger = logger.branch(TreeLogger.DEBUG,
                                          "Generating mvp4g configuration for module class '" + module.getQualifiedSourceName() + "'",
                                          null);

  return create(moduleLogger,
                generatorContext,
                moduleClass);
}
 
开发者ID:mvp4g,项目名称:mvp4g,代码行数:31,代码来源:Mvp4gGenerator.java


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