|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Property
The Property is a simple data object that contains one typed
value. This interface contains methods to inspect and modify the stored value
and its type, and the object's read-only state.
The Property also defines the events
ReadOnlyStatusChangeEvent and ValueChangeEvent,
and the associated listener and notifier
interfaces.
The Property.Viewer interface should be used to attach the
Property to an external data source. This way the value in the data source
can be inspected using the Property interface.
The Property.editor interface should be implemented if the
value needs to be changed through the implementing class.
| Nested Class Summary | |
|---|---|
static class |
Property.ConversionException
An exception that signals that the value passed to the setValue method couldn't be converted to the native type
of the Property. |
static interface |
Property.Editor
Interface implemented by the editor classes capable of editing the Property. |
static class |
Property.ReadOnlyException
Exception object that signals that a requested Property
modification failed because it's in read-only mode. |
static interface |
Property.ReadOnlyStatusChangeEvent
An Event object specifying the Property whose read-only
status has been changed. |
static interface |
Property.ReadOnlyStatusChangeListener
The listener interface for receiving ReadOnlyStatusChangeEvent objects. |
static interface |
Property.ReadOnlyStatusChangeNotifier
The interface for adding and removing ReadOnlyStatusChangeEvent listeners. |
static interface |
Property.ValueChangeEvent
An Event object specifying the Property whose value has
been changed. |
static interface |
Property.ValueChangeListener
The listener interface for receiving
ValueChangeEvent objects. |
static interface |
Property.ValueChangeNotifier
The interface for adding and removing ValueChangeEvent
listeners. |
static interface |
Property.Viewer
Interface implemented by the viewer classes capable of using a Property as a data source. |
| Method Summary | |
|---|---|
Class |
getType()
Returns the type of the Property. |
Object |
getValue()
Gets the value stored in the Property. |
boolean |
isReadOnly()
Tests if the Property is in read-only mode. |
void |
setReadOnly(boolean newStatus)
Sets the Property's read-only mode to the specified status. |
void |
setValue(Object newValue)
Sets the value of the Property. |
String |
toString()
Returns the value of the Property in human readable textual format. |
| Method Detail |
|---|
Object getValue()
void setValue(Object newValue)
throws Property.ReadOnlyException,
Property.ConversionException
Implementing this functionality is optional. If the functionality is
missing, one should declare the Property to be in read-only mode and
throw Property.ReadOnlyException in this function.
String in addition to the native type of
the Property (as given by the getType method). If the
String conversion fails or is unsupported, the method
should throw Property.ConversionException. The string
conversion should at least understand the format returned by the
toString method of the Property.
newValue - New value of the Property. This should be assignable to the
type returned by getType, but also String type should be
supported
Property.ReadOnlyException - if the object is in read-only mode
Property.ConversionException - if newValue can't be converted into the Property's native
type directly or through StringString toString()
setValue method
if the Property is not in read-only mode.
toString in class ObjectString representation of the value stored in the
PropertyClass getType()
getValue and
setValue must be compatible with this type: one must be
able to safely cast the value returned from getValue to
the given type and pass any variable assignable to this type as an
argument to setValue.
boolean isReadOnly()
setValue will throw
ReadOnlyException and will not modify the value of the
Property.
true if the Property is in read-only mode,
false if it's notvoid setReadOnly(boolean newStatus)
isReadOnly mode query correctly.
newStatus - new read-only status of the Property
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||