org.eclipse.xtext.serializer.analysis
Interface IGrammarConstraintProvider.IConstraint
- All Superinterfaces:
- java.lang.Comparable<IGrammarConstraintProvider.IConstraint>
- All Known Implementing Classes:
- GrammarConstraintProvider.ActionConstraint, GrammarConstraintProvider.Constraint, GrammarConstraintProvider.RuleConstraint
- Enclosing interface:
- IGrammarConstraintProvider
public static interface IGrammarConstraintProvider.IConstraint
- extends java.lang.Comparable<IGrammarConstraintProvider.IConstraint>
One constraint defines all conditions one semantic object must comply with. A constraint is specific for one
EClass and belongs to one or more contexts.
The conditions defined by a constraint are represented by a tree of IGrammarConstraintProvider.IConstraintElement
. This tree's root
can be accessed by getBody()
.
Methods inherited from interface java.lang.Comparable |
compareTo |
getAssignments
IGrammarConstraintProvider.IConstraintElement[] getAssignments()
- Returns:
- a list of all assignments represented by this constraint.
IGrammarConstraintProvider.IConstraintElement.getAssignmentID()
returns an Assignment's index in this list. The order of
the list reflects the order of the assignments in the constraint. Assignments are
IGrammarConstraintProvider.IConstraintElement
s with IGrammarConstraintProvider.IConstraintElement.getType()
== ASSIGNED_*
getBody
IGrammarConstraintProvider.IConstraintElement getBody()
- Returns:
- the root of the tree of
IGrammarConstraintProvider.IConstraintElement
that defines this constraint.
getElements
IGrammarConstraintProvider.IConstraintElement[] getElements()
- Returns:
- a list of all elements represented by this constraint. This is a flattened version of the tree
returned by
getBody()
. IGrammarConstraintProvider.IConstraintElement.getElementID()
returns an Assignment's
index in this list. The order of the list reflects the order of the elements in the constraint.
getFeatures
IGrammarConstraintProvider.IFeatureInfo[] getFeatures()
- Returns:
- a list of
IGrammarConstraintProvider.IFeatureInfo
for all EStructuralFeature
s from the EClass
returned
by getType()
that have an assignment if this constraint. If there is no assignment for an
EStructuralFeature
in this constraint, the array's item is null.
getSingleAssignementFeatures
java.lang.Iterable<IGrammarConstraintProvider.IFeatureInfo> getSingleAssignementFeatures()
getMultiAssignementFeatures
java.lang.Iterable<IGrammarConstraintProvider.IFeatureInfo> getMultiAssignementFeatures()
getName
java.lang.String getName()
- Returns:
- a name that is unique for a grammar and that aims to be human-readable.
getSimpleName
java.lang.String getSimpleName()
getType
org.eclipse.emf.ecore.EClass getType()
- Returns:
- This constraint only applies to EObjects of this type.