Class ParameterContact<T extends java.lang.annotation.Annotation>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.reflect.Constructor factory
      This is the constructor the parameter was declared within.
      protected int index
      This is the index of the parameter within the constructor.
      protected T label
      This is the annotation used to label the parameter.
      protected java.lang.annotation.Annotation[] labels
      This is used to hold the annotations for this parameter.
      protected java.lang.Class owner
      This represents the class that this parameter was declared in.
    • Constructor Summary

      Constructors 
      Constructor Description
      ParameterContact​(T label, java.lang.reflect.Constructor factory, int index)
      Constructor for the ParameterContact object.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object get​(java.lang.Object source)
      This is used to get the value from the specified object using the point of contact.
      java.lang.annotation.Annotation getAnnotation()
      This is the annotation associated with the point of contact.
      <A extends java.lang.annotation.Annotation>
      A
      getAnnotation​(java.lang.Class<A> 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 provides the dependent class for the contact.
      java.lang.Class[] getDependents()
      This provides the dependent classes for the contact.
      abstract java.lang.String getName()
      This represents the name of the parameter.
      java.lang.Class getType()
      This will provide the contact type.
      boolean isReadOnly()
      This is used to determine if the annotated contact is for a read only variable.
      void set​(java.lang.Object source, java.lang.Object value)
      This is used to set the value on the specified object through this contact.
      java.lang.String toString()
      This is used to provide a textual representation of the parameter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • labels

        protected final java.lang.annotation.Annotation[] labels
        This is used to hold the annotations for this parameter.
      • factory

        protected final java.lang.reflect.Constructor factory
        This is the constructor the parameter was declared within.
      • owner

        protected final java.lang.Class owner
        This represents the class that this parameter was declared in.
      • index

        protected final int index
        This is the index of the parameter within the constructor.
      • label

        protected final T extends java.lang.annotation.Annotation label
        This is the annotation used to label the parameter.
    • Constructor Detail

      • ParameterContact

        public ParameterContact​(T label,
                                java.lang.reflect.Constructor factory,
                                int index)
        Constructor for the ParameterContact object. This is used to create a contact that can be used to determine a consistent name for the parameter. It requires the annotation, the constructor, and the parameter declaration index.
        Parameters:
        label - this is the annotation used for the parameter
        factory - this is the constructor that is represented
        index - this is the index for the parameter
    • Method Detail

      • getAnnotation

        public 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 serialized and deserialized from the object.
        Specified by:
        getAnnotation in interface Contact
        Returns:
        this provides the annotation associated with this
      • getType

        public java.lang.Class getType()
        This will provide the contact type. The contact type is the class that is to be set and get on the object. Typically the type will be a serializable object or a primitive type.
        Specified by:
        getType in interface Type
        Returns:
        this returns the type that this contact represents
      • getDependent

        public java.lang.Class getDependent()
        This provides the dependent class for the contact. This will typically represent a generic type for the actual type. For contacts that use a Collection type this will be the generic type parameter for that collection.
        Specified by:
        getDependent in interface Contact
        Returns:
        this returns the dependent type for the contact
      • getDependents

        public java.lang.Class[] getDependents()
        This provides the dependent classes for the contact. This will typically represent a generic types for the actual type. For contacts that use a Map type this will be the generic type parameter for that map type declaration.
        Specified by:
        getDependents in interface Contact
        Returns:
        this returns the dependent types for the contact
      • getDeclaringClass

        public java.lang.Class getDeclaringClass()
        This is the class that declares the contact. The declaring class is where the parameter has been defined. Typically this will not be a class rather than an interface.
        Specified by:
        getDeclaringClass in interface Contact
        Returns:
        the class this parameter is declared within
      • get

        public java.lang.Object get​(java.lang.Object source)
        This is used to get the value from the specified object using the point of contact. Typically the value is retrieved from the specified object by invoking a get method of by acquiring the value from a field within the specified object.
        Specified by:
        get in interface Contact
        Parameters:
        source - this is the object to acquire the value from
        Returns:
        this is the value acquired from the point of contact
      • set

        public void set​(java.lang.Object source,
                        java.lang.Object value)
        This is used to set the value on the specified object through this contact. Depending on the type of contact this will set the value given, typically this will be done by invoking a method or setting the value on the object field.
        Specified by:
        set in interface Contact
        Parameters:
        source - this is the object to set the value on
        value - this is the value to be set through the contact
      • getAnnotation

        public <A extends java.lang.annotation.Annotation> A getAnnotation​(java.lang.Class<A> 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.
        Specified by:
        getAnnotation in interface Type
        Parameters:
        type - this is the type of the annotation to acquire
        Returns:
        this provides the annotation associated with this
      • isReadOnly

        public boolean isReadOnly()
        This is used to determine if the annotated contact is for a read only variable. A read only variable is a field that can be set from within the constructor such as a blank final variable. It can also be a method with no set counterpart.
        Specified by:
        isReadOnly in interface Contact
        Returns:
        this returns true if the contact is a constant one
      • toString

        public java.lang.String toString()
        This is used to provide a textual representation of the parameter. Providing a string describing the parameter is useful for debugging and for exception messages.
        Specified by:
        toString in interface Contact
        Specified by:
        toString in interface Type
        Overrides:
        toString in class java.lang.Object
        Returns:
        this returns the string representation for this
      • getName

        public abstract java.lang.String getName()
        This represents the name of the parameter. Because the name of the parameter does not exist at runtime the name must be taken directly from the annotation and the parameter type. Each XML annotation must provide their own unique way of providing a name for the parameter contact.
        Specified by:
        getName in interface Contact
        Returns:
        this returns the name of the contact represented