Package org.jdesktop.beansbinding
Class ObjectProperty<S>
java.lang.Object
org.jdesktop.beansbinding.Property<S,S>
org.jdesktop.beansbinding.ObjectProperty<S>
- Type Parameters:
S- the type of source object that thisPropertyoperates on and therefore the type of value that it represents
An immutable, read-only,
Property implementation whose getValue
method returns the source object that it is given. This class is useful when
you want to configure a Binding to use its source object directly,
rather than some property of the source object. For example:
new SomeBindingClass(sourceObject, ObjectProperty.create(), targetObject, targetProperty);
Explicitly using ObjectProperty isn't necessary when creating Bindings
from this package or the SwingBindings package, as the set of static creation
methods include versions that handle this for you.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyStateListener(S source, PropertyStateListener listener) Does nothing; the state of anObjectPropertynever changes so listeners aren't useful.static <S> ObjectProperty<S>create()Creates an instance ofObjectProperty.getPropertyStateListeners(S source) Returns an empty array; the state of anObjectPropertynever changes so listeners aren't useful.Returns the source object passed to the method.getWriteType(S source) ThrowsUnsupportedOperationException;ObjectPropertyis never writeable.booleanisReadable(Object source) Returnstrue;ObjectPropertyis always readable.booleanisWriteable(Object source) Returnsfalse;ObjectPropertyis never writeable.voidremovePropertyStateListener(S source, PropertyStateListener listener) Does nothing; the state of anObjectPropertynever changes so listeners aren't useful.voidThrowsUnsupportedOperationException;ObjectPropertyis never writeable.toString()Returns a string representation of theObjectProperty.
-
Method Details
-
create
Creates an instance ofObjectProperty. -
getWriteType
ThrowsUnsupportedOperationException;ObjectPropertyis never writeable.- Specified by:
getWriteTypein classProperty<S,S> - Parameters:
source- the source object on which to operate- Returns:
- never returns; always throws
UnsupportedOperationException;ObjectPropertyis never writeable - Throws:
UnsupportedOperationException- always;ObjectPropertyis never writeable- See Also:
-
getValue
Returns the source object passed to the method. -
setValue
ThrowsUnsupportedOperationException;ObjectPropertyis never writeable.- Specified by:
setValuein classProperty<S,S> - Parameters:
source- the source object on which to operatevalue- the new value for theProperty- Throws:
UnsupportedOperationException- always;ObjectPropertyis never writeable- See Also:
-
isReadable
Returnstrue;ObjectPropertyis always readable.- Specified by:
isReadablein classProperty<S,S> - Parameters:
source- the source object on which to operate- Returns:
true;ObjectPropertis always readable- See Also:
-
isWriteable
Returnsfalse;ObjectPropertyis never writeable.- Specified by:
isWriteablein classProperty<S,S> - Parameters:
source- the source object on which to operate- Returns:
false;ObjectPropertis never writeable- See Also:
-
toString
Returns a string representation of theObjectProperty. This method is intended to be used for debugging purposes only, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not benull. -
addPropertyStateListener
Does nothing; the state of anObjectPropertynever changes so listeners aren't useful.- Specified by:
addPropertyStateListenerin classProperty<S,S> - Parameters:
source- the source object on which to operatelistener- the listener to be notified
-
removePropertyStateListener
Does nothing; the state of anObjectPropertynever changes so listeners aren't useful.- Specified by:
removePropertyStateListenerin classProperty<S,S> - Parameters:
source- the source object on which to operatelistener- the listener to be removed- See Also:
-
getPropertyStateListeners
Returns an empty array; the state of anObjectPropertynever changes so listeners aren't useful.- Specified by:
getPropertyStateListenersin classProperty<S,S> - Parameters:
source- the source object on which to operate- Returns:
- an empty array
- See Also:
-