Mobile Tools for Java
Release 1.0

org.eclipse.mtj.core.model.jad
Class ApplicationDescriptor

java.lang.Object
  extended by org.eclipse.mtj.core.model.jad.ApplicationDescriptor

public class ApplicationDescriptor
extends Object

This class is a representation of a Java Application Descriptor (jad) for a MIDlet Suite.

Note: This class/interface is part of an interim API that is still under development and expected to change before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken as the API evolves.


Nested Class Summary
static class ApplicationDescriptor.MidletDefinition
          The definition of a MIDlet within the application descriptor.
 
Field Summary
static String MIDLET_PREFIX
          The prefix of all MIDlet definition properties
 
Constructor Summary
ApplicationDescriptor(File jadFile)
          Construct a new ApplicationDescriptor instance based on the data in the specified file.
 
Method Summary
 void addMidletDefinition(ApplicationDescriptor.MidletDefinition midletDefinition)
          Add a new MidletDefinition instance.
 Version getConfigurationSpecificationVersion()
          Return the configuration specification version associated with this JAD file.
 org.eclipse.mtj.core.internal.utils.ColonDelimitedProperties getManifestProperties()
          Return the overall manifest properties.
 int getMidletCount()
          Return the current count of MidletDefinition instances within this application descriptor.
 List<ApplicationDescriptor.MidletDefinition> getMidletDefinitions()
          Return the list of MidletDefinition instances currently managed by the ApplicationDescriptor.
 String getMidletJarURL()
          Return the JAD URL specified in the application descriptor or null if it has not been specified.
 void store()
          Store the ApplicationDescriptor instance into the same File from which it was originally read.
 void store(File jadFile)
          Store the ApplicationDescriptor instance into the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIDLET_PREFIX

public static final String MIDLET_PREFIX
The prefix of all MIDlet definition properties

See Also:
Constant Field Values
Constructor Detail

ApplicationDescriptor

public ApplicationDescriptor(File jadFile)
                      throws IOException
Construct a new ApplicationDescriptor instance based on the data in the specified file.

Parameters:
jadFile - The file in which the descriptor is being held.
Throws:
IOException - when an error occurs reading the file
Method Detail

addMidletDefinition

public void addMidletDefinition(ApplicationDescriptor.MidletDefinition midletDefinition)
Add a new MidletDefinition instance.

Parameters:
midletDefinition - the MIDlet definition to be added

getConfigurationSpecificationVersion

public Version getConfigurationSpecificationVersion()
                                             throws CoreException
Return the configuration specification version associated with this JAD file.

Returns:
Throws:
CoreException

getManifestProperties

public org.eclipse.mtj.core.internal.utils.ColonDelimitedProperties getManifestProperties()
Return the overall manifest properties.

Returns:
the manifest properties.

getMidletCount

public int getMidletCount()
Return the current count of MidletDefinition instances within this application descriptor.

Returns:
the number of MidletDefinition instances

getMidletDefinitions

public List<ApplicationDescriptor.MidletDefinition> getMidletDefinitions()
Return the list of MidletDefinition instances currently managed by the ApplicationDescriptor.

Returns:
a list of MidletDefinition instances

getMidletJarURL

public String getMidletJarURL()
Return the JAD URL specified in the application descriptor or null if it has not been specified. This method does not check the validity of the value.

Returns:

store

public void store()
           throws IOException
Store the ApplicationDescriptor instance into the same File from which it was originally read.

Throws:
IOException - when an error occurs while storing the descriptor

store

public void store(File jadFile)
           throws IOException
Store the ApplicationDescriptor instance into the specified file.

Parameters:
jadFile - the file into which the descriptor will be written
Throws:
IOException - when an error occurs while storing the descriptor

Mobile Tools for Java
Release 1.0