Package org.osgi.jmx
Class Item
java.lang.Object
org.osgi.jmx.Item
The item class enables the definition of open types in the appropriate
interfaces.
This class contains a number of methods that make it possible to create open
types for
CompositeType, TabularType, and ArrayType.
The normal creation throws a checked exception, making it impossible to use
them in a static initializer. They constructors are also not very suitable
for static construction.
An Item instance describes an item in a Composite Type. It groups the triplet
of name, description, and Open Type. These Item instances allows the
definitions of an item to stay together.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ArrayType<T> Return a new Array Type.static CompositeTypecompositeType(String name, String description, Item... items) Create a Composite Typestatic CompositeTypeextend(CompositeType parent, String name, String description, Item... items) Extend a Composite Type by adding new items.static TabularTypetabularType(String name, String description, CompositeType rowType, String... index) Create a Tabular Type.
-
Constructor Details
-
Item
Create a triple of name, description, and type. This triplet is used in the creation of a Composite Type.- Parameters:
name- The name of the item.description- The description of the item.type- The Open Type of this item.restrictions- Ignored, contains list of restrictions
-
-
Method Details
-
tabularType
public static TabularType tabularType(String name, String description, CompositeType rowType, String... index) Create a Tabular Type.- Parameters:
name- The name of the Tabular Type.description- The description of the Tabular Type.rowType- The Open Type for a rowindex- The names of the items that form the index .- Returns:
- A new Tabular Type composed from the parameters.
- Throws:
RuntimeException- when the Tabular Type throws an OpenDataException
-
compositeType
Create a Composite Type- Parameters:
name- The name of the Tabular Type.description- The description of the Tabular Type.items- The items that describe the composite type.- Returns:
- a new Composite Type
- Throws:
RuntimeException- when the Tabular Type throws an OpenDataException
-
arrayType
Return a new Array Type.- Parameters:
dim- The dimensionelementType- The element type- Returns:
- A new Array Type
-
extend
public static CompositeType extend(CompositeType parent, String name, String description, Item... items) Extend a Composite Type by adding new items. Items can override items in the parent type.- Parameters:
parent- The parent type, can benullname- The name of the typedescription- The description of the typeitems- The items that should be added/override to the parent type- Returns:
- A new Composite Type that extends the parent type
- Throws:
RuntimeException- when an OpenDataException is thrown
-