Class Setter
java.lang.Object
org.klojang.invoke.Setter
Represents a setter for a single property.
- Author:
- Ayco Holleman
-
Method Summary
Modifier and TypeMethodDescriptionClass
<?> Returns the type of the property.Returns the name of the property being set by thisSetter
.illegalAssignment
(Object value) Generates anIllegalAssignmentException
indicating that the specified value cannot be assigned to the property encapsulated by thisSetter
.void
Sets the property on the specified bean to the specified value.
-
Method Details
-
getProperty
Returns the name of the property being set by thisSetter
.- Returns:
- the name of the property being set by this
Setter
-
getParamType
-
write
Sets the property on the specified bean to the specified value.- Parameters:
bean
- the object receiving the valuevalue
- the value- Throws:
IllegalAssignmentException
- If the value cannot be cast to the type of the property, or if the value isnull
and the property has a primitive type. This is aRuntimeException
, but you might still want to catch it as it can often be handled in a meaningful way.Throwable
- The unspecifiedThrowable
associated with calls toMethodHandle.invoke
.
-
illegalAssignment
Generates anIllegalAssignmentException
indicating that the specified value cannot be assigned to the property encapsulated by thisSetter
.- Parameters:
value
- the value- Returns:
- An
IllegalAssignmentException
for the specified value
-