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