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 anIllegalAssignmentExceptionindicating that the specified value cannot be assigned to the property encapsulated by thisSetter.voidSets 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
Returns the type of the property.- Returns:
- the type of the property
-
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 isnulland 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 unspecifiedThrowableassociated with calls toMethodHandle.invoke.
-
illegalAssignment
Generates anIllegalAssignmentExceptionindicating that the specified value cannot be assigned to the property encapsulated by thisSetter.- Parameters:
value- the value- Returns:
- An
IllegalAssignmentExceptionfor the specified value
-