|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.izforge.izpack.compiler.Property
public class Property
Sets a property by name, or set of properties (from file or resource) in the project. This is modeled after ant properties
Properties are immutable: once a property is set it cannot be changed. They are most definately not variable. There are five ways to set properties:prefix
or environment
attributes, if you supply a property name with a final "." it will not be doubled. ie
environment="myenv." will still allow access of environment variables through
"myenv.PATH" and "myenv.TERM".
Field Summary | |
---|---|
protected Compiler |
compiler
|
protected CompilerConfig |
config
|
protected java.lang.String |
env
|
protected java.io.File |
file
|
protected java.lang.String |
name
|
protected java.lang.String |
prefix
|
protected java.lang.String |
value
|
protected XMLElement |
xmlProp
|
Constructor Summary | |
---|---|
Property(XMLElement xmlProp,
CompilerConfig config)
|
Method Summary | |
---|---|
protected void |
addProperties(java.util.Properties props)
iterate through a set of properties, resolve them then assign them |
protected void |
addProperty(java.lang.String name,
java.lang.String value)
Add a name value pair to the project property set |
void |
execute()
Set the property in the project to the value. |
java.lang.String |
getValue()
get the value of this property |
protected void |
loadEnvironment(java.lang.String prefix)
load the environment values |
protected void |
loadFile(java.io.File file)
load properties from a file |
private void |
resolveAllProperties(java.util.Properties props)
resolve properties inside a properties object |
java.lang.String |
toString()
get the value of this property |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
protected java.lang.String value
protected java.io.File file
protected java.lang.String env
protected java.lang.String prefix
protected XMLElement xmlProp
protected CompilerConfig config
protected Compiler compiler
Constructor Detail |
---|
public Property(XMLElement xmlProp, CompilerConfig config)
Method Detail |
---|
public java.lang.String getValue()
public java.lang.String toString()
toString
in class java.lang.Object
public void execute() throws CompilerException
CompilerException
protected void loadFile(java.io.File file) throws CompilerException
file
- file to load
CompilerException
protected void loadEnvironment(java.lang.String prefix) throws CompilerException
prefix
- prefix to place before them
CompilerException
protected void addProperty(java.lang.String name, java.lang.String value) throws CompilerException
name
- name of propertyvalue
- value to set
CompilerException
protected void addProperties(java.util.Properties props) throws CompilerException
CompilerException
private void resolveAllProperties(java.util.Properties props) throws CompilerException
props
- properties to resolve
CompilerException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |