Interface MethodPart

  • All Known Implementing Classes:
    GetPart, SetPart

    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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.annotation.Annotation getAnnotation()
      This is the annotation associated with the point of contact.
      <T extends java.lang.annotation.Annotation>
      T
      getAnnotation​(java.lang.Class<T> type)
      This is the annotation associated with the point of contact.
      java.lang.Class getDeclaringClass()
      This is the class that declares the contact.
      java.lang.Class getDependent()
      This is used to acquire the dependent class for the method part.
      java.lang.Class[] getDependents()
      This is used to acquire the dependent classes for the method part.
      java.lang.reflect.Method getMethod()
      This is the method for this point of contact.
      MethodType getMethodType()
      This is the method type for the method part.
      java.lang.String getName()
      This provides the name of the method part as acquired from the method name.
      java.lang.Class getType()
      This will provide the contact type.
      java.lang.String toString()
      This is used to describe the method as it exists within the owning class.
    • Method Detail

      • getName

        java.lang.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

        java.lang.annotation.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

        <T extends java.lang.annotation.Annotation> T getAnnotation​(java.lang.Class<T> type)
        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

        java.lang.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

        java.lang.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

        java.lang.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

        java.lang.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

        java.lang.reflect.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

        java.lang.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.
        Overrides:
        toString in class java.lang.Object
        Returns:
        this returns a string representation of the method