com.sun.wbem.cim
Class CIMProperty

java.lang.Object
  |
  +--com.sun.wbem.cim.CIMElement
        |
        +--com.sun.wbem.cim.CIMProperty

public class CIMProperty
extends CIMElement
implements java.lang.Cloneable

Creates and instantiates a CIM property, a name/value pair used to characterize instances of a class. Use this API to create a new attribute to describe managed objects. For example, after a printer upgrade to handle duplex (two-sided) printing, you could use this interface to create a CIM property called duplex. The CIMProperty class inherits the property name from its parent class (CIMProperty extends CIMElement). A CIM Property is defined by its name and origin class. Two or more properties can have the same name, but the origin class uniquely identifies the property.

Since:
WBEM 1.0
See Also:
Serialized Form

Constructor Summary
CIMProperty()
          Class constructor creates a new instance of a CIM property
CIMProperty(java.lang.String name)
          Class constructor uses an existing CIM property as a template for creating a new instance of a CIM property.
CIMProperty(java.lang.String n, CIMValue v)
          Class constructor uses an existing CIM property as a template for creating a new instance of a CIM property.
 
Method Summary
 void addQualifier(CIMQualifier cq)
          Adds the specified CIM qualifier to this property.
 java.lang.Object clone()
          Makes a copy of this property, including property name, identifier, type, origin class, size, value, and qualifiers.
 java.lang.Object clone(boolean includeQualifier, boolean includeClassOrigin)
          Makes a copy of this property, including property name, identifier, type, origin class, size, value, and qualifiers.
 java.lang.String getOriginClass()
          Returns the class in which this property was defined.
 java.lang.String getOverridingProperty()
          Gets the overriding property
 CIMQualifier getQualifier(java.lang.String name)
          Returns the specified CIM qualifier, an object that modifies this property.
 java.util.Vector getQualifiers()
          Returns the list of CIM qualifiers for this property
 int getSize()
          Returns the size of this property object.
 CIMDataType getType()
          Gets the CIM data type of this property
 CIMValue getValue()
          Gets the value for this property
 boolean isKey()
          Convenience method for getting a qualifier name key.
 boolean isReference()
          Identifies whether or not this CIM Property data type is a reference to an instance (link to another CIM object).
 boolean removeQualifier(java.lang.String name)
          Removes the specified CIM qualifier from the property.
 void setOriginClass(java.lang.String originClass)
          Sets the class in which this property was defined.
 void setOverridingProperty(java.lang.String name)
          Specifies this property as an overriding property
 CIMQualifier setQualifier(CIMQualifier cq)
          Sets a qualifier for this property
 void setQualifiers(java.util.Vector q)
          Sets the list of CIM qualifiers for this property.
 void setSize(int aSize)
          Sets the size of this property to the integer argument
 void setType(CIMDataType aType)
          Sets the data type of this property to the specified CIM data type.
 void setValue(CIMValue aValue)
          Sets the value for this property.
 java.lang.String toMOF()
          Returns a MOF representation of the CIMProperty.
 java.lang.String toString()
          Returns a String representation of the CIMProperty.
 java.lang.String toXml()
          Returns an XML representation of this CIM property.
 
Methods inherited from class com.sun.wbem.cim.CIMElement
assign, equals, getName, lessThan, setName
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CIMProperty

public CIMProperty()
Class constructor creates a new instance of a CIM property

CIMProperty

public CIMProperty(java.lang.String name)
Class constructor uses an existing CIM property as a template for creating a new instance of a CIM property. This class takes a string for the name of an existing CIM property and uses its name, size, qualifiers, and values to create this CIM property.
Parameters:
name - name of an existing CIM property

CIMProperty

public CIMProperty(java.lang.String n,
                   CIMValue v)
Class constructor uses an existing CIM property as a template for creating a new instance of a CIM property. This class uses the string name and CIM value of of an existing CIM property to construct this CIM property.
Parameters:
n - name of an existing CIM property
v - CIM value of an existing CIM property
Method Detail

getQualifiers

public java.util.Vector getQualifiers()
Returns the list of CIM qualifiers for this property
Returns:
A Vector of CIM qualifiers for this property.

setQualifiers

public void setQualifiers(java.util.Vector q)
Sets the list of CIM qualifiers for this property.
Parameters:
q - The vector representing the list of CIM qualifiers

