public abstract class BaseGraphPolicyAdjuster extends GraphPolicy
GraphPolicy.Ability, GraphPolicy.Action, GraphPolicy.Details, GraphPolicy.Orphan
Constructor and Description |
---|
BaseGraphPolicyAdjuster(GraphPolicy graphPolicy)
Construct a new graph policy adjuster.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
isAdjustedAfterReview(GraphPolicy.Details object)
An opportunity to adjust each model object after the graph policy reviews it.
|
protected boolean |
isAdjustedBeforeReview(GraphPolicy.Details object)
An opportunity to adjust each model object before the graph policy reviews it.
|
protected boolean |
isBlockedFromAdjustment(GraphPolicy.Details object)
An opportunity to reverse any change to each model object after the graph policy reviews it.
|
boolean |
isCondition(String name)
Check if a condition has been set.
|
void |
noteDetails(org.hibernate.Session session,
ome.model.IObject object,
String realClass,
long id)
Any model object about which policy may be asked is first passed to
#noteDetails(IObject, String, long) before
#review(Map, Details, Map, Set) . |
Set<GraphPolicy.Details> |
review(Map<String,Set<GraphPolicy.Details>> linkedFrom,
GraphPolicy.Details rootObject,
Map<String,Set<GraphPolicy.Details>> linkedTo,
Set<String> notNullable,
boolean isErrorRules)
The action to take about the link between the mapped objects.
|
void |
setCondition(String name)
Set a named condition,
|
allObjects, getCleanInstance
public BaseGraphPolicyAdjuster(GraphPolicy graphPolicy)
graphPolicy
- the graph policy that is to be adjustedprotected boolean isAdjustedBeforeReview(GraphPolicy.Details object)
object
- the model object before reviewprotected boolean isAdjustedAfterReview(GraphPolicy.Details object)
object
- the model object after reviewprotected boolean isBlockedFromAdjustment(GraphPolicy.Details object)
object
- the model object after reviewpublic void setCondition(String name)
GraphPolicy
setCondition
in class GraphPolicy
name
- the name of the conditionpublic boolean isCondition(String name)
GraphPolicy
isCondition
in class GraphPolicy
name
- the name of the conditionpublic void noteDetails(org.hibernate.Session session, ome.model.IObject object, String realClass, long id)
GraphPolicy
#noteDetails(IObject, String, long)
before
#review(Map, Details, Map, Set)
. Each object is passed only once.
Subclasses overriding this method probably ought also override GraphPolicy.getCleanInstance()
.noteDetails
in class GraphPolicy
session
- the Hibernate session, for obtaining more information about the objectobject
- an unloaded model object about which policy may be askedrealClass
- the real class name of the objectid
- the ID of the objectpublic final Set<GraphPolicy.Details> review(Map<String,Set<GraphPolicy.Details>> linkedFrom, GraphPolicy.Details rootObject, Map<String,Set<GraphPolicy.Details>> linkedTo, Set<String> notNullable, boolean isErrorRules) throws GraphException
GraphPolicy
GraphPolicy.Action.EXCLUDE
d object, once changed from that, may not change back to GraphPolicy.Action.EXCLUDE
.
An GraphPolicy.Action.OUTSIDE
object, once changed to that, may not change back from GraphPolicy.Action.OUTSIDE
.
GraphPolicy.Orphan
values matter only for GraphPolicy.Action.EXCLUDE
d objects.
Given GraphPolicy.Orphan.RELEVANT
if Action#IS_LAST
or Action#IS_NOT_LAST
can be returned,
or could be if after GraphPolicy.Orphan.RELEVANT
is returned then resolved for the other object,
then appropriate values should be returned accordingly.
If Action#RELEVANT
is returned for an object then this method may be called again with
Action#IS_LAST
or Action#IS_NOT_LAST
.
Class properties' String
representation is package.DeclaringClass.propertyName
.review
in class GraphPolicy
linkedFrom
- map from class property to objects for which the property links to the root objectrootObject
- the object at the center of this reviewlinkedTo
- map from class property to objects to which the property links from the root objectnotNullable
- which properties from the linkedFrom and linkedTo map keys are not nullableisErrorRules
- if final checks should be performed instead of normal rule matchingGraphException
- if there was a problem in applying the policy
Version: 5.1.2-ice35-b45
Copyright © 2015 The University of Dundee & Open Microscopy Environment. All Rights Reserved.