Top Description Fields Methods
org.osgi.service.metatype

public Interface ObjectClassDefinition

Annotations
@ConsumerType
Imports
java.io.IOException, .InputStream, org.osgi.annotation.versioning.ConsumerType

Description for the data type information of an objectclass.
Author
$Id: 0162e2ef898ba8950c00d30a5d819cd4d720e160 $

Field Summary

Modifier and TypeField and Description
public static final int
ALL

Argument for getAttributeDefinitions(int).

public static final int
OPTIONAL

Argument for getAttributeDefinitions(int).

public static final int
REQUIRED

Argument for getAttributeDefinitions(int).

Method Summary

Modifier and TypeMethod and Description
public AttributeDefinition[]

Returns:

An array of attribute definitions or null if no attributes are selected
getAttributeDefinitions
(int
ALL,REQUIRED,OPTIONAL
filter
)

Return the attribute definitions for this object class.

public String

Returns:

The description of this object class.
getDescription
()

Return a description of this object class.

public InputStream

Returns:

An InputStream representing an icon or null
getIcon
(int
Requested size of an icon. For example, a 16x16 pixel icon has a size of 16
size
)

Return an InputStream object that can be used to create an icon from.

public String

Returns:

The id of this object class.
getID
()

Return the id of this object class.

public String

Returns:

The name of this object class.
getName
()

Return the name of this object class.

Field Detail

ALLback to summary
public static final int ALL

Argument for getAttributeDefinitions(int).

ALL indicates that all the definitions are returned. The value is -1.

OPTIONALback to summary
public static final int OPTIONAL

Argument for getAttributeDefinitions(int).

OPTIONAL indicates that only the optional definitions are returned. The value is 2.

REQUIREDback to summary
public static final int REQUIRED

Argument for getAttributeDefinitions(int).

REQUIRED indicates that only the required definitions are returned. The value is 1.

Method Detail

getAttributeDefinitionsback to summary
public AttributeDefinition[] getAttributeDefinitions(int filter)

Return the attribute definitions for this object class.

Return a set of attributes. The filter parameter can distinguish between ALL,REQUIRED or the OPTIONAL attributes.

Parameters
filter:int

ALL,REQUIRED,OPTIONAL

Returns:AttributeDefinition[]

An array of attribute definitions or null if no attributes are selected

getDescriptionback to summary
public String getDescription()

Return a description of this object class. The description may be localized.

Returns:String

The description of this object class.

getIconback to summary
public InputStream getIcon(int size) throws IOException

Return an InputStream object that can be used to create an icon from.

Indicate the size and return an InputStream object containing an icon. The returned icon maybe larger or smaller than the indicated size.

The icon may depend on the localization.

Parameters
size:int

Requested size of an icon. For example, a 16x16 pixel icon has a size of 16

Returns:InputStream

An InputStream representing an icon or null

Exceptions
IOException:
If the InputStream cannot be returned.
getIDback to summary
public String getID()

Return the id of this object class.

ObjectDefintion objects share a global namespace in the registry. They share this aspect with LDAP/X.500 attributes. In these standards the OSI Object Identifier (OID) is used to uniquely identify object classes. If such an OID exists, (which can be requested at several standard organizations and many companies already have a node in the tree) it can be returned here. Otherwise, a unique id should be returned which can be a Java class name (reverse domain name) or generated with a GUID algorithm. Note that all LDAP defined object classes already have an OID associated. It is strongly advised to define the object classes from existing LDAP schemes which will give the OID for free. Many such schemes exist ranging from postal addresses to DHCP parameters.

Returns:String

The id of this object class.

getNameback to summary
public String getName()

Return the name of this object class. The name may be localized.

Returns:String

The name of this object class.