The interface has several types of functions to describe the nodes in the DMT. Some methods can be used to retrieve standard OMA DM metadata such as access type, cardinality, default, etc., others are for data extensions such as valid names and values. In some cases the standard behavior has been extended, for example it is possible to provide several valid MIME types, or to differentiate between normal and automatic dynamic nodes.
Most methods in this interface receive no input, just return information
about some aspect of the node. However, there are two methods that behave
differently, isValidName(String) and isValidValue(DmtData).
These validation methods are given a potential node name or value
(respectively), and can decide whether it is valid for the given node.
Passing the validation methods is a necessary condition for a name or value
to be used, but it is not necessarily sufficient: the plugin may carry out
more thorough (more expensive) checks when the node is actually created or
set.
If a MetaNode is available for a node, the DmtAdmin must use the
information provided by it to filter out invalid requests on that node.
However, not all methods on this interface are actually used for this
purpose, as many of them (e.g. getFormat() or
getValidNames()) can be substituted with the validating methods. For
example, isValidValue(DmtData) can be expected to check the format,
minimum, maximum, etc. of a given value, making it unnecessary for the
DmtAdmin to call getFormat(), getMin(), getMax()
etc. separately. It is indicated in the description of each method if the
DmtAdmin does not enforce the constraints defined by it - such methods are
only for external use, for example in user interfaces.
Most of the methods of this class return null if a certain piece of
meta information is not defined for the node or providing this information is
not supported. Methods of this class do not throw exceptions.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | AUTOMATIC
Constant for representing an automatic node in the tree. |
| public static final int | CMD_ADD
Constant for the ADD access type. |
| public static final int | CMD_DELETE
Constant for the DELETE access type. |
| public static final int | CMD_EXECUTE
Constant for the EXECUTE access type. |
| public static final int | CMD_GET
Constant for the GET access type. |
| public static final int | CMD_REPLACE
Constant for the REPLACE access type. |
| public static final int | DYNAMIC
Constant for representing a dynamic node in the tree. |
| public static final int | PERMANENT
Constant for representing a |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: false if the operation is not valid for this node or the
operation code is not one of the allowed constantsOne of the operation)MetaNode.CMD_... constants.Check whether the given operation is valid for this node. |
| public DmtData | Returns: The default value ornull if not definedGet the default value of this node if any. |
| public String | Returns: node description string ornull for no descriptionGet the explanation string associated with this node. |
| public Object | Returns: the value of the requested property, cannot benullthe key for the extension property key)Returns the value for the specified extension property key. |
| public String[] | Returns: the array of supported extension property keysReturns the list of extension property keys, if the provider of this
|
| public int | |
| public double | Returns: the allowed maximum, orDouble.MAX_VALUE if there is no
upper limit defined or the node's format is not one of the
numeric formats integer, float, or longGet the maximum allowed value associated with a node of numeric format. |
| public int | Returns: The maximum allowed occurrence of this node typeGet the number of maximum occurrences of this type of nodes on the same level in the DMT. |
| public String[] | Returns: the list of allowed MIME types for this node, starting with the default MIME type, ornull if all types are allowedGet the list of MIME types this node can hold. |
| public double | Returns: the allowed minimum, orDouble.MIN_VALUE if there is no
lower limit defined or the node's format is not one of the
numeric formats integer, float, or longGet the minimum allowed value associated with a node of numeric format. |
| public String[] | Returns: the allowed format name(s) of raw data stored by the node, ornull if raw formats are not supportedGet the format names for any raw formats supported by the node. |
| public int | |
| public String[] | Returns: the valid values for this node name, ornull if not
definedReturn an array of Strings if valid names are defined for the node, or
|
| public DmtData[] | Returns: the valid values for this node, ornull if not definedReturn an array of DmtData objects if valid values are defined for the
node, or |
| public boolean | Returns: true if the node is a leaf nodeCheck whether the node is a leaf node or an internal one. |
| public boolean | Returns: false if the specified name is found to be invalid for
the node described by this meta-node, true otherwisethe node name to check for validity name)Checks whether the given name is a valid name for this node. |
| public boolean | Returns: false if the specified value is found to be invalid for
the node described by this meta-node, true otherwisethe value to check for validity value)Checks whether the given value is valid for this node. |
| public boolean | Returns: true if zero occurrence of this node is validCheck whether zero occurrence of this node is valid. |
| AUTOMATIC | back to summary |
|---|---|
| public static final int AUTOMATIC Constant for representing an automatic node in the tree. This must be
returned by | |
| CMD_ADD | back to summary |
|---|---|
| public static final int CMD_ADD Constant for the ADD access type. If | |
| CMD_DELETE | back to summary |
|---|---|
| public static final int CMD_DELETE Constant for the DELETE access type. If | |
| CMD_EXECUTE | back to summary |
|---|---|
| public static final int CMD_EXECUTE Constant for the EXECUTE access type. If | |
| CMD_GET | back to summary |
|---|---|
| public static final int CMD_GET Constant for the GET access type. If | |
| CMD_REPLACE | back to summary |
|---|---|
| public static final int CMD_REPLACE Constant for the REPLACE access type. If | |
| DYNAMIC | back to summary |
|---|---|
| public static final int DYNAMIC Constant for representing a dynamic node in the tree. This must be
returned by | |
| PERMANENT | back to summary |
|---|---|
| public static final int PERMANENT Constant for representing a | |
| can | back to summary |
|---|---|
| public boolean can(int operation) Check whether the given operation is valid for this node. If no meta-data is provided for a node, all operations are valid.
| |
| getDefault | back to summary |
|---|---|
| public DmtData getDefault() Get the default value of this node if any.
| |
| getDescription | back to summary |
|---|---|
| public String getDescription() Get the explanation string associated with this node. Can be
| |
| getExtensionProperty | back to summary |
|---|---|
| public Object getExtensionProperty(String key) Returns the value for the specified extension property key. This method
only works if the provider of this
| |
| getExtensionPropertyKeys | back to summary |
|---|---|
| public String[] getExtensionPropertyKeys() Returns the list of extension property keys, if the provider of this
| |
| getFormat | back to summary |
|---|---|
| public int getFormat() Get the node's format, expressed in terms of type constants defined in
Note that the 'format' term is a legacy from OMA DM, it is more customary to think of this as 'type'.
The formats returned by this method are not checked by DmtAdmin, they are
only for external use, for example in user interfaces. DmtAdmin only
calls
| |
| getMax | back to summary |
|---|---|
| public double getMax() Get the maximum allowed value associated with a node of numeric format.
If no meta-data is provided for a node, there is no upper limit to its
value. This method is only meaningful if the node has one of the numeric
formats: integer, float, or long format. The returned limit has
The information returned by this method is not checked by DmtAdmin, it is
only for external use, for example in user interfaces. DmtAdmin only
calls
| |
| getMaxOccurrence | back to summary |
|---|---|
| public int getMaxOccurrence() Get the number of maximum occurrences of this type of nodes on the same
level in the DMT. Returns
| |
| getMimeTypes | back to summary |
|---|---|
| public String[] getMimeTypes() Get the list of MIME types this node can hold. The first element of the returned list must be the default MIME type.
All MIME types are considered valid if no meta-data is provided for a
node or if
| |
| getMin | back to summary |
|---|---|
| public double getMin() Get the minimum allowed value associated with a node of numeric format.
If no meta-data is provided for a node, there is no lower limit to its
value. This method is only meaningful if the node has one of the numeric
formats: integer, float, or long format. The returned limit has
The information returned by this method is not checked by DmtAdmin, it is
only for external use, for example in user interfaces. DmtAdmin only
calls
| |
| getRawFormatNames | back to summary |
|---|---|
| public String[] getRawFormatNames() Get the format names for any raw formats supported by the node. This
method is only meaningful if the list of supported formats returned by
The format names returned by this method are not checked by DmtAdmin,
they are only for external use, for example in user interfaces. DmtAdmin
only calls
| |
| getScope | back to summary |
|---|---|
| public int getScope() Return the scope of the node. Valid values are | |
| getValidNames | back to summary |
|---|---|
| public String[] getValidNames() Return an array of Strings if valid names are defined for the node, or
The information returned by this method is not checked by DmtAdmin, it is
only for external use, for example in user interfaces. DmtAdmin only
calls
| |
| getValidValues | back to summary |
|---|---|
| public DmtData[] getValidValues() Return an array of DmtData objects if valid values are defined for the
node, or
The information returned by this method is not checked by DmtAdmin, it is
only for external use, for example in user interfaces. DmtAdmin only
calls
| |
| isLeaf | back to summary |
|---|---|
| public boolean isLeaf() Check whether the node is a leaf node or an internal one.
| |
| isValidName | back to summary |
|---|---|
| public boolean isValidName(String name) Checks whether the given name is a valid name for this node. This method
can be used for example to ensure that the node name is always one of a
predefined set of valid names, or that it matches a specific pattern.
This method should be consistent with the values returned by
This method may return
| |
| isValidValue | back to summary |
|---|---|
| public boolean isValidValue(DmtData value) Checks whether the given value is valid for this node. This method can be
used to ensure that the value has the correct format and range, that it
is well formed, etc. This method should be consistent with the
constraints defined by the
This method may return
| |
| isZeroOccurrenceAllowed | back to summary |
|---|---|
| public boolean isZeroOccurrenceAllowed() Check whether zero occurrence of this node is valid. If no meta-data is returned for a node, zero occurrences are allowed.
| |