net.rim.device.api.system
Class CodeModuleGroup

java.lang.Object
  extended by net.rim.device.api.system.CodeModuleGroup

public final class CodeModuleGroup
extends Object

Encapsulates and provides programmatic access to the data for a code module group.

The device can store meta-information about groups of code modules (for example, the code modules that comprise a single application), in serialized form, in a persisted store in the file system. Access to this store is moderated by the CodeModuleGroupManager system singleton. Code module groups provide a way for the device to store meta-information associated with groups of modules (for example, user friendly "application names", "application version strings", build dates, copyright strings, and so forth).

Using CodeModuleGroup instances
To use the data stored in a code module group block, you must first use the manager to load it into a CodeModuleGroup instance, and then you can use the group instance to operate on the code module group data.

 String myGrpName = "SomeGroupName";
 CodeModuleGroup myGroup = CodeModuleGroupManager.load(myGrpName);

 String pName;
 for( Enumeration e = myGroup.getPropertyNames(); e.hasMoreElements(); ) {
     pName = (String)e.nextElement();
     System.out.println( " Property Name: " + pName );
     System.out.println( "Property Value: " + myGroup.getProperty(pName) );
 }
 

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

Field Summary
Category: Signed static int FLAG_DEPENDENCY
          The group is a child of another group.
Category: Signed static int FLAG_HIDDEN
          The group should be hidden from view.
Category: Signed static int FLAG_LIBRARY
          The group is a library.
Category: Signed static int FLAG_REQUIRED
          The group is required, and should not be deleted.
 
Constructor Summary
Category: Signed CodeModuleGroup(String groupName)
          Constructs a new CodeModuleGroup instance with provided name.
 
Method Summary
Category: Signed  void addDependency(String groupName)
          Adds a code module group to this group's list of dependencies.
Category: Signed  void addModule(String moduleName)
          Adds a named module to this code module group.
Category: Signed  boolean containsDependency(String groupName)
          Determines if a group is a dependency for this code module group.
Category: Signed  boolean containsModule(String moduleName)
          Determines if this code module group contains a named code module.
Category: Signed  void delete()
          Deletes this code module group from the module group store.
Category: Signed  boolean equals(Object o)
          Determines if a provided object is equivalent to this code module group.
Category: Signed  String getCopyright()
          Retrieves this code module group's default copyright string.
Category: Signed  Enumeration getDependencies()
          Retrieves the list of code module groups that this group depends upon.
Category: Signed  String getDescription()
          Retrieves this code module group's default description.
Category: Signed  int getFlags()
          Retrieves this code module group's flag mask.
Category: Signed  String getFriendlyName()
          Retrieves this code module group's default friendly name.
Category: Signed  int getHandle()
          Retrieves this code module group's handle.
Category: Signed  Enumeration getModules()
          Retrieves the names of the modules in this group.
Category: Signed  String getName()
          Retrieves this code module group's name.
Category: Signed  String getProperty(String name)
          Retrieves a property for this code module group, by name.
Category: Signed  Enumeration getPropertyNames()
          Retrieves an enumeration of this code module group's property names.
Category: Signed  String getVendor()
          Retrieves this code module group's default vendor string.
Category: Signed  String getVersion()
          Retrieves this code module group's default version string.
Category: Signed  int hashCode()
          Retrieves the hashcode value for this code module group.
Category: Signed static CodeModuleGroup load(String groupName)
          Deprecated. Use CodeModuleGroupManager.load(String) instead.
Category: Signed static CodeModuleGroup[] loadAll()
          Deprecated. Use CodeModuleGroupManager.loadAll() instead.
Category: Signed  void setCopyright(String copyright)
          Sets this code module group's default copyright string.
Category: Signed  void setDescription(String description)
          Sets this code module group's default description.
Category: Signed  void setFlag(int flag, boolean value)
          Modifies status of a flag for this code module group.
Category: Signed  void setFriendlyName(String friendlyName)
          Sets a default friendly name for this code module group.
