Mobile Tools for Java
Release 1.0

org.eclipse.mtj.core.project
Interface IMetaData

All Known Subinterfaces:
IMIDPMetaData

public interface IMetaData

Implementors of the IMetaData interface must provide a way to store and retrieve IMTJProject related Metadata.

Each IMTJProject may have an specialized type of IMetaData implementation. For example, IMidletSuiteProject's uses an IMIDPMetaData implementation to store it's metadata.

For retrieving the IMetaData implementation referent to a specific IMTJProject type, clients must use MTJCore#createMetaData(org.eclipse.core.resources.IProject, ProjectType) method from the MTJCore facade.

EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is no guarantee that this API will work or that it will remain the same. Please do not use this API without consulting with the MTJ team.

Since:
1.0
Restriction:
This class is not intended to be implemented by clients.

Field Summary
static String METADATA_FILE
          The metadata file name for IMTJProject projects.
 
Method Summary
 MTJRuntimeList getRuntimeList()
          Return the list of runtimes that are associated to the project.
 Properties getSDKProviderMetaData(String sdkId)
          Retrieve a Properties file of vendor-specific meta data associated with the IMTJProject.
 ISignatureProperties getSignatureProperties()
          Returns the container class that holds the various project-specific properties relating to potential signing operations.
 Version getVersion()
          Returns the version of the Metadata file.
 void saveMetaData()
          Save the current metadata state to the file system.
 void setMTJRuntimeList(MTJRuntimeList runtimeList)
          Set the list of runtimes that are associated to the project.
 void setSDKProviderMetaData(String sdkId, Properties metaData)
          Set a Properties file of meta data to be associated with an IMTJProject.
 void setSignatureProperties(ISignatureProperties signatureProperties)
          Sets the container class that holds the various project-specific properties relating to potential signing operations.
 

Field Detail

METADATA_FILE

static final String METADATA_FILE
The metadata file name for IMTJProject projects.

See Also:
Constant Field Values
Method Detail

getRuntimeList

MTJRuntimeList getRuntimeList()
Return the list of runtimes that are associated to the project. From the list it is possible to read each runtime and information such as the device of each runtime.

If no list of runtimes was set previously, this method will create a new empty MTJRuntimeList and associate it to the project.

Returns:
list of runtimes that are associated to the project or an empty list if no runtime list was previously defined.

getSignatureProperties

ISignatureProperties getSignatureProperties()
Returns the container class that holds the various project-specific properties relating to potential signing operations.

Returns:
an ISignatureProperties instance for use in signing operations.

getVersion

Version getVersion()
Returns the version of the Metadata file.

Returns:
Returns the version.

saveMetaData

void saveMetaData()
                  throws CoreException
Save the current metadata state to the file system.

Throws:
CoreException - if this method fails to save the metadata file.

setSDKProviderMetaData

void setSDKProviderMetaData(String sdkId,
                            Properties metaData)
                            throws IllegalArgumentException
Set a Properties file of meta data to be associated with an IMTJProject. This meta data is arbitrary vendor-defined data that will be persisted with the project and automatically disposed when a project is deleted.

A example use case is to save project level user preferences associated with a vendor-supplied JAD editor page.

The Properties file is not cloned. The SDK provider may set the Properties files once and continue to make changes to it. Values will be persisted the next time saveMetaData() is called.

Parameters:
sdkId - Unique identifier for the SDK. If meta data associated with the ID is already set, the old meta data is replaced with the new.
metaData - A Properties file of arbitrary vendor-defined values. Passing in null is allowed and will 'erase' the meta data for that ID.
Throws:
IllegalArgumentException - if sdkId is null or empty.
Since:
1.1

getSDKProviderMetaData

Properties getSDKProviderMetaData(String sdkId)
                                  throws IllegalArgumentException
Retrieve a Properties file of vendor-specific meta data associated with the IMTJProject.

The Properties file is not cloned and is therefore mutable. The SDK provider may continue to make changes to it. Values will be persisted the next time saveMetaData() is called.

Parameters:
sdkId - Unique identifier for the SDK.
Returns:
A Properties object of vendor-specific meta data, or null if no such object is associated with the SDK ID.
Throws:
IllegalArgumentException - if sdkId is null or empty.
Since:
1.1

setMTJRuntimeList

void setMTJRuntimeList(MTJRuntimeList runtimeList)
                       throws IllegalArgumentException
Set the list of runtimes that are associated to the project.

If a null runtime is given, this method must throws an IllegalArgumentException. A null runtime list would make the MTJ build process fail when building the IMTJProject resources.

Parameters:
runtimeList - the list of runtimes that are associated to the project.
Throws:
IllegalArgumentException - if null was passed as the runtime list.

setSignatureProperties

void setSignatureProperties(ISignatureProperties signatureProperties)
Sets the container class that holds the various project-specific properties relating to potential signing operations.

Parameters:
signatureProperties - the project-specific properties for use in signing operations.

Mobile Tools for Java
Release 1.0