com.ca.directory.jxplorer.viewer.tableviewer
Class AttributeValue

java.lang.Object
  |
  +--com.ca.directory.jxplorer.viewer.tableviewer.AttributeValue
All Implemented Interfaces:
EditableBinary, EditableString

public class AttributeValue
extends java.lang.Object
implements EditableBinary, EditableString

TableAttributeEditor utility class; encapsulates the idea of an editable (String) attribute value, as displayed in a table. It also checks to see if an attribute is Binary, and sets a 'binary' flag as a warning to cell editors to use special handling.


Field Summary
 java.lang.Object value
           
 
Constructor Summary
AttributeValue(java.lang.String ID, java.lang.Object v)
          initialise with an object, take a backup, and set changed to false
 
Method Summary
 java.lang.Object backup()
           
 boolean changed()
           
 java.lang.String getID()
           
 java.lang.String[] getOptions()
          adds a list of suggested options to the Attribute Value...
 java.lang.String getStringValue()
          te: gets the value of the edited object.
 byte[] getValue()
          gets the value of the edited object.
 boolean hasOptions()
          Whether the Attribute Value has been given a set of suggested values.
 boolean isBinary()
           
 boolean isEmpty()
           
 boolean isNaming()
          Returns whether this value is a naming value.
 void reset()
          reset the value back to what it was initialised with.
 void setBinary(boolean bin)
          sets the binary-ness of the attribute (this may be known externally from schema).
 void setNamingStatus(boolean state)
          sets whether this value is a naming value (e.g. the 'Smith' in cn=Smith).
 void setOptions(java.lang.String[] ops)
          adds a list of suggested options to the Attribute Value...
 void setStringValue(java.lang.String b)
          synonym for update, used for EditableString interface...
 void setValue(byte[] b)
          synonym for update, used for EditableBinary interface...
 boolean testBinary()
          Checks whether the object is binary (actually, it checks if the object isn't a String...)
 java.lang.String toString()
          Returns value as string.
 void update(java.lang.Object data)
          update object
 java.lang.Object value()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

public java.lang.Object value
Constructor Detail

AttributeValue

public AttributeValue(java.lang.String ID,
                      java.lang.Object v)
initialise with an object, take a backup, and set changed to false

Method Detail

setNamingStatus

public void setNamingStatus(boolean state)
sets whether this value is a naming value (e.g. the 'Smith' in cn=Smith).


isNaming

public boolean isNaming()
Returns whether this value is a naming value.


hasOptions

public boolean hasOptions()
Whether the Attribute Value has been given a set of suggested values.


setOptions

public void setOptions(java.lang.String[] ops)
adds a list of suggested options to the Attribute Value...


getOptions

public java.lang.String[] getOptions()
adds a list of suggested options to the Attribute Value...


update

public void update(java.lang.Object data)
update object


setValue

public void setValue(byte[] b)
synonym for update, used for EditableBinary interface...

Specified by:
setValue in interface EditableBinary
Parameters:
b - an array of bytes that may be edited later.

setStringValue

public void setStringValue(java.lang.String b)
synonym for update, used for EditableString interface...

Specified by:
setStringValue in interface EditableString

getValue

public byte[] getValue()
Description copied from interface: EditableBinary
gets the value of the edited object.

Specified by:
getValue in interface EditableBinary
Returns:
the array of edited bytes.

getStringValue

public java.lang.String getStringValue()
Description copied from interface: EditableString
te: gets the value of the edited object.

Specified by:
getStringValue in interface EditableString
Returns:
the edited String.

reset

public void reset()
reset the value back to what it was initialised with.


setBinary

public void setBinary(boolean bin)
sets the binary-ness of the attribute (this may be known externally from schema).


testBinary

public boolean testBinary()
Checks whether the object is binary (actually, it checks if the object isn't a String...)


isEmpty

public boolean isEmpty()

toString

public java.lang.String toString()
Returns value as string. NB. - returns null values and empty Strings as 1 character blanks, in order to get buggy Swing printing junk to work.

Overrides:
toString in class java.lang.Object

getID

public java.lang.String getID()

changed

public boolean changed()

value

public java.lang.Object value()

backup

public java.lang.Object backup()

isBinary

public boolean isBinary()