Package org.simpleframework.xml.core
Class Comparer
java.lang.Object
org.simpleframework.xml.core.Comparer
The
Comparer
is used to compare annotations on the
attributes of that annotation. Unlike the equals
method, this can ignore some attributes based on the name of the
attributes. This is useful if some annotations have overridden
values, such as the field or method name.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
equals
(Annotation left, Annotation right) This is used to determine if two annotations are equals based on the attributes of the annotation.private boolean
This is used to determine if the method for an attribute is to be ignore.
-
Field Details
-
NAME
This is the default attribute to ignore for the comparer.- See Also:
-
ignore
This is the list of names to ignore for this instance.
-
-
Constructor Details
-
Comparer
public Comparer()Constructor for theComparer
object. This is used to create a comparer that has a default set of names to be ignored during the comparison of annotations. -
Comparer
Constructor for theComparer
object. This is used to create a comparer that has a default set of names to be ignored during the comparison of annotations.- Parameters:
ignore
- this is the set of attributes to be ignored
-
-
Method Details
-
equals
This is used to determine if two annotations are equals based on the attributes of the annotation. The comparison done can ignore specific attributes, for instance the name attribute.- Parameters:
left
- this is the left side of the comparison doneright
- this is the right side of the comparison done- Returns:
- this returns true if the annotations are equal
- Throws:
Exception
-
isIgnore
This is used to determine if the method for an attribute is to be ignore. To determine if it should be ignore the method name is compared against the list of attributes to ignore.- Parameters:
method
- this is the method to be evaluated- Returns:
- this returns true if the method should be ignored
-