Package org.simpleframework.xml.core
Interface MethodPart
interface MethodPart
The
MethodPart
interface is used to provide a point
of contact with an object. Typically this will be used to get a
method from an object which is contains an XML annotation. This
provides the type the method is associated with, this type is
either the method return type or the single value parameter.-
Method Summary
Modifier and TypeMethodDescriptionThis is the annotation associated with the point of contact.<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 the method for this point of contact.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 will provide the contact type.toString()
This is used to describe the method as it exists within the owning class.
-
Method Details
-
getName
String 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.- Returns:
- this returns the Java Bean name of the method part
-
getAnnotation
Annotation getAnnotation()This is the annotation associated with the point of contact. This will be an XML annotation that describes how the contact should be serializaed and deserialized from the object.- Returns:
- this provides the annotation associated with this
-
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.- Parameters:
type
- this is the type of the annotation to acquire- Returns:
- this provides the annotation associated with this
-
getType
Class getType()This will provide the contact type. The contact type is the class that is either the method return type or the single value parameter type associated with the method.- Returns:
- this returns the type that this contact represents
-
getDependent
Class 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.- Returns:
- this returns the generic dependent for the type
-
getDependents
Class[] getDependents()This is used to acquire the dependent classes for the method part. The dependent types are the types that represent the generic types 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.- Returns:
- this returns the generic dependent for the type
-
getDeclaringClass
Class 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.- Returns:
- this returns the class the part is declared within
-
getMethod
Method getMethod()This is the method for this point of contact. This is what will be invoked by the serialization or deserialization process when an XML element or attribute is to be used.- Returns:
- this returns the method associated with this
-
getMethodType
MethodType 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.- Returns:
- the method type that this part represents
-
toString
String 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 should return the method as a generic representation.
-