com.ibm.ram.client
Class RAMAssetAttribute

java.lang.Object
  extended by com.ibm.ram.common.data.AssetAttribute
      extended by com.ibm.ram.client.RAMAssetAttribute
Direct Known Subclasses:
RAMResourceAttribute

public class RAMAssetAttribute
extends AssetAttribute

Represents a custom attribute that is defined on an asset or an asset type. On an asset type, you might define which attributes are applicable or required for a that type. After attributes are bound to an asset type, the assets become visible to assets of that type. On an asset, you can get and set values of an attribute.

Since:
7.1
Author:
kbauer

Field Summary
 
Fields inherited from class com.ibm.ram.common.data.AssetAttribute
TYPE_BOOLEAN, TYPE_DATE, TYPE_LINK, TYPE_NUMBER, TYPE_RESOURCE, TYPE_TEXT, TYPE_USER, TYPE_XML
 
Method Summary
 void addValue(java.lang.String value)
          Add a value to the list of set values for this attribute.
 RAMAction getAction()
          Set the action to be performed on the session object.
protected  RAMAsset getAsset()
           
 java.lang.String getConfiguration()
           
 java.lang.String getDescription()
          The optional description.
 java.lang.String getName()
          Get the name of the attribute.
 RAMSession getSession()
          Return the session this type was fetched from.
 java.lang.String getType()
           
 java.lang.String getURI()
          The string will be fully-qualified.
 java.lang.String[] getValidValues()
          Get the array of valid settings.
 java.lang.String[] getValues()
          Returns the value of this custom attribute
 boolean isDirty()
          Returns true if the Object has been modified from the copy on the server
 boolean isRestrictedSetting()
          Answer whether this is a standard any value setting, or if it is a restricted value setting (i.e.
 boolean isSingleSetting()
          Answer whether this is a single setting attribute of a multi-setting attribute.
 void setAction(RAMAction action)
          Set the action to be performed when passed to RAMSession#put(IRAMSessionObject, org.eclipse.core.runtime.IProgressMonitor) Accepts RAMAction.CREATE RAMAction.UPDATE RAMAction.DELETE
 void setDescription(java.lang.String description)
           
 void setName(java.lang.String name)
           
 void setRestrictedSetting(boolean restrictedSetting)
          The array of valid settings.
 void setSingleSetting(boolean singleSetting)
           
 void setType(java.lang.String type)
           
 void setURI(java.lang.String uriString)
           
 void setValidValues(java.lang.String[] validSettings)
           
 void setValues(java.lang.String[] value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()
Description copied from class: AssetAttribute
Get the name of the attribute.

Overrides:
getName in class AssetAttribute
Returns:
the attribute name. If it could not be resolved then this would be the uri string.

setName

public void setName(java.lang.String name)
Overrides:
setName in class AssetAttribute
Parameters:
name - The name to set.

getValues

public java.lang.String[] getValues()
Description copied from class: AssetAttribute
Returns the value of this custom attribute

Overrides:
getValues in class AssetAttribute

setValues

public void setValues(java.lang.String[] value)
               throws RAMRuntimeException
Overrides:
setValues in class AssetAttribute
Throws:
RAMRuntimeException

addValue

public void addValue(java.lang.String value)
Add a value to the list of set values for this attribute. This method only applies to attributes obtained from the Asset.

Parameters:
value -
Since:
7.1

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDescription

public java.lang.String getDescription()
Description copied from class: AssetAttribute
The optional description.

Overrides:
getDescription in class AssetAttribute
Returns:
Returns the description. null if there is no description.

setDescription

public void setDescription(java.lang.String description)
Overrides:
setDescription in class AssetAttribute
Parameters:
description - The description to set.

getURI

public java.lang.String getURI()
Description copied from class: AssetAttribute
The string will be fully-qualified.

Overrides:
getURI in class AssetAttribute
Returns:
Returns the uriString.

getValidValues

public java.lang.String[] getValidValues()
Description copied from class: AssetAttribute
Get the array of valid settings. This is only valid if AssetAttribute.isRestrictedSetting() returns true.

Overrides:
getValidValues in class AssetAttribute
Returns:
Returns the validSettings.
See Also:
AssetAttribute.isRestrictedSetting(), AssetAttribute.isSingleSetting()

setValidValues

public void setValidValues(java.lang.String[] validSettings)
Overrides:
setValidValues in class AssetAttribute
Parameters:
validSettings - The validSettings to set.

isRestrictedSetting

public boolean isRestrictedSetting()
Description copied from class: AssetAttribute
Answer whether this is a standard any value setting, or if it is a restricted value setting (i.e. only values from a specific list).

Overrides:
isRestrictedSetting in class AssetAttribute
Returns:
true if restricted, false if no restriction.

setRestrictedSetting

public void setRestrictedSetting(boolean restrictedSetting)
Description copied from class: AssetAttribute
The array of valid settings. This is only valid if AssetAttribute.isRestrictedSetting() returns true.

Overrides:
setRestrictedSetting in class AssetAttribute
See Also:
AssetAttribute.isRestrictedSetting(), AssetAttribute.isSingleSetting()

isSingleSetting

public boolean isSingleSetting()
Description copied from class: AssetAttribute
Answer whether this is a single setting attribute of a multi-setting attribute. This is only valid if AssetAttribute.isRestrictedSetting() returns true.

Overrides:
isSingleSetting in class AssetAttribute
Returns:
Returns if this is a single-setting attribute (only one setting can selected).

setSingleSetting

public void setSingleSetting(boolean singleSetting)
Overrides:
setSingleSetting in class AssetAttribute
Parameters:
singleSetting - The singleSetting to set.

getSession

public RAMSession getSession()
Return the session this type was fetched from. This method will return null if the attribute was fetched from an asset.

Returns:
Since:
7.1

isDirty

public boolean isDirty()
Returns true if the Object has been modified from the copy on the server

Returns:

setURI

public void setURI(java.lang.String uriString)
Overrides:
setURI in class AssetAttribute
Parameters:
uriString - The uriString to set.

getAsset

protected RAMAsset getAsset()

getAction

public RAMAction getAction()
Set the action to be performed on the session object. Each object will have it's own set of actions it will accept

Returns:

setAction

public void setAction(RAMAction action)
Set the action to be performed when passed to RAMSession#put(IRAMSessionObject, org.eclipse.core.runtime.IProgressMonitor) Accepts RAMAction.CREATE RAMAction.UPDATE RAMAction.DELETE

Parameters:
action -
Since:
7.1

getType

public java.lang.String getType()
Overrides:
getType in class AssetAttribute
Returns:
Returns the type.

setType

public void setType(java.lang.String type)
Overrides:
setType in class AssetAttribute
Parameters:
type - The type to set.

getConfiguration

public java.lang.String getConfiguration()
Returns:
Since:
7.1.1