getOriginClass

public java.lang.String getOriginClass()
Returns the class in which this property was defined.
Returns:
Name of class where this property was defined.

setOriginClass

public void setOriginClass(java.lang.String originClass)
Sets the class in which this property was defined.
Parameters:
originClass - The name of the class in which this property is defined.

setValue

public void setValue(CIMValue aValue)
Sets the value for this property.
Parameters:
aValue - the CIM value for this property

getValue

public CIMValue getValue()
Gets the value for this property
Returns:
The CIM value for this property.

setType

public void setType(CIMDataType aType)
Sets the data type of this property to the specified CIM data type. A Property data type can be one of the defined CIM data types or a special data type, which is a reference to an instance of a class. A CIM property can have an infinite number of instance references.
Parameters:
aType - the CIM data type of this property

getType

public CIMDataType getType()
Gets the CIM data type of this property
Returns:
The CIM data type of this property.

getSize

public int getSize()
Returns the size of this property object. Size is meaningful in the context of datatype. For example, a 64-bit integer is 8 bytes long, so the size is 8. An array of 8 64-bit integers has 8 elements, so the size is also 8 (8 elements).
Returns:
int the integer size of the property

setSize

public void setSize(int aSize)
Sets the size of this property to the integer argument
Parameters:
aSize - the integer size of this property object

setOverridingProperty

public void setOverridingProperty(java.lang.String name)
Specifies this property as an overriding property
Parameters:
name - the name of the property

getOverridingProperty

public java.lang.String getOverridingProperty()
Gets the overriding property
Returns:
The name of the overriding property.

isReference

public boolean isReference()
Identifies whether or not this CIM Property data type is a reference to an instance (link to another CIM object). For example, you might want to show properties that are references to instances by using different icons on a GUI. Returns true if this property is a CIM reference Otherwise, returns false.
Returns:
True if this property is a CIM reference. Otherwise, false.

getQualifier

public CIMQualifier getQualifier(java.lang.String name)
Returns the specified CIM qualifier, an object that modifies this property. This method gets a particular qualifier. For example, you might want to know if a property is read-only or writable. An application might use this method to check the read/write status of a qualifier that a users attempts to edit on the GUI.
Parameters:
name - The name of the qualifier to get.
Returns:
null if the qualifier does not exist, otherwise returns the reference to the qualifier.

setQualifier

public CIMQualifier setQualifier(CIMQualifier cq)
                          throws CIMException
Sets a qualifier for this property
Parameters:
cq - The qualifier to set
Throws:
CIMException - if the qualifier does not exist

addQualifier

public void addQualifier(CIMQualifier cq)
                  throws CIMException
Adds the specified CIM qualifier to this property.
Parameters:
cq - The qualifier to add
Throws:
CIMException - if the qualifier already exists.

removeQualifier

public boolean removeQualifier(java.lang.String name)
Removes the specified CIM qualifier from the property.
Parameters:
name - The name of the qualifier to remove.
Returns:
True if the qualifier exists, else false.

toString

public java.lang.String toString()
Returns a String representation of the CIMProperty. This method is intended to be used only for debugging purposes, and the format of the returned string may vary between implementations. The returned string may be empty but may not be null.
Overrides:
toString in class CIMElement
Returns:
A string representation of this property.

toMOF

public java.lang.String toMOF()
Returns a MOF representation of the CIMProperty.
Returns:
A string representation of this property in Managed Object Format (MOF).

clone

public java.lang.Object clone()
Makes a copy of this property, including property name, identifier, type, origin class, size, value, and qualifiers.
Returns:
Newly created property.

clone

public java.lang.Object clone(boolean includeQualifier,
                              boolean includeClassOrigin)
Makes a copy of this property, including property name, identifier, type, origin class, size, value, and qualifiers.
Parameters:
includeQualifier - qualifiers are only included if true.
includeClassOrigin - classOrigin is only included if true.
Returns:
Object Newly created property

isKey

public boolean isKey()
Convenience method for getting a qualifier name key.
Returns:
True if qualifier name exists, otherwise false.

toXml

public java.lang.String toXml()
Returns an XML representation of this CIM property.
Returns:
An XML representation of this CIM property, using XML elements from the default XML namespace.