|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.common.generic.propertybrowser.ObjectDescriptorMgr
public final class ObjectDescriptorMgr
This singleton class manages ObjectDescriptor objects.
The ObjectDescriptorMgr class accesses object descriptors for a particular class.
The descriptor is expected to reside in the same location as the class file of the class
(named "AbcProp.xml" if the class name is "Abc").
The manager will automatically locate and locate the object descriptor for this class.
After loading the OD, the object descriptor manager will iterate the property list.
The manager will try to resolve attribute information of a property that is not set
(e. g. description, type name, editor class name) from the OD of the super class
or from the OD of its implemented interfaces.
This means that for common attributes you only need to specify their property name
in the property descriptor list; the remaining information about the property will
be retrieved from the base class.
In addition to the regular object descriptors, the manager also supports custom descriptors.
These descriptors may override the regular descriptors. The custom descriptors are grouped
in custom descriptor sets. A set is located in a sub directory of the custom descriptor directory
(setCustomDescriptorResourcePath(java.lang.String)). Each descriptor file of the set must be named by the
fully qualified class name of the class to describe with the ending "Prop.xml" appended
(e. g. "org.openbp.common.generic.description.DisplayObjectProp.xml").
A set can be activated by calling loadCustomDescriptorSet(java.lang.String).
| Field Summary | |
|---|---|
static int |
ODM_EXCLUDE_CUSTOM
Flag for getDescriptor(java.lang.Class, int): Consider custom descriptors. |
static int |
ODM_THROW_ERROR
Flag for getDescriptor(java.lang.Class, int): Throw error if descriptor not found. |
| Method Summary | |
|---|---|
void |
clearCache()
Clears the cache of the node structure manager. |
java.lang.String |
getCustomDescriptorResourcePath()
Gets the resource path to folder that may contain sub folders with custom descriptors. |
ObjectDescriptor |
getDescriptor(java.lang.Class cls,
int flags)
Gets the descriptor for a particular object class. |
static ObjectDescriptorMgr |
getInstance()
Gets the singleton instance of this class. |
void |
loadCustomDescriptors(java.lang.String resourcePath)
Loads custom descriptors from the specified resource path. |
void |
loadCustomDescriptorSet(java.lang.String customDescriptorSetName)
Loads the specified custom descriptor set or clears the set. |
void |
setCustomDescriptorResourcePath(java.lang.String customDescriptorResourcePath)
Sets the resource path to folder that may contain sub folders with custom descriptors. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ODM_THROW_ERROR
getDescriptor(java.lang.Class, int): Throw error if descriptor not found.
If set, the method will throw an exception if the descriptor could not be loaded.
public static final int ODM_EXCLUDE_CUSTOM
getDescriptor(java.lang.Class, int): Consider custom descriptors.
If set, the method will use only regular descriptors.
Otherwise, it will look for custom descriptors also
(see setCustomDescriptorResourcePath(java.lang.String)/loadCustomDescriptorSet(java.lang.String)).
| Method Detail |
|---|
public static ObjectDescriptorMgr getInstance()
public ObjectDescriptor getDescriptor(java.lang.Class cls,
int flags)
throws XMLDriverException
cls - Class to load the mapping forflags - Flags the control the way the method works (ODM_THROW_ERROR|ODM_EXCLUDE_CUSTOM)
XMLDriverException - If no descriptor file exists for this classpublic void clearCache()
public java.lang.String getCustomDescriptorResourcePath()
public void setCustomDescriptorResourcePath(java.lang.String customDescriptorResourcePath)
public void loadCustomDescriptorSet(java.lang.String customDescriptorSetName)
throws XMLDriverException
setCustomDescriptorResourcePath(java.lang.String).
customDescriptorSetName - The set name or null if only the regular descriptors should be used
XMLDriverException - If the specified set or the set directory does not exist
public void loadCustomDescriptors(java.lang.String resourcePath)
throws XMLDriverException
resourcePath - ResourcePath of the resource folder to load the descriptors from
XMLDriverException - If the specified directory does not exist
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||