public class AnnotationLoaderUtil extends Object implements Filter<AnnotationSnapshot>
SnapshotManager
.Modifier and Type | Field and Description |
---|---|
private AnnotationType |
at |
private int |
atId |
private UnitConverter |
converter |
private DbControl |
dc |
private Unit |
defultUnit |
private SnapshotManager |
manager |
private boolean |
searchInherited |
private boolean |
searchPrimary |
private List<AnnotationSnapshot> |
snapshots |
private Unit |
unit |
private String |
unitSymbol |
private Type |
valueType |
Constructor and Description |
---|
AnnotationLoaderUtil(DbControl dc,
SnapshotManager manager,
AnnotationType at)
Create a loder that uses the given snapshot manager to load annotations
for a single annotation type.
|
AnnotationLoaderUtil(DbControl dc,
SnapshotManager manager,
AnnotationType at,
boolean searchPrimary,
boolean searchInherited)
Create a loder that uses the given snapshot manager to load annotations
for a single annotation type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
evaluate(AnnotationSnapshot snapshot)
Evaluate if the given object should pass the filter or not.
|
boolean |
find(AnnotationSetSnapshot setSnapshot)
Same as findAll but only return a boolean instead of the number
of snapshots found.
|
int |
findAll(AnnotationSetSnapshot setSnapshot)
Find and load annotations from the given annotation set snapshot.
|
AnnotationType |
getAnnotationType()
The annotation type that this loader load annotations from.
|
int |
getId()
The ID of the annotation type that this loader load annotations from.
|
AnnotationSnapshot |
getSnapshot()
Get the snapshot for the last annotation found when calling
findAll(AnnotationSetSnapshot) . |
List<AnnotationSnapshot> |
getSnapshots()
Get all snapshots found by the last
findAll(AnnotationSetSnapshot)
call. |
Unit |
getUnit()
Get the unit of the last annotation values that was found
by
find(AnnotationSetSnapshot) . |
String |
getUnitSymbol()
Get the unit symbol of the last annotation values that was found
by
find(AnnotationSetSnapshot) . |
List<? extends Serializable> |
getValues()
Get the values from the last annotation found when calling
find(AnnotationSetSnapshot) |
boolean |
isSearchingInheritedAnnotations()
Is this loader searching for inherited annotations?
|
boolean |
isSearchingPrimaryAnnotations()
Is this loader searching for primary annotations?
|
private final DbControl dc
private final SnapshotManager manager
private final AnnotationType at
private final int atId
private final Type valueType
private final Unit defultUnit
private final boolean searchPrimary
private final boolean searchInherited
private List<AnnotationSnapshot> snapshots
private UnitConverter converter
private Unit unit
private String unitSymbol
public AnnotationLoaderUtil(DbControl dc, SnapshotManager manager, AnnotationType at)
public AnnotationLoaderUtil(DbControl dc, SnapshotManager manager, AnnotationType at, boolean searchPrimary, boolean searchInherited)
public boolean evaluate(AnnotationSnapshot snapshot)
Filter
evaluate
in interface Filter<AnnotationSnapshot>
snapshot
- The object to evaluatepublic int getId()
public AnnotationType getAnnotationType()
public boolean isSearchingPrimaryAnnotations()
public boolean isSearchingInheritedAnnotations()
public boolean find(AnnotationSetSnapshot setSnapshot)
findAll(AnnotationSetSnapshot)
public int findAll(AnnotationSetSnapshot setSnapshot)
public AnnotationSnapshot getSnapshot()
findAll(AnnotationSetSnapshot)
. Note! If multiple
annotation snapshots were found, this will only return the
first hit.public List<AnnotationSnapshot> getSnapshots()
findAll(AnnotationSetSnapshot)
call.public List<? extends Serializable> getValues()
find(AnnotationSetSnapshot)
public Unit getUnit()
find(AnnotationSetSnapshot)
. Note that if
multiple annotations was found with different units the default
unit of the annotation type is used.public String getUnitSymbol()
find(AnnotationSetSnapshot)
.