Package net.sf.basedb.core
Class SystemItems
java.lang.Object
net.sf.basedb.core.SystemItems
This class is used to map the system id of all
SystemData
items to the numerical internal
id in the current installation. This information is initialised
at startup and is then kept in memory.- Version:
- 2.0
- Author:
- Nicklas
- Last modified
- $Date: 2021-06-04 14:00:54 +0200 (Fri, 04 Jun 2021) $
-
Field Summary
Modifier and TypeFieldDescriptionprivate static boolean
private static int[]
An array to hold mappings forRoleKeyData
: RoleKeyData.itemType --> RoleKeyData.idA map from system id --> numeric id -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) static void
add
(SystemData item) Register a system item.(package private) static void
addRoleKey
(RoleKeyData roleKey) Register a role key.static int
Get the numeric id for an item when you know the system id.static int
getRoleKeyId
(Item itemType) (package private) static void
init()
Initialize the class and load all mappings for item.systemId --> item.id and for RoleKeyData.itemType --> RoleKeyData.id(package private) static void
unload()
Unload all settings.
-
Field Details
-
isInitialised
private static boolean isInitialised -
systemIds
A map from system id --> numeric id -
roleKeys
private static int[] roleKeysAn array to hold mappings forRoleKeyData
: RoleKeyData.itemType --> RoleKeyData.id
-
-
Constructor Details
-
SystemItems
public SystemItems()
-
-
Method Details
-
init
Initialize the class and load all mappings for item.systemId --> item.id and for RoleKeyData.itemType --> RoleKeyData.id- Throws:
BaseException
- If there is an error
-
unload
static void unload()Unload all settings. -
add
Register a system item. Used by theInstall
class while creating new items. -
getId
Get the numeric id for an item when you know the system id.- Parameters:
systemId
- The system id string- Returns:
- The numeric id of the item, or 0 if it could not be found
-
addRoleKey
Register a role key. Used by theInstall
class while creating new items. -
getRoleKeyId
- Parameters:
itemType
- The item type code as defined by theItem
class- Returns:
- The numeric id for the RoleKey
-