| java.lang.Object org.openlaszlo.compiler.Compiler
Compiler | public class Compiler (Code) | | Compiles a Laszlo XML source file, and any files that it
references, into an object file that can be executed on the client.
The compiler parses the file into XML, and then gets an element
compiler for each toplevel element.
|
Method Summary | |
public Canvas | compile(File sourceFile, File objectFile, String url) Compiles sourceFile to objectFile. | public Canvas | compile(File sourceFile, File objectFile, Properties props) Compiles sourceFile to objectFile. | public Canvas | compile(File file, OutputStream ostr, Properties props, CompilationEnvironment env) Compiles file, and write the bytes to
a stream. | public void | compileAndWriteToSWF(String script, String seqnum, OutputStream out, String runtime) | protected static void | compileElement(Element element, CompilationEnvironment env) Compile an XML element within the compilation environment. | ObjectWriter | createObjectWriter(Properties props, OutputStream ostr, CompilationEnvironment env, Element root) | static ElementCompiler | getElementCompiler(Element element, CompilationEnvironment env) | public FileResolver | getFileResolver() | public static String | getObjectFileExtensionForRuntime(String runtime) | public String | getProperty(String key) A Compiler 's Properties stores
properties that affect the compilation. | static void | importLibrary(File file, CompilationEnvironment env) | public CompilationEnvironment | makeCompilationEnvironment() Create a CompilationEnvironment with the properties and
FileResolver of this compiler. | protected void | processClassInstruction(CompilationEnvironment env, String className, ProcessingInstruction pi) | protected void | processCompilerInstruction(CompilationEnvironment env, ProcessingInstruction pi) | protected void | processCompilerInstructions(Element element, CompilationEnvironment env) | public void | setFileResolver(FileResolver resolver) Sets the file resolver for this compiler. | public void | setMediaCache(CompilerMediaCache cache) Sets the media cache for this compiler. | public void | setProperty(String key, String value) | static void | updateRootSchema(Element root, CompilationEnvironment env, ViewSchema schema, Set externalLibraries) | static void | updateSchema(Element element, CompilationEnvironment env, ViewSchema schema, Set visited) | static void | updateSchemaFromLibrary(File file, CompilationEnvironment env, ViewSchema schema, Set visited) |
KNOWN_RUNTIMES | public static List KNOWN_RUNTIMES(Code) | | |
SCRIPT_RUNTIMES | public static List SCRIPT_RUNTIMES(Code) | | |
SchemaLogger | public static Logger SchemaLogger(Code) | | Set this to log the modified schema.
|
mFileResolver | protected FileResolver mFileResolver(Code) | | Called to resolve file references (src
attributes).
|
compile | public Canvas compile(File sourceFile, File objectFile, String url) throws CompilationError, IOException(Code) | | Compiles sourceFile to objectFile. If
compilation fails, objectFile is deleted.
Parameters: sourceFile - source File Parameters: objectFile - a File to place object code in Parameters: url - request url, ignore if null throws: CompilationError - if an error occurs throws: IOException - if an error occurs |
compile | public Canvas compile(File sourceFile, File objectFile, Properties props) throws CompilationError, IOException(Code) | | Compiles sourceFile to objectFile. If
compilation fails, objectFile is deleted.
Parameters: sourceFile - source File Parameters: objectFile - a File to place object code in Parameters: props - parameters for the compile throws: CompilationError - if an error occurs throws: IOException - if an error occursThe PROPS parameters for the compile may include- url, optional, ignore if null
- debug := "true" | "false" include debugger
- logdebug := "true" | "false" makes debug.write() calls get logged to server
|
compileElement | protected static void compileElement(Element element, CompilationEnvironment env) throws CompilationError(Code) | | Compile an XML element within the compilation environment.
Helper function for compile.
Parameters: element - an Element value Parameters: env - a CompilationEnvironment value exception: CompilationError - if an error occurs |
getObjectFileExtensionForRuntime | public static String getObjectFileExtensionForRuntime(String runtime)(Code) | | |
getProperty | public String getProperty(String key)(Code) | | A Compiler 's Properties stores
properties that affect the compilation.
Name=default | Meaning |
trace.xml=false | Display XML that's compiled to
script, and the script that it compiles to. |
debug=true | Add in debug features to the output. |
trace.fonts=false | Additional font traces. |
swf.frame.rate=30 | Output SWF frame rate. |
default.text.height=12 | Default text height for
fonts. |
text.borders=false | Display text borders in the output SWF
for debugging. |
Properties that one part of the compiler sets for another part to read:
Name=default | Meaning |
lzc_* | Source location values. |
a Properties value |
makeCompilationEnvironment | public CompilationEnvironment makeCompilationEnvironment()(Code) | | Create a CompilationEnvironment with the properties and
FileResolver of this compiler.
|
setFileResolver | public void setFileResolver(FileResolver resolver)(Code) | | Sets the file resolver for this compiler. The file resolver
is used to resolve the names used in include directives to
files.
Parameters: resolver - a FileResolver |
setMediaCache | public void setMediaCache(CompilerMediaCache cache)(Code) | | Sets the media cache for this compiler.
Parameters: cache - a CompilerMediaCache |
|
|