Mobile Tools for Java
Release 1.0

org.eclipse.mtj.core.symbol
Interface ISymbolSetFactory


public interface ISymbolSetFactory

This API provides a mechanism to create symbols set. Two different ways are available: create from a device and create from a j2mepolish device file. The first one will be based on the device properties and the device libraries. The later is based on j2mepolish device format and will create an array of symbol sets for each device that is available on the database.

Clients must use MTJCore.getSymbolSetFactory() to retrieve an ISymbolSetFactory instance.

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

Field Summary
static String DEVICE_DB_J2MEPOLISH_FILE
          Constant that represents the type j2mepolish from file
static String DEVICE_DB_J2MEPOLISH_JAR
          Constant that represents the type j2mepolish from antenna jar
 
Method Summary
 ISymbol createSymbol(String name, String value)
          Creates a new symbol based on the given name and value.
 ISymbolSet createSymbolSet(String name)
          Create a symbol set with the given name.
 List<ISymbolSet> createSymbolSetFromDataBase(String type, IPath databasePath, IProgressMonitor monitor)
          Creates a list of symbol sets based on a device data base.
 ISymbolSet createSymbolSetFromDevice(IDevice device)
          Create SymbolSet from device.
 ISymbolSet createSymbolSetFromProperties(Properties properties)
          Create SymbolSet from properties.
 

Field Detail

DEVICE_DB_J2MEPOLISH_FILE

static final String DEVICE_DB_J2MEPOLISH_FILE
Constant that represents the type j2mepolish from file

See Also:
Constant Field Values

DEVICE_DB_J2MEPOLISH_JAR

static final String DEVICE_DB_J2MEPOLISH_JAR
Constant that represents the type j2mepolish from antenna jar

See Also:
Constant Field Values
Method Detail

createSymbol

ISymbol createSymbol(String name,
                     String value)
Creates a new symbol based on the given name and value.

Parameters:
name - the symbol name. This is case-sensitive and must not be null or an empty String "".
value - the symbol value.
Returns:
the newly created symbol.

createSymbolSet

ISymbolSet createSymbolSet(String name)
Create a symbol set with the given name.

Parameters:
name - the SymbolSet name. This is case-sensitive and must not be null or an empty String "".
Returns:
the newly created SymbolSet.

createSymbolSetFromDataBase

List<ISymbolSet> createSymbolSetFromDataBase(String type,
                                             IPath databasePath,
                                             IProgressMonitor monitor)
                                             throws IOException
Creates a list of symbol sets based on a device data base. The device database is specified via an input URI and a type. Currently MTJ supports only J2MEPolish database.

Parameters:
type - a string that represents the type of the database to be imported. Currently MTJ supports only J2MEPolish database ( DEVICE_DB_J2MEPOLISH_JAR or DEVICE_DB_J2MEPOLISH_FILE).
databasePath - path of the database.
monitor - a progress monitor, or null if progress reporting is not desired.
Returns:
a List of SymbolSets.
Throws:
IOException - if failed to read the database.

createSymbolSetFromDevice

ISymbolSet createSymbolSetFromDevice(IDevice device)
Create SymbolSet from device. The content of the symbolset will be based on the libraries that the device has. The SymbolSet name will be the same as IDevice.getName().

Parameters:
device - the device instance to be used as base to the new SymbolSet.
Returns:
the newly created SymbolSet.

createSymbolSetFromProperties

ISymbolSet createSymbolSetFromProperties(Properties properties)
Create SymbolSet from properties. The content of the symbolset will be based on the properties instance. The SymbolSet name will be "Properties".

Parameters:
properties - the properties to be used as base to the new SymbolSet.
Returns:
the newly created SymbolSet.

Mobile Tools for Java
Release 1.0