Package org.simpleframework.xml.core
Class LabelKey
java.lang.Object
org.simpleframework.xml.core.LabelKey
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
FieldsModifier and TypeFieldDescriptionprivate 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
ConstructorsConstructorDescriptionLabelKey
(Contact contact, Annotation label) Constructor for theLabelKey
object. -
Method Summary
-
Field Details
-
label
This is the annotation type that this is represented in the key. -
owner
This is the declaring class where the method or field is defined. -
type
This is the type that is represented by the annotated contact. -
name
This is the name of the field or method that is represented.
-
-
Constructor Details
-
LabelKey
Constructor for theLabelKey
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 annotatedlabel
- 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. -
equals
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. -
equals
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
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.
-