| java.lang.Object org.openlaszlo.compiler.CompilationEnvironment
CompilationEnvironment | public class CompilationEnvironment (Code) | | Encapsulates all the context that script compilation needs to
refer to. Instances of this class are threaded through the calls
to instances of CompilerNode.
Also contains utility functions for compiling to a file.
|
Method Summary | |
public void | addClassFontInfo(String classname, FontInfo info) Add canvas info. | public void | addId(String name, Element e) | public void | addResourceReference(String name, Element elt) | static String | adjustRelativeURL(String string, File sourceDir, File destDir) If the argument is a relative URL with no host, return an URL
that resolves to the same address relative to the destDir as
the argument does relative to sourceDir. | String | adjustRelativeURL(String string, Element elt) If the argument is a relative URL with no host, return an URL
that resolves to the same address relative to the main source
file as the argument does relative to the file that contains
elt. | public void | checkValidChildContainment(Element element) | void | compileScript(String script) Compiles script to bytecodes, and adds them to the
output file. | void | compileScript(String script, Element elt) | public File | getApplicationFile() | boolean | getBooleanProperty(String name) | public Canvas | getCanvas() | public FontInfo | getClassFontInfo(String classname) | public FontInfo | getDefaultFontInfo() | public static synchronized int | getDefaultTextWidth() | public boolean | getEmbedFonts() | public CompilationErrorHandler | getErrorHandler() | FileResolver | getFileResolver() Returns the file resolver used in this environment. | ObjectWriter | getGenerator() Returns the SWF writer that compilation within this
environment writes to. | public Element | getId(String name) | Set | getImportedLibraryFiles() | public String | getLibPrefix() | public String | getLibPrefixRelative() | Map | getLoadableImportedLibraryFiles() | public CompilerMediaCache | getMediaCache() | public File | getObjectFile() | Parser | getParser() | Properties | getProperties() Returns the Properties object used in this environment. | String | getProperty(String name) | String | getProperty(String name, String defval) | ObjectWriter | getResourceGenerator() By pointing at the main SWFWriter, this makes the resources
compile into the main app. | Set | getResourceNames() | public String | getRuntime() | public String | getRuntime(String defaultVersion) | public int | getSWFVersionInt() | public ViewSchema | getSchema() | public boolean | isCanvas() | public boolean | isDHTML() | public boolean | isImportLib() Returns true if we're compiling a loadable library file. | public boolean | isSWF() | File | resolve(String name, String base) | File | resolveLibrary(String name, String base) | File | resolveParentReference(Element element) | File | resolveReference(Element element, String aname) | File | resolveReference(Element element, String aname, boolean asLibrary) Resolve the value of the named attribute, relative to the
source location of the element. | File | resolveReference(Element elt) Resolve the value of the "src" attribute, relative to the
source location of the element. | public Map | resourceReferences() | void | setApplicationFile(File file) | public void | setCanvas(Canvas canvas, String constructorScript) | public void | setDefaultFontInfo(FontInfo fi) | public void | setEmbedFonts(boolean embed) | public void | setImportLib(boolean v) | public void | setMainObjectWriter(ObjectWriter writer) | public void | setMediaCache(CompilerMediaCache cache) | void | setObjectFile(File file) | public void | setObjectWriter(ObjectWriter writer) | void | setProperty(String name, String value) | void | setProperty(String name, boolean value) | public void | setScriptLimits(int recursion, int timeout) | String | uniqueName() | public void | warn(CompilationError e) | public void | warn(Throwable e, Element element) | public void | warn(String msg) | public void | warn(String msg, Element element) | public boolean | warnIfCannotContain(Element parentTag, Element childTag) |
BACKTRACE_PROPERTY | final public static String BACKTRACE_PROPERTY(Code) | | |
CONSOLEDEBUG_PROPERTY | final public static String CONSOLEDEBUG_PROPERTY(Code) | | |
CSSFILE_PROPERTY | final public static String CSSFILE_PROPERTY(Code) | | |
DEBUG_PROPERTY | final public static String DEBUG_PROPERTY(Code) | | |
EMBEDFONTS_PROPERTY | final public static String EMBEDFONTS_PROPERTY(Code) | | |
LOGDEBUG_PROPERTY | final public static String LOGDEBUG_PROPERTY(Code) | | |
PROFILE_PROPERTY | final public static String PROFILE_PROPERTY(Code) | | |
PROXIED_PROPERTY | final public static String PROXIED_PROPERTY(Code) | | |
REMOTEDEBUG_PROPERTY | final public static String REMOTEDEBUG_PROPERTY(Code) | | |
RUNTIME_PROPERTY | final public static String RUNTIME_PROPERTY(Code) | | |
SOURCELOCATOR_PROPERTY | final public static String SOURCELOCATOR_PROPERTY(Code) | | |
USER_DEBUG_WINDOW | final public static String USER_DEBUG_WINDOW(Code) | | |
mApplicationFile | protected File mApplicationFile(Code) | | The root file being compiled. This is used to resolve
relative pathnames.
|
parsedLibraryCache | public HashMap parsedLibraryCache(Code) | | Cache for holding DOM tree from parsing library file
|
CompilationEnvironment | CompilationEnvironment(Properties properties, FileResolver resolver, CompilerMediaCache mcache)(Code) | | Constructs an instance.
Parameters: properties - compilation properties Parameters: resolver - Parameters: mcache - |
CompilationEnvironment | public CompilationEnvironment()(Code) | | Use this constructor for unit testing. The Compiler uses the
constructor that takes a FileResolver.
|
addClassFontInfo | public void addClassFontInfo(String classname, FontInfo info)(Code) | | Add canvas info. It is an error to call this before calling
setCanvas (hand will currently result in a null reference
exception).
|
addResourceReference | public void addResourceReference(String name, Element elt)(Code) | | |
adjustRelativeURL | static String adjustRelativeURL(String string, File sourceDir, File destDir)(Code) | | If the argument is a relative URL with no host, return an URL
that resolves to the same address relative to the destDir as
the argument does relative to sourceDir. Otherwise return the
argument unchanged.
|
adjustRelativeURL | String adjustRelativeURL(String string, Element elt)(Code) | | If the argument is a relative URL with no host, return an URL
that resolves to the same address relative to the main source
file as the argument does relative to the file that contains
elt. Otherwise return the argument unchanged.
|
checkValidChildContainment | public void checkValidChildContainment(Element element)(Code) | | Check if all children are allowed to be contained in this tags
|
compileScript | void compileScript(String script)(Code) | | Compiles script to bytecodes, and adds them to the
output file.
Parameters: script - a script |
compileScript | void compileScript(String script, Element elt)(Code) | | |
getApplicationFile | public File getApplicationFile()(Code) | | |
getBooleanProperty | boolean getBooleanProperty(String name)(Code) | | |
getDefaultTextWidth | public static synchronized int getDefaultTextWidth()(Code) | | |
getEmbedFonts | public boolean getEmbedFonts()(Code) | | |
getFileResolver | FileResolver getFileResolver()(Code) | | Returns the file resolver used in this environment.
the object writer |
getGenerator | ObjectWriter getGenerator()(Code) | | Returns the SWF writer that compilation within this
environment writes to.
the object writer |
getImportedLibraryFiles | Set getImportedLibraryFiles()(Code) | | |
getLibPrefixRelative | public String getLibPrefixRelative()(Code) | | |
getLoadableImportedLibraryFiles | Map getLoadableImportedLibraryFiles()(Code) | | |
getProperties | Properties getProperties()(Code) | | Returns the Properties object used in this environment.
the properties |
getResourceGenerator | ObjectWriter getResourceGenerator()(Code) | | By pointing at the main SWFWriter, this makes the resources
compile into the main app. We have to do this because we
haven't figured out a way to get Flash to attach individual
exported assets from a runtime loaded library into views in
the main app.
the object writer |
getResourceNames | Set getResourceNames()(Code) | | |
getRuntime | public String getRuntime()(Code) | | Return target Flash version (5, 6, ...) *
|
getSWFVersionInt | public int getSWFVersionInt()(Code) | | |
isCanvas | public boolean isCanvas()(Code) | | |
isDHTML | public boolean isDHTML()(Code) | | |
isImportLib | public boolean isImportLib()(Code) | | Returns true if we're compiling a loadable library file.
isLibrary |
isSWF | public boolean isSWF()(Code) | | |
resolveParentReference | File resolveParentReference(Element element) throws CompilationError(Code) | | Resolve the value of the parent node
|
resolveReference | File resolveReference(Element element, String aname, boolean asLibrary) throws CompilationError(Code) | | Resolve the value of the named attribute, relative to the
source location of the element.
|
resolveReference | File resolveReference(Element elt) throws CompilationError(Code) | | Resolve the value of the "src" attribute, relative to the
source location of the element.
|
resourceReferences | public Map resourceReferences()(Code) | | |
setApplicationFile | void setApplicationFile(File file)(Code) | | |
setEmbedFonts | public void setEmbedFonts(boolean embed)(Code) | | |
setImportLib | public void setImportLib(boolean v)(Code) | | |
setProperty | void setProperty(String name, boolean value)(Code) | | |
setScriptLimits | public void setScriptLimits(int recursion, int timeout)(Code) | | |
uniqueName | String uniqueName()(Code) | | a unique name in the SWF |
warnIfCannotContain | public boolean warnIfCannotContain(Element parentTag, Element childTag)(Code) | | |
|
|