Class ResourcesDesc
- java.lang.Object
-
- net.adoptopenjdk.icedteaweb.jnlp.element.resource.ResourcesDesc
-
public class ResourcesDesc extends java.lang.ObjectThe resources element specifies all the resources that are part of the application, such as Java class files, native libraries, and system properties.- Version:
- $Revision: 1.7 $
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String[]archthe arch for these resourcesstatic java.lang.StringARCH_ATTRIBUTEstatic java.lang.StringEXTENSION_ELEMENTstatic java.lang.StringJ2SE_ELEMENTstatic java.lang.StringJAR_ELEMENTstatic java.lang.StringJAVA_ELEMENTprivate JNLPFilejnlpFilethe JNLPFile this information is forprivate java.util.Locale[]localesthe locales of these resourcesstatic java.lang.StringNATIVELIB_ELEMENTprivate java.lang.String[]osthe OS for these resourcesstatic java.lang.StringOS_ATTRIBUTEstatic java.lang.StringPACKAGE_ELEMENTstatic java.lang.StringPROPERTY_ELEMENTprivate java.util.List<java.lang.Object>resourceslist of jars, packages, properties, and extensionsstatic java.lang.StringRESOURCES_ELEMENT
-
Constructor Summary
Constructors Constructor Description ResourcesDesc(JNLPFile jnlpFile, java.util.Locale[] locales, java.lang.String[] os, java.lang.String[] arch)Create a representation of one information section of the JNLP File.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResource(java.lang.Object resource)Add a resource.java.lang.String[]getArch()ExtensionDesc[]getExtensions()JARDesc[]getJARs()JARDesc[]getJARs(java.lang.String partName)JNLPFilegetJNLPFile()JREDesc[]getJREs()java.util.Locale[]getLocales()JARDescgetMainJAR()static JARDescgetMainJAR(java.util.List<JARDesc> jars)static JARDescgetMainJAR(JARDesc[] jars)java.lang.String[]getOS()PackageDesc[]getPackages()PackageDesc[]getPackages(java.lang.String className)Returns the Packages that match the specified class name.PropertyDesc[]getProperties()java.util.Map<java.lang.String,java.lang.String>getPropertiesMap()<T> java.util.List<T>getResources(java.lang.Class<T> type)private static <T> TgetWontedResource(java.lang.Object resource, java.lang.Class<T> type)private static <T> booleanisWontedResource(java.lang.Object resource, java.lang.Class<T> type)
-
-
-
Field Detail
-
RESOURCES_ELEMENT
public static final java.lang.String RESOURCES_ELEMENT
- See Also:
- Constant Field Values
-
OS_ATTRIBUTE
public static final java.lang.String OS_ATTRIBUTE
- See Also:
- Constant Field Values
-
ARCH_ATTRIBUTE
public static final java.lang.String ARCH_ATTRIBUTE
- See Also:
- Constant Field Values
-
NATIVELIB_ELEMENT
public static final java.lang.String NATIVELIB_ELEMENT
- See Also:
- Constant Field Values
-
JAR_ELEMENT
public static final java.lang.String JAR_ELEMENT
- See Also:
- Constant Field Values
-
J2SE_ELEMENT
public static final java.lang.String J2SE_ELEMENT
- See Also:
- Constant Field Values
-
JAVA_ELEMENT
public static final java.lang.String JAVA_ELEMENT
- See Also:
- Constant Field Values
-
EXTENSION_ELEMENT
public static final java.lang.String EXTENSION_ELEMENT
- See Also:
- Constant Field Values
-
PROPERTY_ELEMENT
public static final java.lang.String PROPERTY_ELEMENT
- See Also:
- Constant Field Values
-
PACKAGE_ELEMENT
public static final java.lang.String PACKAGE_ELEMENT
- See Also:
- Constant Field Values
-
locales
private final java.util.Locale[] locales
the locales of these resources
-
os
private final java.lang.String[] os
the OS for these resources
-
arch
private final java.lang.String[] arch
the arch for these resources
-
jnlpFile
private final JNLPFile jnlpFile
the JNLPFile this information is for
-
resources
private final java.util.List<java.lang.Object> resources
list of jars, packages, properties, and extensions
-
-
Constructor Detail
-
ResourcesDesc
public ResourcesDesc(JNLPFile jnlpFile, java.util.Locale[] locales, java.lang.String[] os, java.lang.String[] arch)
Create a representation of one information section of the JNLP File.- Parameters:
jnlpFile- JNLP file the resources are forlocales- the locales of these resourcesos- the os of these resourcesarch- the arch of these resources
-
-
Method Detail
-
getJREs
public JREDesc[] getJREs()
- Returns:
- the JVMs.
-
getMainJAR
public JARDesc getMainJAR()
- Returns:
- the main JAR for these resources. There first JAR is returned if no JARs are specified as the main JAR, and if there are no JARs defined then null is returned.
-
getJARs
public JARDesc[] getJARs()
- Returns:
- all of the JARs.
-
getJARs
public JARDesc[] getJARs(java.lang.String partName)
- Parameters:
partName- the part name, null and "" equivalent- Returns:
- the JARs with the specified part name.
-
getExtensions
public ExtensionDesc[] getExtensions()
- Returns:
- the Extensions.
-
getPackages
public PackageDesc[] getPackages()
- Returns:
- the Packages.
-
getPackages
public PackageDesc[] getPackages(java.lang.String className)
Returns the Packages that match the specified class name.- Parameters:
className- the fully qualified class name- Returns:
- the PackageDesc objects matching the class name
-
getProperties
public PropertyDesc[] getProperties()
- Returns:
- the Properties as a list.
-
getPropertiesMap
public java.util.Map<java.lang.String,java.lang.String> getPropertiesMap()
- Returns:
- the properties as a map.
-
getOS
public java.lang.String[] getOS()
- Returns:
- the os required by these resources, or null if no locale was specified in the JNLP file.
-
getArch
public java.lang.String[] getArch()
- Returns:
- the architecture required by these resources, or null if no locale was specified in the JNLP file.
-
getLocales
public java.util.Locale[] getLocales()
- Returns:
- the locale required by these resources, or null if no locale was specified in the JNLP file.
-
getJNLPFile
public JNLPFile getJNLPFile()
- Returns:
- the JNLPFile the resources are for.
-
getResources
public <T> java.util.List<T> getResources(java.lang.Class<T> type)
- Type Parameters:
T- type of resource to be found- Parameters:
type- resource to be found- Returns:
- all resources of the specified type.
-
isWontedResource
private static <T> boolean isWontedResource(java.lang.Object resource, java.lang.Class<T> type)
-
getWontedResource
private static <T> T getWontedResource(java.lang.Object resource, java.lang.Class<T> type)
-
addResource
public void addResource(java.lang.Object resource)
Add a resource.- Parameters:
resource- to be added
-
-