public class RelationChecker extends Test
Modifier and Type | Class and Description |
---|---|
private static class |
RelationChecker.RoleInfo |
private static class |
RelationChecker.RolePreset |
Test.TagTest
Modifier and Type | Field and Description |
---|---|
protected static int |
HIGH_COUNT |
protected static int |
LOW_COUNT |
protected static int |
RELATION_EMPTY |
protected static int |
RELATION_UNKNOWN |
private static java.util.Collection<TaggingPreset> |
relationpresets |
protected static int |
ROLE_EMPTY |
protected static int |
ROLE_MISSING |
protected static int |
ROLE_UNKNOWN |
static java.lang.String |
ROLE_VERIF_PROBLEM_MSG
Error message used to group errors related to role problems.
|
protected static int |
WRONG_TYPE |
checkBeforeUpload, checkEnabled, description, enabled, errors, isBeforeUpload, name, partialSelection, progressMonitor, startTime, testBeforeUpload
Constructor and Description |
---|
RelationChecker()
Constructor
|
Modifier and Type | Method and Description |
---|---|
private java.util.Map<java.lang.String,RelationChecker.RolePreset> |
buildAllRoles(Relation n) |
private java.util.Map<java.lang.String,RelationChecker.RoleInfo> |
buildRoleInfoMap(Relation n) |
private boolean |
checkMemberExpressionAndType(RelationChecker.RolePreset rolePreset,
RelationMember member,
Relation n)
get all role definition for specified key and check, if some definition matches
|
private boolean |
checkMemberType(Roles.Role r,
RelationMember member) |
private void |
checkRoleCounts(Relation n,
Roles.Role r,
java.lang.String keyname,
RelationChecker.RoleInfo ri) |
private void |
checkRoles(Relation n,
java.util.Map<java.lang.String,RelationChecker.RolePreset> allroles,
java.util.Map<java.lang.String,RelationChecker.RoleInfo> map) |
Command |
fixError(TestError testError)
Fixes the error with the appropriate command
|
void |
initialize()
Initializes any global data used this tester.
|
static void |
initializePresets()
Reads the presets data.
|
boolean |
isFixable(TestError testError)
Returns true if the given error can be fixed automatically
|
void |
visit(Relation n)
Visiting call for relations.
|
addGui, deletePrimitivesIfNeeded, endTest, equals, getErrors, getName, hashCode, isBuilding, isCanceled, isPrimitiveUsable, ok, setBeforeUpload, setPartialSelection, startTest, testBeforeUpload, visit, visit, visit
visit
protected static final int ROLE_UNKNOWN
protected static final int ROLE_EMPTY
protected static final int WRONG_TYPE
protected static final int HIGH_COUNT
protected static final int LOW_COUNT
protected static final int ROLE_MISSING
protected static final int RELATION_UNKNOWN
protected static final int RELATION_EMPTY
public static final java.lang.String ROLE_VERIF_PROBLEM_MSG
private static java.util.Collection<TaggingPreset> relationpresets
public RelationChecker()
public void initialize()
Test
initialize
in class Test
public static void initializePresets()
public void visit(Relation n)
Visitor
private java.util.Map<java.lang.String,RelationChecker.RoleInfo> buildRoleInfoMap(Relation n)
private java.util.Map<java.lang.String,RelationChecker.RolePreset> buildAllRoles(Relation n)
private boolean checkMemberType(Roles.Role r, RelationMember member)
private boolean checkMemberExpressionAndType(RelationChecker.RolePreset rolePreset, RelationMember member, Relation n)
rolePreset
- containing preset for role of the membermember
- to be verifiedn
- relation to be verifiedprivate void checkRoles(Relation n, java.util.Map<java.lang.String,RelationChecker.RolePreset> allroles, java.util.Map<java.lang.String,RelationChecker.RoleInfo> map)
n
- relation to validateallroles
- contains presets for specified relationmap
- contains statistics of occurances of specified role types in relationprivate void checkRoleCounts(Relation n, Roles.Role r, java.lang.String keyname, RelationChecker.RoleInfo ri)
public Command fixError(TestError testError)
Test