Category: Signed  void setProperty(String name, String value)
          Sets a property value for this code module group, by name.
Category: Signed  void setVendor(String vendor)
          Sets this code module group's default vendor.
Category: Signed  void setVersion(String version)
          Sets this code module group's default version string.
Category: Signed  boolean store()
          Stores this code module group.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

FLAG_REQUIRED

public static final int FLAG_REQUIRED
The group is required, and should not be deleted.

See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

FLAG_HIDDEN

public static final int FLAG_HIDDEN
The group should be hidden from view.

See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

FLAG_DEPENDENCY

public static final int FLAG_DEPENDENCY
The group is a child of another group.

See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

FLAG_LIBRARY

public static final int FLAG_LIBRARY
The group is a library.

See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.1.0


Constructor Detail

CodeModuleGroup

public CodeModuleGroup(String groupName)
Constructs a new CodeModuleGroup instance with provided name.

Parameters:
groupName - Name for this group; must be an ASCII string of 256 characters or less, and must not be null.
Throws:
NullPointerException - If you provide a null name parameter.
IllegalArgumentException - If your name is longer than the maximum length, or if your name is not an ASCII string.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2


Method Detail

getName

public String getName()
Retrieves this code module group's name.

Returns:
Name for this group.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

getModules

public Enumeration getModules()
Retrieves the names of the modules in this group.

Returns:
Enumeration of names for all the modules in this group, as Strings.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

getHandle

public int getHandle()
Retrieves this code module group's handle.

Note: the code module group manager does not assign a code module group with a handle until it actually writes it into the module group store; invoking CodeModuleGroup.store() on this instance attempts to properly construct a raw data buffer from this instance's current properties, and pass that buffer into the store via the manager.

Returns:
This group's handle, or 0, if the code module group manager has not yet assigned this group a valid handle.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

containsModule

public boolean containsModule(String moduleName)
Determines if this code module group contains a named code module.

Parameters:
moduleName - Name of the module to look for.
Returns:
True if named module appears in this group; otherwise, false.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

addModule

public void addModule(String moduleName)
Adds a named module to this code module group.

Parameters:
moduleName - Name of the module to add to this gorup.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

getDependencies

public Enumeration getDependencies()
Retrieves the list of code module groups that this group depends upon.

Returns:
Enumeration of the names of this code module group's dependencies (as Strings).
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

addDependency

public void addDependency(String groupName)
Adds a code module group to this group's list of dependencies.

Parameters:
groupName - Group upon which this code module group depends.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

containsDependency

public boolean containsDependency(String groupName)
Determines if a group is a dependency for this code module group.

Parameters:
groupName - Group which might be a dependency for this code module group.
Returns:
True if this code module group includes your provided group in its list of dependencies; otherwise, false.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

getFlags

public int getFlags()
Retrieves this code module group's flag mask.

Returns:
Combined set of relevant FLAG_* mask flags for this module group.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

setFlag

public void setFlag(int flag,
                    boolean value)
Modifies status of a flag for this code module group.

Use this method to set or clear one of the FLAG_* mask flags for this module group.

Note: Only callers signed with the RRI key may modify the state of the CodeModuleGroup.FLAG_REQUIRED and CodeModuleGroup.FLAG_HIDDEN flags.

Parameters:
flag - Flag to set or clear.
value - True to set flag; false to clear flag.
Throws:
ControlledAccessException - If an unsigned caller attempts to set one of the restricted flags (FLAG_REQUIRED or FLAG_HIDDEN).
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

getFriendlyName

public String getFriendlyName()
Retrieves this code module group's default friendly name.

Returns:
Default friendly name for this group; if this group has no default friendly name set, this method returns the full group name instead.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

setFriendlyName

public void setFriendlyName(String friendlyName)
Sets a default friendly name for this code module group.

Parameters:
friendlyName - Default friendly name for this group.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

getDescription

public String getDescription()
Retrieves this code module group's default description.

Returns:
Default description for this group.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

setDescription

