|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.izforge.izpack.util.OsConstraint
Encapsulates OS constraints specified on creation time and allows to check them against the current OS. For example, this is used for <executable>s to check whether the executable is suitable for the current OS.
Field Summary | |
private java.lang.String |
arch
OS architecture from java system properties |
private java.lang.String |
family
The OS family |
private java.lang.String |
name
OS name from java system properties |
private static long |
serialVersionUID
|
private java.lang.String |
version
OS version from java system properties |
Constructor Summary | |
OsConstraint(java.lang.String family,
java.lang.String name,
java.lang.String version,
java.lang.String arch)
Constructs a new instance. |
Method Summary | |
java.lang.String |
getArch()
|
java.lang.String |
getFamily()
|
java.lang.String |
getName()
|
static java.util.List |
getOsList(XMLElement element)
Extract a list of OS constraints from given element. |
java.lang.String |
getVersion()
|
boolean |
matchCurrentSystem()
Matches OS specification in this class against current system properties. |
static boolean |
oneMatchesCurrentSystem(java.util.List constraint_list)
Helper function: Scan a list of OsConstraints for a match. |
static boolean |
oneMatchesCurrentSystem(XMLElement el)
Helper function: Check whether the given XMLElement is "suitable" for the current OS. |
void |
setArch(java.lang.String a)
|
void |
setFamily(java.lang.String f)
|
void |
setName(java.lang.String n)
|
void |
setVersion(java.lang.String v)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final long serialVersionUID
private java.lang.String family
private java.lang.String name
private java.lang.String version
private java.lang.String arch
Constructor Detail |
public OsConstraint(java.lang.String family, java.lang.String name, java.lang.String version, java.lang.String arch)
family
- The OS family (unix, windows or mac).name
- The exact OS name.version
- The exact OS version (check property os.version
for values).arch
- The machine architecture (check property os.arch
for values).Method Detail |
public boolean matchCurrentSystem()
public static java.util.List getOsList(XMLElement element)
element
- parent XMLElement
public static boolean oneMatchesCurrentSystem(java.util.List constraint_list)
constraint_list
- List of OsConstraint to check
public static boolean oneMatchesCurrentSystem(XMLElement el)
el
- The XMLElement to check for OS constraints.
public void setFamily(java.lang.String f)
public java.lang.String getFamily()
public void setName(java.lang.String n)
public java.lang.String getName()
public void setVersion(java.lang.String v)
public java.lang.String getVersion()
public void setArch(java.lang.String a)
public java.lang.String getArch()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |