|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.Environment
public class Environment
Contains all variables, settings, etc not only for the preprocessing, but also for the various other build phases.
Copyright Enough Software 2005
history
22-Apr-2005 - rob creation
| Field Summary | |
|---|---|
protected static Pattern |
FUNCTION_PATTERN
|
protected static Pattern |
PROPERTY_PATTERN
|
| Constructor Summary | |
|---|---|
Environment()
Creates a new empty environment. |
|
Environment(ExtensionManager extensionsManager,
Map<String,String> properties,
File baseDir)
Creates a new empty environment. |
|
Environment(File polishHome)
Creates a new empty environment. |
|
| Method Summary | |
|---|---|
void |
addSymbol(String name)
|
void |
addSymbols(Map<String,Boolean> additionalSymbols)
|
void |
addTemporarySymbol(String name)
|
void |
addTemporaryVariable(String name,
String value)
|
void |
addToVariable(String name,
String value)
Adds the given value to the specified variable. |
void |
addVariable(String name,
String value)
|
void |
addVariables(Map<String,String> vars)
|
void |
clearTemporarySettings()
|
Object |
get(String key)
Retrieves any object to this environment. |
File |
getBaseDir()
|
BooleanEvaluator |
getBooleanEvaluator()
|
BuildSetting |
getBuildSetting()
|
Device |
getDevice()
|
static Environment |
getInstance()
Retrieves the instance of the environment |
LibraryManager |
getLibraryManager()
|
Locale |
getLocale()
|
File |
getProjectHome()
Retrieves the project's home dir. |
String |
getProperty(String property,
boolean needsToBeDefined)
Retrieves the given property. |
Map<String,Boolean> |
getSymbols()
Retrieves all symbols. |
String |
getVariable(String name)
|
Map<String,String> |
getVariables()
Retrieves all defined variables (capabilities) for the current device and this project. |
boolean |
hasSymbol(String name)
|
boolean |
hasVariable(String name)
Determines whether a variable is defined. |
void |
initialize(Device newDevice,
Locale newLocale)
|
boolean |
isConditionFulfilled(String condition)
Checks whether a condition is met. |
void |
putAll(Map<String,String> properties)
Puts all properties of the given map into the internal map without conversion. |
boolean |
removeSymbol(String name)
|
boolean |
removeTemporarySymbol(String name)
|
String |
removeTemporaryVariable(String name)
|
String |
removeVariable(String name)
|
File |
resolveFile(String url)
Resolves the path to a file. |
String |
resolveVariable(String name)
Retrieves the variables and writes any properties into it's value. |
void |
set(String key,
Object value)
Sets any object to this environment. |
void |
setBaseDir(File baseDir)
Sets the project's main directory. |
void |
setBaseProperties(Map<String,String> properties)
Sets the basic properties which are available the whole time. |
void |
setBuildSetting(BuildSetting setting)
|
void |
setExtensionManager(ExtensionManager manager)
Sets the extension manager. |
void |
setLibraryManager(LibraryManager manager)
|
void |
setLocale(Locale locale)
|
void |
setSymbols(Map<String,Boolean> features)
|
void |
setVariable(String name,
String value)
|
void |
setVariables(Map<String,String> capabilities)
|
String |
writeProperties(String input)
Inserts the property-values in a string with property-definitions. |
String |
writeProperties(String input,
boolean needsToBeDefined)
Inserts the property-values in a string with property-definitions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Pattern PROPERTY_PATTERN
protected static final Pattern FUNCTION_PATTERN
| Constructor Detail |
|---|
public Environment()
public Environment(File polishHome)
polishHome - the path to the J2ME Polish installation directory
public Environment(ExtensionManager extensionsManager,
Map<String,String> properties,
File baseDir)
extensionsManager - the manager for extensionsproperties - basic environment settingsbaseDir - the base directory like the project's home directory| Method Detail |
|---|
public static Environment getInstance()
public void initialize(Device newDevice,
Locale newLocale)
public void setSymbols(Map<String,Boolean> features)
features - public void setVariables(Map<String,String> capabilities)
capabilities - public void clearTemporarySettings()
public void addVariable(String name,
String value)
name - value - public String removeVariable(String name)
public void setVariable(String name,
String value)
name - value - public String removeTemporaryVariable(String name)
public String getVariable(String name)
public void addTemporaryVariable(String name,
String value)
public void addSymbol(String name)
name - public boolean removeSymbol(String name)
public boolean hasSymbol(String name)
public void addTemporarySymbol(String name)
public boolean removeTemporarySymbol(String name)
public Locale getLocale()
public String writeProperties(String input)
input - the string in which property definition might be included,
e.g. "file=${source}/MyFile.java"
public String writeProperties(String input,
boolean needsToBeDefined)
input - the string in which property definition might be included,
e.g. "file=${source}/MyFile.java"needsToBeDefined - true when an IllegalArgumentException should be thrown when no
value for a property was found.
IllegalArgumentException - when a property-value was not found and needsToBeDefined is
true.
public String getProperty(String property,
boolean needsToBeDefined)
property - the name of the propertyneedsToBeDefined - true when an exception should be thrown when the property is
not defined
public void setLocale(Locale locale)
locale - the localepublic BooleanEvaluator getBooleanEvaluator()
public Map<String,String> getVariables()
public void addSymbols(Map<String,Boolean> additionalSymbols)
additionalSymbols - public Device getDevice()
public void addVariables(Map<String,String> vars)
vars - public File resolveFile(String url)
url - the filepath that can contain properties such as
${polish.home}.
public File getBaseDir()
public void setBuildSetting(BuildSetting setting)
setting - public BuildSetting getBuildSetting()
public void setLibraryManager(LibraryManager manager)
public LibraryManager getLibraryManager()
public Map<String,Boolean> getSymbols()
public void set(String key,
Object value)
key - the key under which the value is storedvalue - the valueget( String )public Object get(String key)
key - the key under which the value is stored
set( String, Object )public boolean isConditionFulfilled(String condition)
condition - the condition
public String resolveVariable(String name)
name - the name of the variable
public boolean hasVariable(String name)
name - the name of the variable
public void putAll(Map<String,String> properties)
properties - a map of propertiespublic File getProjectHome()
public void setBaseDir(File baseDir)
baseDir - the project's home directorypublic void setExtensionManager(ExtensionManager manager)
manager - the managerpublic void setBaseProperties(Map<String,String> properties)
properties - the properties
public void addToVariable(String name,
String value)
name - name of the variablevalue - value of the variable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||