Class LabelKey

java.lang.Object
org.simpleframework.xml.core.LabelKey

class LabelKey extends Object
The LabelKey object is used to create a key that will uniquely identify an annotated method within a class. Creation of a key in this way enables annotated methods and fields to be cached and looked up using a key.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Class
    This is the annotation type that this is represented in the key.
    private final String
    This is the name of the field or method that is represented.
    private final Class
    This is the declaring class where the method or field is defined.
    private final Class
    This is the type that is represented by the annotated contact.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LabelKey(Contact contact, Annotation label)
    Constructor for the LabelKey object.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object value)
    This is used to determine if two keys are the same.
    private boolean
    This is used to determine if two keys are the same.
    int
    This returns the unique has code used for this key.
    This returns a string representation of this key.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • label

      private final Class label
      This is the annotation type that this is represented in the key.
    • owner

      private final Class owner
      This is the declaring class where the method or field is defined.
    • type

      private final Class type
      This is the type that is represented by the annotated contact.
    • name

      private final String name
      This is the name of the field or method that is represented.
  • Constructor Details

    • LabelKey

      public LabelKey(Contact contact, Annotation label)
      Constructor for the LabelKey object. This is used to create an object using the contact and associated annotation that can uniquely identity the label.
      Parameters:
      contact - this is the contact that has been annotated
      label - this is the primary annotation associated with this
  • Method Details

    • hashCode

      public int hashCode()
      This returns the unique has code used for this key. The hash code is created by combining the hash code of the method or field name with the hash code of the declaring class.
      Overrides:
      hashCode in class Object
      Returns:
      this returns the hash code associated with this key
    • equals

      public boolean equals(Object value)
      This is used to determine if two keys are the same. Ultimately two keys are equal if they represent the same contact and annotation from that contact. If everything is equal by identity then this will be true.
      Overrides:
      equals in class Object
      Parameters:
      value - this is the value to compare to this key
      Returns:
      this returns true if both keys have the same data
    • equals

      private boolean equals(LabelKey key)
      This is used to determine if two keys are the same. Ultimately two keys are equal if they represent the same contact and annotation from that contact. If everything is equal by identity then this will be true.
      Parameters:
      key - this is the value to compare to this key
      Returns:
      this returns true if both keys have the same data
    • toString

      public String toString()
      This returns a string representation of this key. It contains the name and the declaring class for the method or field. This is primarily used for debugging purposes.
      Overrides:
      toString in class Object
      Returns:
      this returns a string representation of this key