|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ocl.examples.emf.validation.validity.manager.ValidityModel
public class ValidityModel
| Field Summary | |
|---|---|
protected ValidityManager |
validityManager
|
static int |
WORK_FOR_ALL_SET_INPUT
|
static int |
WORK_FOR_CLEAN_UP
|
static int |
WORK_FOR_CREATE_MODEL
|
| Constructor Summary | |
|---|---|
ValidityModel(ValidityManager validityManager,
java.util.Collection<org.eclipse.emf.ecore.resource.Resource> newResources)
The Constructor. |
|
| Method Summary | ||
|---|---|---|
java.util.Set<ConstrainingURI> |
accumulateConstrainingURIs(java.util.Set<ConstrainingURI> constrainingURIs,
TypeURI typeURI)
|
|
void |
addConstrainingFilter(IVisibilityFilter filter)
|
|
void |
addFilteredSeverity(Severity severity)
|
|
void |
addValidatableFilter(IVisibilityFilter filter)
|
|
protected java.util.Set<org.eclipse.emf.ecore.EClass> |
analyzeResource(org.eclipse.emf.ecore.resource.Resource resource)
|
|
protected java.util.Map<org.eclipse.emf.ecore.EPackage,java.util.Set<org.eclipse.emf.ecore.resource.Resource>> |
analyzeResources(java.util.Collection<org.eclipse.emf.ecore.resource.Resource> resources,
org.eclipse.emf.common.util.Monitor monitor,
int worked)
Looks for all EPackages in the source Resources. |
|
protected java.util.Set<TypeURI> |
buildTypeClosure(org.eclipse.emf.ecore.EObject constrainingObject)
Return all types that may provide constraints to an instance of aType. |
|
protected ConstrainingNode |
createConstrainingNode()
Creates a ConstrainingNode. |
|
LeafConstrainingNode |
createLeafConstrainingNode()
creates a LeafConstrainingNode |
|
protected void |
createLeafConstrainingNodes(java.util.Map<org.eclipse.emf.ecore.EObject,java.util.Set<LeafConstrainingNode>> allConstraints,
org.eclipse.emf.common.util.Monitor monitor)
Create the child LeafConstrainingNodes for each EModelElement that provides constraints |
|
protected Result |
createResult(org.eclipse.core.runtime.IProgressMonitor monitor)
Return a new Result object, or return null if the creation process is to be aborted. |
|
protected ResultConstrainingNode |
createResultConstrainingNode()
Creates a ResultConstrainingNode. |
|
protected void |
createResultNodes(java.util.Collection<org.eclipse.emf.ecore.resource.Resource> resources,
org.eclipse.emf.common.util.Monitor monitor,
int worked)
Create the ResultValidatableNode,ResultConstrainingNode cross-linkage for all validateableObject,constraint pairs. |
|
protected void |
createResultNodes(org.eclipse.emf.ecore.EObject constrainedObject,
ConstrainingURI constrainingURI)
Create the ResultValidatableNode,ResultConstrainingNode cross-linkage between constrainedObject and each child constraint of constrainingType. |
|
protected void |
createResultNodes(ValidatableNode validatable,
ConstrainingNode constrainingNode)
|
|
protected boolean |
createResults(java.util.List<Result> results,
java.util.List<? extends ValidatableNode> validatableNodes,
org.eclipse.core.runtime.IProgressMonitor monitor)
Created Results of all validatableNodes. |
|
protected ResultSet |
createResultSet()
Creates a ResultSet. |
|
ResultSet |
createResultSet(org.eclipse.core.runtime.IProgressMonitor monitor)
Return a new ResultSet object containing an initial result for every enabled combination of ValidatableNode and ConstrainingNode. |
|
protected ResultValidatableNode |
createResultValidatableNode()
Creates a ResultValidatableNode |
|
protected RootConstrainingNode |
createRootConstrainingNode()
|
|
protected RootValidatableNode |
createRootValidatableNode()
|
|
protected ValidatableNode |
createValidatableNode()
|
|
java.lang.String |
getConstrainingLabel(org.eclipse.emf.ecore.EObject eObject)
Returns the eObject label |
|
ConstrainingNode |
getConstrainingNode(org.eclipse.emf.ecore.EObject constrainingObject)
Return the ConstrainingNode node for EObject creating any parent ConstrainingNodes that are required to ensure that the returned ConstrainingNode is installed in the root. |
|
protected java.util.List<ConstraintLocator> |
getConstraintLocators(java.lang.String nsURI)
|
|
java.util.Collection<org.eclipse.emf.ecore.resource.Resource> |
getResources()
|
|
java.lang.String |
getResultConstrainingLabel(ValidatableNode validatableNode)
|
|
protected java.lang.StringBuilder |
getResultPath(java.lang.StringBuilder s,
AbstractNode abstractNode)
|
|
java.lang.String |
getResultValidatableLabel(ConstrainingNode constrainingNode)
|
|
RootNode |
getRootNode()
|
|
protected ValidatableNode |
getValidatableNode(org.eclipse.emf.ecore.EObject eObject)
Return the ValidatableNode node for EObject creating any ValidatableNodes that are required to ensure that the returned ValidatableNode is installed in the root. |
|
void |
init(org.eclipse.emf.common.util.Monitor monitor)
Initialize the ValidityModel |
|
protected java.util.Map<org.eclipse.emf.ecore.EObject,java.util.Set<LeafConstrainingNode>> |
locateConstraints(java.util.Map<org.eclipse.emf.ecore.EPackage,java.util.Set<org.eclipse.emf.ecore.resource.Resource>> ePackage2resources,
org.eclipse.emf.common.util.Monitor monitor,
int worked)
Find all constraints for each EClass |
|
void |
refreshModel(java.util.List<AbstractNode> grayedValidatableNodes,
java.util.List<AbstractNode> grayedConstrainingNodes)
|
|
void |
removeConstrainingFilter(IVisibilityFilter filter)
|
|
void |
removeFilteredSeverity(Severity severity)
|
|
void |
removeValidatableFilter(IVisibilityFilter filter)
|
|
protected
|
sortEList(org.eclipse.emf.common.util.EList<T> nodes,
java.util.Comparator<AbstractNode> comparator)
Sorts the list. |
|
protected
|
sortNodes(org.eclipse.emf.common.util.EList<T> nodes,
java.util.Comparator<AbstractNode> comparator)
Sorts the list. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int WORK_FOR_CLEAN_UP
public static final int WORK_FOR_CREATE_MODEL
public static final int WORK_FOR_ALL_SET_INPUT
@NonNull protected final ValidityManager validityManager
| Constructor Detail |
|---|
public ValidityModel(@NonNull
ValidityManager validityManager,
@NonNull
java.util.Collection<org.eclipse.emf.ecore.resource.Resource> newResources)
validityManager - The ValidityManagernewResources - All resources found in the resourceSet| Method Detail |
|---|
@Nullable
public java.util.Set<ConstrainingURI> accumulateConstrainingURIs(@Nullable
java.util.Set<ConstrainingURI> constrainingURIs,
@NonNull
TypeURI typeURI)
public void addConstrainingFilter(@NonNull
IVisibilityFilter filter)
public void addFilteredSeverity(@NonNull
Severity severity)
public void addValidatableFilter(@NonNull
IVisibilityFilter filter)
@NonNull
protected java.util.Map<org.eclipse.emf.ecore.EPackage,java.util.Set<org.eclipse.emf.ecore.resource.Resource>> analyzeResources(@NonNull
java.util.Collection<org.eclipse.emf.ecore.resource.Resource> resources,
@NonNull
org.eclipse.emf.common.util.Monitor monitor,
int worked)
resources - the Collection of all resources in the resourceSet
protected java.util.Set<org.eclipse.emf.ecore.EClass> analyzeResource(org.eclipse.emf.ecore.resource.Resource resource)
@NonNull
protected java.util.Set<TypeURI> buildTypeClosure(@NonNull
org.eclipse.emf.ecore.EObject constrainingObject)
aType - a modelElement
@NonNull protected ConstrainingNode createConstrainingNode()
@NonNull public LeafConstrainingNode createLeafConstrainingNode()
protected void createLeafConstrainingNodes(@NonNull
java.util.Map<org.eclipse.emf.ecore.EObject,java.util.Set<LeafConstrainingNode>> allConstraints,
@NonNull
org.eclipse.emf.common.util.Monitor monitor)
allConstraints - the map of all model elements and their LeafConstrainingNodes
@Nullable
protected Result createResult(@Nullable
org.eclipse.core.runtime.IProgressMonitor monitor)
The default implementation always return an object. Derived implementations may cancel in response to a progress monitor request.
monitor - the corresponding monitor
@NonNull protected ResultConstrainingNode createResultConstrainingNode()
protected void createResultNodes(@NonNull
java.util.Collection<org.eclipse.emf.ecore.resource.Resource> resources,
@NonNull
org.eclipse.emf.common.util.Monitor monitor,
int worked)
resources - the resources
protected void createResultNodes(@NonNull
org.eclipse.emf.ecore.EObject constrainedObject,
@NonNull
ConstrainingURI constrainingURI)
constrainedObject - the constraining objectconstrainingType - the uri of the constrainingNode
protected void createResultNodes(@NonNull
ValidatableNode validatable,
@NonNull
ConstrainingNode constrainingNode)
@NonNull protected ResultSet createResultSet()
@Nullable
public ResultSet createResultSet(@Nullable
org.eclipse.core.runtime.IProgressMonitor monitor)
monitor - the corresponding monitor
@NonNull protected ResultValidatableNode createResultValidatableNode()
protected boolean createResults(@NonNull
java.util.List<Result> results,
@NonNull
java.util.List<? extends ValidatableNode> validatableNodes,
@Nullable
org.eclipse.core.runtime.IProgressMonitor monitor)
results - the created resultsvalidatableNodes - the validatableNodesmonitor - the corresponding monitor
@NonNull protected RootConstrainingNode createRootConstrainingNode()
@NonNull protected RootValidatableNode createRootValidatableNode()
@NonNull protected ValidatableNode createValidatableNode()
@NonNull
public java.lang.String getConstrainingLabel(@NonNull
org.eclipse.emf.ecore.EObject eObject)
eObject -
@NonNull
public ConstrainingNode getConstrainingNode(@NonNull
org.eclipse.emf.ecore.EObject constrainingObject)
eObject -
@NonNull public java.util.Collection<org.eclipse.emf.ecore.resource.Resource> getResources()
@NonNull
public java.lang.String getResultConstrainingLabel(@NonNull
ValidatableNode validatableNode)
@NonNull
protected java.lang.StringBuilder getResultPath(@NonNull
java.lang.StringBuilder s,
@Nullable
AbstractNode abstractNode)
@NonNull
public java.lang.String getResultValidatableLabel(@NonNull
ConstrainingNode constrainingNode)
@NonNull public RootNode getRootNode()
@NonNull
protected ValidatableNode getValidatableNode(@NonNull
org.eclipse.emf.ecore.EObject eObject)
eObject - the modelElement
public void init(@NonNull
org.eclipse.emf.common.util.Monitor monitor)
@Nullable
protected java.util.Map<org.eclipse.emf.ecore.EObject,java.util.Set<LeafConstrainingNode>> locateConstraints(@NonNull
java.util.Map<org.eclipse.emf.ecore.EPackage,java.util.Set<org.eclipse.emf.ecore.resource.Resource>> ePackage2resources,
@NonNull
org.eclipse.emf.common.util.Monitor monitor,
int worked)
ePackage2resources - the map of all ePackages and their resources
public void refreshModel(@Nullable
java.util.List<AbstractNode> grayedValidatableNodes,
@Nullable
java.util.List<AbstractNode> grayedConstrainingNodes)
public void removeConstrainingFilter(@NonNull
IVisibilityFilter filter)
public void removeFilteredSeverity(@NonNull
Severity severity)
public void removeValidatableFilter(@NonNull
IVisibilityFilter filter)
protected java.util.List<ConstraintLocator> getConstraintLocators(@NonNull
java.lang.String nsURI)
protected <T extends AbstractNode> void sortEList(@NonNull
org.eclipse.emf.common.util.EList<T> nodes,
@NonNull
java.util.Comparator<AbstractNode> comparator)
nodes - the list of nodes needing to be sorted.
protected <T extends AbstractNode> void sortNodes(@NonNull
org.eclipse.emf.common.util.EList<T> nodes,
@NonNull
java.util.Comparator<AbstractNode> comparator)
nodes - the list of nodes needing to be sorted.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||