Package org.simpleframework.xml.core
Class SetPart
java.lang.Object
org.simpleframework.xml.core.SetPart
- All Implemented Interfaces:
MethodPart
The
SetPart
object represents the setter method for
a Java Bean property. This composes the set part of the method
contact for an object. The set part contains the method that is
used to set the value on an object and the annotation that tells
the deserialization process how to deserialize the value.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Cache
<Annotation> This cache contains the annotations present on the method.private final Annotation
This is the annotation for the set method provided.private final Annotation[]
This is the list of annotations associated with the method.private final Method
This method is used to set the value during deserialization.private final String
This represents the name of this set part instance.private final MethodType
This represents the method type for the set part method. -
Constructor Summary
ConstructorsConstructorDescriptionSetPart
(MethodName method, Annotation label, Annotation[] list) Constructor for theSetPart
object. -
Method Summary
Modifier and TypeMethodDescriptionThis is used to acquire the annotation that was used to label the method this represents.<T extends Annotation>
TgetAnnotation
(Class<T> type) This is the annotation associated with the point of contact.This is the class that declares the contact.This is used to acquire the dependent class for the method part.Class[]
This is used to acquire the dependent classes for the method part.This is used to acquire the method that can be used to invoke the Java Bean method on the object.This is the method type for the method part.getName()
This provides the name of the method part as acquired from the method name.getType()
This is used to acquire the type for this method part.toString()
This is used to describe the method as it exists within the owning class.
-
Field Details
-
cache
This cache contains the annotations present on the method. -
list
This is the list of annotations associated with the method. -
label
This is the annotation for the set method provided. -
type
This represents the method type for the set part method. -
method
This method is used to set the value during deserialization. -
name
This represents the name of this set part instance.
-
-
Constructor Details
-
SetPart
Constructor for theSetPart
object. This is used to create a method part that will provide a means for the deserialization process to set a value to a object.- Parameters:
method
- the method that is used to set the valuelabel
- this describes how to deserialize the valuelist
- this is the list of annotations on the method
-
-
Method Details
-
getName
This provides the name of the method part as acquired from the method name. The name represents the Java Bean property name of the method and is used to pair getter and setter methods.- Specified by:
getName
in interfaceMethodPart
- Returns:
- this returns the Java Bean name of the method part
-
getType
This is used to acquire the type for this method part. This is used by the serializer to determine the schema class that is used to match the XML elements to the object details.- Specified by:
getType
in interfaceMethodPart
- Returns:
- this returns the schema class for this method
-
getDependent
This is used to acquire the dependent class for the method part. The dependent type is the type that represents the generic type of the type. This is used when collections are annotated as it allows a default entry class to be taken from the generic information provided.- Specified by:
getDependent
in interfaceMethodPart
- Returns:
- this returns the generic dependent for the type
-
getDependents
This is used to acquire the dependent classes for the method part. The dependent types are the types that represents the generic types of the type. This is used when collections are annotated as it allows a default entry classes to be taken from the generic information provided.- Specified by:
getDependents
in interfaceMethodPart
- Returns:
- this returns the generic dependents for the type
-
getDeclaringClass
This is the class that declares the contact. The declaring class is where the method represented has been defined. This will typically be a class rather than an interface.- Specified by:
getDeclaringClass
in interfaceMethodPart
- Returns:
- this returns the class the part is declared within
-
getAnnotation
This is used to acquire the annotation that was used to label the method this represents. This acts as a means to match the set method with the get method using an annotation comparison.- Specified by:
getAnnotation
in interfaceMethodPart
- Returns:
- this returns the annotation used to mark the method
-
getAnnotation
This is the annotation associated with the point of contact. This will be an XML annotation that describes how the contact should be serialized and deserialized from the object.- Specified by:
getAnnotation
in interfaceMethodPart
- Parameters:
type
- this is the type of the annotation to acquire- Returns:
- this provides the annotation associated with this
-
getMethodType
This is the method type for the method part. This is used in the scanning process to determine which type of method a instance represents, this allows set and get methods to be paired.- Specified by:
getMethodType
in interfaceMethodPart
- Returns:
- the method type that this part represents
-
getMethod
This is used to acquire the method that can be used to invoke the Java Bean method on the object. If the method represented by this is inaccessible then this will set it as accessible.- Specified by:
getMethod
in interfaceMethodPart
- Returns:
- returns the method used to interface with the object
-
toString
This is used to describe the method as it exists within the owning class. This is used to provide error messages that can be used to debug issues that occur when processing a method. This returns the method as a generic string representation.- Specified by:
toString
in interfaceMethodPart
- Overrides:
toString
in classObject
- Returns:
- this returns a string representation of the method
-