public class OsConstraint extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
private String |
arch
OS architecture from java system properties
|
private String |
family
The OS family
|
private String |
name
OS name from java system properties
|
private static long |
serialVersionUID |
private String |
version
OS version from java system properties
|
Constructor and Description |
---|
OsConstraint(String family,
String name,
String version,
String arch)
Constructs a new instance.
|
Modifier and Type | Method and Description |
---|---|
String |
getArch() |
String |
getFamily() |
String |
getName() |
static List |
getOsList(net.n3.nanoxml.XMLElement element)
Extract a list of OS constraints from given element.
|
String |
getVersion() |
boolean |
matchCurrentSystem()
Matches OS specification in this class against current system properties.
|
static boolean |
oneMatchesCurrentSystem(List constraint_list)
Helper function: Scan a list of OsConstraints for a match.
|
static boolean |
oneMatchesCurrentSystem(net.n3.nanoxml.XMLElement el)
Helper function: Check whether the given XMLElement is "suitable" for the current OS.
|
void |
setArch(String a) |
void |
setFamily(String f) |
void |
setName(String n) |
void |
setVersion(String v) |
String |
toString() |
private static final long serialVersionUID
public OsConstraint(String family, String name, String version, 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).public boolean matchCurrentSystem()
public static List getOsList(net.n3.nanoxml.XMLElement element)
element
- parent XMLElementpublic static boolean oneMatchesCurrentSystem(List constraint_list)
constraint_list
- List of OsConstraint to checkpublic static boolean oneMatchesCurrentSystem(net.n3.nanoxml.XMLElement el)
el
- The XMLElement to check for OS constraints.public void setVersion(String v)
public String getVersion()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses