Package org.simpleframework.xml.core
Class Revision
java.lang.Object
org.simpleframework.xml.core.Revision
The
Revision
object is used represent the revision
of a class as read from a version attribute. It determines the
type of deserialization that takes place.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
This is used to track the revision comparision of the class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
This is used to compare the expected and current versions of the class.double
This is used to acquire the default revision.boolean
isEqual()
This returns the cached comparision of the revisions.
-
Field Details
-
equal
private boolean equalThis is used to track the revision comparision of the class.
-
-
Constructor Details
-
Revision
public Revision()Constructor of theRevision
object. This is used to create a comparator object that will compare and cache the comparison of the expected and current version of the class.
-
-
Method Details
-
getDefault
public double getDefault()This is used to acquire the default revision. The default revision is the revision expected if there is not attribute representing the version in the XML element for the object.- Returns:
- this returns the default version for the object
-
compare
This is used to compare the expected and current versions of the class. Once compared the comparison result is cached within the revision class so that it can be used repeatedly.- Parameters:
expected
- this is the expected version of the classcurrent
- this is the current version of the class- Returns:
- this returns true if the versions are the same
-
isEqual
public boolean isEqual()This returns the cached comparision of the revisions. This will be true if not comparison was performed. If however one was performed then this will represent the result.- Returns:
- this returns the cached version of the comparison
-