Interface MetaObject
public interface MetaObject
{
// Methods
public Object getObject(Category category, Class cls);
public boolean hasObject(Category category, Class cls);
public Enumeration objectCategories();
public Enumeration objectClasses(Category category);
}
This interface defines an abstraction for an object that has multiple identities. A class that implements the MetaObject interface can be used to represent data that is being transferred.
public Object getObject(Category category, Class cls);
Retrieves an object instance that matches the specified Category and Class objects. Either one (but not both) of the parameters can be null.
Return Value:
Returns an object that matches the specified Category and Class; returns null if no matching object is available.
Parameter | Description |
category
| The Category of the requested object. If a null Category object is specified, the Category is derived from the name of the specified class.
|
cls
| The Class of the requested object. If a null Class is specified, the request is for any object in the specified category.
|
public boolean hasObject(Category category, Class cls);
Determines whether the specified Category and Class are supported by the MetaObject. Either one (but not both) of the parameters can be null.
Return Value:
Returns true if an object that matches the specified Category and Class is available; otherwise, returns false.
Parameter | Description |
category
| The Category that is requested. If a null Category object is specified, the category is derived from the name of the specified class.
|
cls
| The Class that is requested. If a null Class is specified, the request is for any class in the specified category.
|
public Enumeration objectCategories();
Enumerates the categories that are supported by the MetaObject.
Return Value:
Returns an Enumeration of the Category objects that are supported.
public Enumeration objectClasses(Category category);
Enumerates the classes that are used to describe the specified category.
Return Value:
Returns an Enumeration of Class objects in the specified Category that are supported by the MetaObject.
Parameter | Description |
category
| The Category to enumerate Class objects from.
|