本文整理匯總了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;