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 thisProperty
operates 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 TypeMethodDescriptionvoid
addPropertyStateListener
(S source, PropertyStateListener listener) Does nothing; the state of anObjectProperty
never 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 anObjectProperty
never changes so listeners aren't useful.Returns the source object passed to the method.getWriteType
(S source) ThrowsUnsupportedOperationException
;ObjectProperty
is never writeable.boolean
isReadable
(Object source) Returnstrue
;ObjectProperty
is always readable.boolean
isWriteable
(Object source) Returnsfalse
;ObjectProperty
is never writeable.void
removePropertyStateListener
(S source, PropertyStateListener listener) Does nothing; the state of anObjectProperty
never changes so listeners aren't useful.void
ThrowsUnsupportedOperationException
;ObjectProperty
is never writeable.toString()
Returns a string representation of theObjectProperty
.
-
Method Details
-
create
Creates an instance ofObjectProperty
. -
getWriteType
ThrowsUnsupportedOperationException
;ObjectProperty
is never writeable.- Specified by:
getWriteType
in classProperty<S,
S> - Parameters:
source
- the source object on which to operate- Returns:
- never returns; always throws
UnsupportedOperationException
;ObjectProperty
is never writeable - Throws:
UnsupportedOperationException
- always;ObjectProperty
is never writeable- See Also:
-
getValue
Returns the source object passed to the method. -
setValue
ThrowsUnsupportedOperationException
;ObjectProperty
is never writeable.- Specified by:
setValue
in classProperty<S,
S> - Parameters:
source
- the source object on which to operatevalue
- the new value for theProperty
- Throws:
UnsupportedOperationException
- always;ObjectProperty
is never writeable- See Also:
-
isReadable
Returnstrue
;ObjectProperty
is always readable.- Specified by:
isReadable
in classProperty<S,
S> - Parameters:
source
- the source object on which to operate- Returns:
true
;ObjectPropert
is always readable- See Also:
-
isWriteable
Returnsfalse
;ObjectProperty
is never writeable.- Specified by:
isWriteable
in classProperty<S,
S> - Parameters:
source
- the source object on which to operate- Returns:
false
;ObjectPropert
is 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 anObjectProperty
never changes so listeners aren't useful.- Specified by:
addPropertyStateListener
in classProperty<S,
S> - Parameters:
source
- the source object on which to operatelistener
- the listener to be notified
-
removePropertyStateListener
Does nothing; the state of anObjectProperty
never changes so listeners aren't useful.- Specified by:
removePropertyStateListener
in 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 anObjectProperty
never changes so listeners aren't useful.- Specified by:
getPropertyStateListeners
in classProperty<S,
S> - Parameters:
source
- the source object on which to operate- Returns:
- an empty array
- See Also:
-