本文整理汇总了Java中org.teavm.backend.javascript.rendering.RenderingManager类的典型用法代码示例。如果您正苦于以下问题:Java RenderingManager类的具体用法?Java RenderingManager怎么用?Java RenderingManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RenderingManager类属于org.teavm.backend.javascript.rendering包,在下文中一共展示了RenderingManager类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: begin
import org.teavm.backend.javascript.rendering.RenderingManager; //导入依赖的package包/类
@Override
public void begin(RenderingManager context, BuildTarget buildTarget) throws IOException {
SourceWriter writer = context.getWriter();
String url = System.getProperty("rest.service.url");
writer.append("var $test_url = \"")
.append(RenderingUtil.escapeString(url != null ? url : ""))
.append("\";")
.newLine();
}
示例2: begin
import org.teavm.backend.javascript.rendering.RenderingManager; //导入依赖的package包/类
@Override
public void begin(RenderingManager manager, BuildTarget buildTarget) throws IOException {
StringWriter writer = new StringWriter();
resourceToWriter("org/teavm/backend/javascript/runtime.js", writer);
writer.close();
manager.getWriter().append(writer.toString()).newLine();
}
示例3: begin
import org.teavm.backend.javascript.rendering.RenderingManager; //导入依赖的package包/类
@Override
public void begin(RenderingManager manager, BuildTarget buildTarget) throws IOException {
boolean hasOneResource = false;
for (String className : manager.getClassSource().getClassNames()) {
ClassReader cls = manager.getClassSource().get(className);
AnnotationReader annot = cls.getAnnotations().get(JavaScriptResource.class.getName());
if (annot == null) {
continue;
}
String path = annot.getValue("value").getString();
String packageName = className.substring(0, className.lastIndexOf('.'));
String resourceName = packageName.replace('.', '/') + "/" + path;
try (InputStream input = manager.getClassLoader().getResourceAsStream(resourceName)) {
if (input == null) {
throw new RenderingException("Error processing JavaScriptResource annotation on class "
+ className + ". Resource not found: " + resourceName);
}
StringWriter writer = new StringWriter();
IOUtils.copy(input, writer);
writer.close();
manager.getWriter().append("// Resource " + path + " included by " + className).newLine();
manager.getWriter().append(writer.toString()).newLine().newLine();
}
hasOneResource = true;
}
if (hasOneResource) {
manager.getWriter().append("// TeaVM generated classes").newLine();
}
}
示例4: begin
import org.teavm.backend.javascript.rendering.RenderingManager; //导入依赖的package包/类
@Override
public void begin(RenderingManager context, BuildTarget buildTarget) throws IOException {
this.context = context;
}
示例5: begin
import org.teavm.backend.javascript.rendering.RenderingManager; //导入依赖的package包/类
@Override
public void begin(RenderingManager context, BuildTarget buildTarget) throws IOException {
writer = context.getWriter();
classSource = context.getClassSource();
}
示例6: begin
import org.teavm.backend.javascript.rendering.RenderingManager; //导入依赖的package包/类
@Override
public void begin(RenderingManager context, BuildTarget buildTarget) throws IOException {
classSource = context.getClassSource();
writer = context.getWriter();
}
示例7: begin
import org.teavm.backend.javascript.rendering.RenderingManager; //导入依赖的package包/类
@Override
public void begin(RenderingManager manager, BuildTarget buildTarget) throws IOException {
}
示例8: begin
import org.teavm.backend.javascript.rendering.RenderingManager; //导入依赖的package包/类
void begin(RenderingManager context, BuildTarget buildTarget) throws IOException;