public void setDescription(String description)
Sets this code module group's default description.

Parameters:
description - Default description for this group.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

getVersion

public String getVersion()
Retrieves this code module group's default version string.

Returns:
Default version string for this group.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

setVersion

public void setVersion(String version)
Sets this code module group's default version string.

Parameters:
version - Default version string for this group.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

getVendor

public String getVendor()
Retrieves this code module group's default vendor string.

Returns:
Default vendor string for this group.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

setVendor

public void setVendor(String vendor)
Sets this code module group's default vendor.

Parameters:
vendor - Default vendor string for this group.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

getCopyright

public String getCopyright()
Retrieves this code module group's default copyright string.

Returns:
Default copyright string for this group.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

setCopyright

public void setCopyright(String copyright)
Sets this code module group's default copyright string.

Parameters:
copyright - Default copyright string for this group.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

getPropertyNames

public Enumeration getPropertyNames()
Retrieves an enumeration of this code module group's property names.

Use this method to find out what properties are currently set for this code module group. You can use CodeModuleGroup.getProperty(String) to retrieve the value for a named property, and CodeModuleGroup.setProperty(String,String) to set its value.

Returns:
Enumeration of the names of all the properties for this code module group, as Strings.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.2.0

getProperty

public String getProperty(String name)
Retrieves a property for this code module group, by name.

Use this method to retrieve the value of one of this module group's properties. You can use CodeModuleGroup.getPropertyNames() to retrieve an enumeration of the names of this group's properties, and CodeModuleGroup.setProperty(String,String) to set the value of a property.

Parameters:
name - Name of property to retrieve.
Returns:
Property value, or null, if this group contains no such property.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

setProperty

public void setProperty(String name,
                        String value)
Sets a property value for this code module group, by name.

Use this method to set the value of one of this module group's properties (identifying it by name). You can use CodeModuleGroup.getPropertyNames() to retrieve an enumeration of all the property names this group has, and CodeModuleGroup.getProperty(String) to retrieve the value for a single, named property.

Parameters:
name - Name of property to set; must not be null.
value - Value for the property; must not be null.
Throws:
NullPointerException - If you provide a null parameter.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

store

public boolean store()
Stores this code module group.

Returns:
True if this group successfully stored itself; otherwise, false.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

delete

public void delete()
Deletes this code module group from the module group store.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

equals

public boolean equals(Object o)
Determines if a provided object is equivalent to this code module group.

This method reports that o is equal to this code module group if and only if: o is a CodeModuleGroup instance and the object, o has the same code module group name as this code module group (it is permissable for both this module group and the provided module group to have null names: in this case, both groups have probably been deleted from the system, or not yet stored).

Overrides:
equals in class Object
Parameters:
o - Object to compare for equality with this code module group.
Returns:
True if your provided object is a code module group with the same group name as this code module group.
See Also:
Boolean.hashCode(), Hashtable
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

hashCode

public int hashCode()
Retrieves the hashcode value for this code module group.

Overrides:
hashCode in class Object
Returns:
Hash value for this code module group, or 0, if this module group has no name.
See Also:
Object.equals(java.lang.Object), Hashtable
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 5.0.0

load

public static CodeModuleGroup load(String groupName)
Deprecated. Use CodeModuleGroupManager.load(String) instead.

Loads code module group by name.

This method fetches the code module group's data from the module group store and uses it to populate a new instance.

Parameters:
groupName - Name of group to load; must not be null.
Returns:
Instance encapsulating the named group; or null if the module group manager knows of no such group, or cannot load it for you.
Throws:
IllegalArgumentException - If your group name parameter is too long (longer than 256 characters).
NullPointerException - If you provide a null group name.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2

loadAll

public static CodeModuleGroup[] loadAll()
Deprecated. Use CodeModuleGroupManager.loadAll() instead.

Loads all known code module groups.

Returns:
Array of all known and loadable code module groups; or, null if the list retrieved from the code module manager has no members, or the manager cannot make available a list of groups.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.2





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal