|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.snapshot.AnnotationSnapshot
public class AnnotationSnapshot
Stores information about a single primary or inherited annotation or an inherited annotation set. Actual annotation values are only stored for primary annotations.
IMPORTANT NOTE TO DEVELOPERS!!
Do not forget to synchronize all serialization code and to increment
the AnnotationSetSnapshot.FILE_VERSION
in case the number of variables
that needs serialization in this class or in the AnnotationSetSnapshot
changes.
Field Summary | |
---|---|
private int |
annotationId
|
private int |
annotationSetId
|
private int |
annotationTypeId
|
private boolean |
inherited
|
private int |
itemId
|
private Item |
itemType
|
private static long |
serialVersionUID
|
private List<? extends Serializable> |
values
|
Constructor Summary | |
---|---|
AnnotationSnapshot()
Create a new, empty annotation snapshot. |
Method Summary | |
---|---|
(package private) void |
deserializeObject(ObjectInputStream in)
|
Annotation |
getAnnotation(DbControl dc)
Get the annotation this is a snapshot of. |
int |
getAnnotationId()
Get the id of the annotation this is a snapshot of. |
AnnotationSet |
getAnnotationSet(DbControl dc)
Get the annotation set this annotation belongs to. |
int |
getAnnotationSetId()
Get the id of the annotation set this annotation belongs to. |
AnnotationType |
getAnnotationType(DbControl dc)
Get the annotation type. |
int |
getAnnotationTypeId()
Get the id of the annotation type. |
Annotatable |
getItem(DbControl dc)
Get the item that this annotation belongs to. |
int |
getItemId()
Get the id of the item this annotation belongs to. |
Item |
getItemType()
Get the item type of the item this annotation belongs to. |
List<? extends Serializable> |
getValues()
Get the annotation values. |
List<? extends Serializable> |
getValues(UnitConverter converter,
Type valueType)
Get the annotations values, optionally converted to some specific unit and type of values. |
(package private) void |
initInherited(AnnotationData inherited)
Initialize the snapshot with information from the given inherited annotation. |
(package private) void |
initInherited(AnnotationSetData inherited)
Initialize the snapshot with information from the given inherited annotation set. |
(package private) void |
initInherited(AnnotationSnapshot primary)
Initializes this snapshot as an inherited annotation with complete data from another primary annotation snapshot. |
(package private) void |
initPrimary(AnnotationData primary)
Initialize the snapshot with information from the given primary annotation. |
boolean |
isInherited()
Is this annotation a primary or inherited annotation? |
private void |
readObject(ObjectInputStream in)
|
(package private) void |
serializeObject(ObjectOutputStream out)
|
(package private) void |
setItem(int itemId,
Item itemType)
|
private void |
writeObject(ObjectOutputStream out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private transient boolean inherited
private transient int annotationId
private transient int annotationSetId
private transient int annotationTypeId
private transient List<? extends Serializable> values
private transient int itemId
private transient Item itemType
Constructor Detail |
---|
public AnnotationSnapshot()
Method Detail |
---|
void initPrimary(AnnotationData primary)
primary
- A primary annotationvoid initInherited(AnnotationData inherited)
inherited
- An inherited annotationvoid initInherited(AnnotationSetData inherited)
inherited
- An inherited annotation setvoid initInherited(AnnotationSnapshot primary)
primary
- A snapshot of a primary annotationpublic boolean isInherited()
public int getAnnotationId()
public Annotation getAnnotation(DbControl dc)
public int getAnnotationSetId()
public AnnotationSet getAnnotationSet(DbControl dc)
public int getAnnotationTypeId()
public AnnotationType getAnnotationType(DbControl dc)
public List<? extends Serializable> getValues()
SnapshotManager.findAnnotations(DbControl, AnnotationSetSnapshot, Filter, boolean)
public List<? extends Serializable> getValues(UnitConverter converter, Type valueType)
converter
- A converter for converting (numerical) values,
or null to not convert the valuesvalueType
- The return type of the converted values (ignored if
no converter is specified)
public int getItemId()
SnapshotManager.findAnnotations(DbControl, AnnotationSetSnapshot, Filter, boolean)
public Annotatable getItem(DbControl dc)
public Item getItemType()
SnapshotManager.findAnnotations(DbControl, AnnotationSetSnapshot, Filter, boolean)
void setItem(int itemId, Item itemType)
void serializeObject(ObjectOutputStream out) throws IOException
IOException
private void writeObject(ObjectOutputStream out) throws IOException
IOException
void deserializeObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |