public class RingoConfig extends Object
| Constructor and Description |
|---|
RingoConfig(Repository ringoHome)
Create a new Ringo configuration and sets up its module search path.
|
RingoConfig(Repository ringoHome,
Repository appHome,
String[] userModules,
String[] systemModules)
Create a new Ringo configuration and sets up its module search path.
|
RingoConfig(Repository ringoHome,
String[] userModules,
String[] systemModules)
Create a new Ringo configuration and sets up its module search path.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addModuleRepository(Repository repository)
Add a repository to the module search path.
|
String[] |
getArguments() |
List<String> |
getBootstrapScripts() |
String |
getCharset() |
org.mozilla.javascript.ClassShutter |
getClassShutter() |
boolean |
getDebug() |
Class<org.mozilla.javascript.Scriptable>[] |
getHostClasses()
Get the host classes to be added to the Rhino engine.
|
int |
getLanguageVersion()
Get the desired JavaScript langauge version
|
String |
getMainModule()
Get the module name of the main resource of the configuration.
|
Resource |
getMainResource()
Get the main script resource resolved by calling
setMainScript(String). |
int |
getOptLevel()
Get the Rhino optimization level
|
List<Repository> |
getRepositories()
Get a list of repositoris from the given ringoHome and ringoPath settings
using the ringo.home and ringo.path system properties as fallback.
|
Repository |
getRepository(String path)
Get a resource from our script repository
|
Resource |
getResource(String path)
Get a resource from our script repository
|
Resource |
getResource(String path,
ModuleLoader[] loaders)
Get a resource from our script repository
|
List<Resource> |
getResources(String path,
boolean recursive)
Get a list of all child resources for the given path relative to
our script repository.
|
Repository |
getRingoHome()
Return the ringo install directory
|
boolean |
getStrictVars() |
org.mozilla.javascript.WrapFactory |
getWrapFactory() |
boolean |
hasParentProtoProperties()
Get the flag to enable __parent__ and __proto__ properties on JS objects
|
boolean |
isPolicyEnabled() |
boolean |
isReloading() |
boolean |
isSealed() |
boolean |
isVerbose() |
Repository |
resolveRepository(String path,
boolean system)
Resolve a module repository path.
|
void |
setArguments(String[] arguments) |
void |
setBootstrapScripts(List<String> bootstrapScripts) |
void |
setCharset(String charset) |
void |
setClassShutter(org.mozilla.javascript.ClassShutter classShutter) |
void |
setDebug(boolean debug) |
void |
setHostClasses(Class<org.mozilla.javascript.Scriptable>[] classes)
Set the host classes to be added to the Rhino engine.
|
void |
setMainScript(String scriptName)
Set the main script for this configuration.
|
void |
setOptLevel(int optlevel)
Set the Rhino optimization level
|
void |
setParentProtoProperties(boolean flag)
Set the flag to enable __parent__ and __proto__ properties on JS objects
|
void |
setPolicyEnabled(boolean hasPolicy) |
void |
setReloading(boolean reloading) |
void |
setSealed(boolean sealed) |
void |
setStrictVars(boolean strictVars) |
void |
setVerbose(boolean verbose) |
void |
setWrapFactory(org.mozilla.javascript.WrapFactory wrapFactory) |
public RingoConfig(Repository ringoHome) throws IOException
ringoHome - the ringo installation directoryFileNotFoundException - if a module path item does not existIOExceptionpublic RingoConfig(Repository ringoHome, String[] userModules, String[] systemModules) throws IOException
ringoHome - the ringo installation directoryuserModules - the module search path as list of pathssystemModules - system module path to append to module path, or nullFileNotFoundException - if a module path item does not existIOExceptionpublic RingoConfig(Repository ringoHome, Repository appHome, String[] userModules, String[] systemModules) throws IOException
ringoHome - the ringo installation directoryappHome - the path to resolve application against, pass null for
current working directoryuserModules - the module search path as list of pathssystemModules - system module path to append to module path, or nullFileNotFoundException - if a module path item does not existIOExceptionpublic void addModuleRepository(Repository repository)
repository - the repository to add.public Repository resolveRepository(String path, boolean system) throws IOException
path - the pathsystem - whether repository should be resolved as system repositoryIOException - if an I/O error happened while resolvingpublic void setMainScript(String scriptName) throws IOException
scriptName - the name of the script, or null.FileNotFoundException - if the script repository does not existIOExceptionpublic Resource getMainResource()
setMainScript(String).public Repository getRingoHome()
public List<Repository> getRepositories()
public String getMainModule()
public void setHostClasses(Class<org.mozilla.javascript.Scriptable>[] classes)
classes - a list of Rhino host classespublic Class<org.mozilla.javascript.Scriptable>[] getHostClasses()
public int getOptLevel()
public void setOptLevel(int optlevel)
optlevel - int value between -1 and 9public boolean getDebug()
public void setDebug(boolean debug)
public boolean isVerbose()
public void setVerbose(boolean verbose)
public boolean getStrictVars()
public void setStrictVars(boolean strictVars)
public int getLanguageVersion()
public boolean hasParentProtoProperties()
public void setParentProtoProperties(boolean flag)
flag - true to enable __parent__ and __proto__ propertiespublic Resource getResource(String path) throws IOException
path - the resource pathIOException - an I/O error occurredpublic Resource getResource(String path, ModuleLoader[] loaders) throws IOException
path - the resource pathloaders - optional list of module loadersIOException - an I/O error occurredpublic Repository getRepository(String path) throws IOException
path - the resource pathIOException - an I/O error occurredpublic List<Resource> getResources(String path, boolean recursive) throws IOException
path - the repository pathrecursive - whether to include nested resourcesIOException - an I/O error occurredpublic String getCharset()
public void setCharset(String charset)
public org.mozilla.javascript.ClassShutter getClassShutter()
public void setClassShutter(org.mozilla.javascript.ClassShutter classShutter)
public org.mozilla.javascript.WrapFactory getWrapFactory()
public void setWrapFactory(org.mozilla.javascript.WrapFactory wrapFactory)
public boolean isSealed()
public void setSealed(boolean sealed)
public boolean isReloading()
public void setReloading(boolean reloading)
public boolean isPolicyEnabled()
public void setPolicyEnabled(boolean hasPolicy)
public String[] getArguments()
public void setArguments(String[] arguments)
Copyright © 2016. All rights reserved.