Class JREDesc
- java.lang.Object
-
- net.adoptopenjdk.icedteaweb.jnlp.element.resource.JREDesc
-
public class JREDesc extends java.lang.ObjectThe java element (or the j2se element) (sub-element of resources) specifies what Java Runtime Environment (JRE) versions an application is supported on, as well as standard parameters to the Java Virtual Machine. Several JREs can be specified in the JNLP file, which indicates a prioritized list of the supported JREs, with the most preferred version first.- Version:
- $Revision: 1.5 $
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.PatternheapPatternstatic java.lang.StringHREF_ATTRIBUTEstatic java.lang.StringINITIAL_HEAP_SIZE_ATTRIBUTEprivate java.lang.StringinitialHeapSizeinitial heap sizestatic java.lang.StringJAVA_VM_ARGS_ATTRIBUTEprivate java.net.URLlocationthe location of a JRE product or nullstatic java.lang.StringMAX_HEAP_SIZE_ATTRIBUTEprivate java.lang.StringmaximumHeapSizemaximum head sizeprivate java.util.List<java.lang.String>parsedArgumentsargs to pass to the vmstatic java.lang.StringREQUIRE_32_BIT_ATTRIBUTEprivate booleanrequire32Bitprivate java.util.List<ResourcesDesc>resourceslist of ResourceDesc objectsprivate java.lang.Stringvendorstatic java.lang.StringVENDOR_ATTRIBUTEprivate VersionStringversionThe platform version or product version according to JSR-56, section 4.6.1 Java Runtime Environment Version Specification if location is not nullstatic java.lang.StringVERSION_ATTRIBUTE
-
Constructor Summary
Constructors Constructor Description JREDesc(VersionString version, java.lang.String vendor, boolean require32Bit, java.net.URL location, java.lang.String vmArgs, java.lang.String initialHeapSize, java.lang.String maximumHeapSize, java.util.List<ResourcesDesc> resources)Create a JRE descriptor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static java.lang.StringcheckHeapSize(java.lang.String heapSize)Check for valid heap size stringjava.util.List<java.lang.String>getAllVmArgs()java.lang.StringgetInitialHeapSize()java.net.URLgetLocation()java.lang.StringgetMaximumHeapSize()java.util.List<ResourcesDesc>getResourcesDesc()java.lang.StringgetVendor()VersionStringgetVersion()booleanisPlatformVersion()booleanisRequire32Bit()
-
-
-
Field Detail
-
VERSION_ATTRIBUTE
public static final java.lang.String VERSION_ATTRIBUTE
- See Also:
- Constant Field Values
-
VENDOR_ATTRIBUTE
public static final java.lang.String VENDOR_ATTRIBUTE
- See Also:
- Constant Field Values
-
REQUIRE_32_BIT_ATTRIBUTE
public static final java.lang.String REQUIRE_32_BIT_ATTRIBUTE
- See Also:
- Constant Field Values
-
HREF_ATTRIBUTE
public static final java.lang.String HREF_ATTRIBUTE
- See Also:
- Constant Field Values
-
JAVA_VM_ARGS_ATTRIBUTE
public static final java.lang.String JAVA_VM_ARGS_ATTRIBUTE
- See Also:
- Constant Field Values
-
INITIAL_HEAP_SIZE_ATTRIBUTE
public static final java.lang.String INITIAL_HEAP_SIZE_ATTRIBUTE
- See Also:
- Constant Field Values
-
MAX_HEAP_SIZE_ATTRIBUTE
public static final java.lang.String MAX_HEAP_SIZE_ATTRIBUTE
- See Also:
- Constant Field Values
-
heapPattern
private static final java.util.regex.Pattern heapPattern
-
version
private final VersionString version
The platform version or product version according to JSR-56, section 4.6.1 Java Runtime Environment Version Specification if location is not null
-
vendor
private final java.lang.String vendor
-
require32Bit
private final boolean require32Bit
-
location
private final java.net.URL location
the location of a JRE product or null
-
initialHeapSize
private final java.lang.String initialHeapSize
initial heap size
-
maximumHeapSize
private final java.lang.String maximumHeapSize
maximum head size
-
parsedArguments
private final java.util.List<java.lang.String> parsedArguments
args to pass to the vm
-
resources
private final java.util.List<ResourcesDesc> resources
list of ResourceDesc objects
-
-
Constructor Detail
-
JREDesc
public JREDesc(VersionString version, java.lang.String vendor, boolean require32Bit, java.net.URL location, java.lang.String vmArgs, java.lang.String initialHeapSize, java.lang.String maximumHeapSize, java.util.List<ResourcesDesc> resources) throws ParseException
Create a JRE descriptor.- Parameters:
version- the platform version or the product version if location is not nullvendor- the vendorrequire32Bit- the hint whether this application requires a 32-bit JVMlocation- the location of a JRE product or nullvmArgs- arguments to VMinitialHeapSize- initial heap sizemaximumHeapSize- maximum head sizeresources- list of ResourceDesc objects- Throws:
ParseException- is something goes wrong
-
-
Method Detail
-
getVersion
public VersionString getVersion()
- Returns:
- the JRE version. Use isPlatformVersion to determine if this version corresponds to a platform or product version.
-
isPlatformVersion
public boolean isPlatformVersion()
- Returns:
- true if the JRE version is a Java platform version (java.specification.version property) or false if it is a product version (java.version property).
-
getVendor
public java.lang.String getVendor()
-
getLocation
public java.net.URL getLocation()
- Returns:
- the JRE version string.
-
getMaximumHeapSize
public java.lang.String getMaximumHeapSize()
- Returns:
- the maximum heap size in bytes.
-
getInitialHeapSize
public java.lang.String getInitialHeapSize()
- Returns:
- the initial heap size in bytes.
-
getResourcesDesc
public java.util.List<ResourcesDesc> getResourcesDesc()
- Returns:
- the resources defined for this JRE.
-
isRequire32Bit
public boolean isRequire32Bit()
-
getAllVmArgs
public java.util.List<java.lang.String> getAllVmArgs()
- Returns:
- a list of vm arguments which can be passed to a new java process.
-
checkHeapSize
static java.lang.String checkHeapSize(java.lang.String heapSize) throws ParseExceptionCheck for valid heap size string- Returns:
- trimmed heapSize if correct
- Throws:
ParseException- if heapSize is invalid
-
-