public class DotJavaValidator extends AbstractDotJavaValidator
Modifier and Type | Class and Description |
---|---|
static class |
DotJavaValidator.AttributeContext
Indication of the context in which an attribute is used.
|
org.eclipse.xtext.validation.AbstractDeclarativeValidator.MethodWrapper, org.eclipse.xtext.validation.AbstractDeclarativeValidator.State, org.eclipse.xtext.validation.AbstractDeclarativeValidator.StateAccess
org.eclipse.emf.ecore.EValidator.Descriptor, org.eclipse.emf.ecore.EValidator.PatternMatcher, org.eclipse.emf.ecore.EValidator.Registry, org.eclipse.emf.ecore.EValidator.SubstitutionLabelProvider, org.eclipse.emf.ecore.EValidator.ValidationDelegate
CURRENT_LANGUAGE_NAME, ISSUE_SEVERITIES
Constructor and Description |
---|
DotJavaValidator() |
Modifier and Type | Method and Description |
---|---|
void |
checkEdgeOpCorrespondsToGraphType(org.eclipse.gef4.dot.internal.parser.dot.EdgeRhsNode edgeRhsNode)
Ensures that within
EdgeRhsNode , '->' is used in directed
graphs, while '--' is used in undirected graphs. |
void |
checkEdgeOpCorrespondsToGraphType(org.eclipse.gef4.dot.internal.parser.dot.EdgeRhsSubgraph edgeRhsSubgraph)
Ensures that within
EdgeRhsSubgraph '->' is used in directed
graphs, while '--' is used in undirected graphs. |
void |
checkValidAttributeValue(org.eclipse.gef4.dot.internal.parser.dot.Attribute attribute)
Checks that within an
Attribute only valid attribute values are
used (dependent on context, in which the attribute is specified). |
static boolean |
isEdgeAttribute(org.eclipse.gef4.dot.internal.parser.dot.Attribute attribute)
Checks whether the given
Attribute is used in the context of an
edge. |
static boolean |
isGraphAttribute(org.eclipse.gef4.dot.internal.parser.dot.Attribute attribute)
Checks whether the given
Attribute is used in the context of a
top-level graph. |
static boolean |
isNodeAttribute(org.eclipse.gef4.dot.internal.parser.dot.Attribute attribute)
Checks whether the given
Attribute is used in the context of a
node. |
static boolean |
isSubgraphAttribute(org.eclipse.gef4.dot.internal.parser.dot.Attribute attribute)
Checks whether the given
Attribute is used in the context of a
subgraph. |
java.util.List<org.eclipse.emf.common.util.Diagnostic> |
validateAttributeValue(DotJavaValidator.AttributeContext context,
java.lang.String name,
java.lang.String value)
Validate the attribute determined via name and value syntactically and
semantically.
|
getEPackages
acceptError, acceptError, acceptInfo, acceptInfo, acceptWarning, acceptWarning, addIssue, addIssue, addIssue, addIssue, addIssue, addIssueToState, checkDone, checkIsFromCurrentlyCheckedResource, createDiagnostic, createDiagnostic, createMethodWrapper, error, error, error, error, error, error, error, error, getChain, getCheckMode, getContext, getCurrentMethod, getCurrentObject, getIssueSeverities, getMessageAcceptor, guard, info, info, info, info, info, info, info, info, internalValidate, isIgnored, newInstance, setInjector, setMessageAcceptor, toDiagnosticSeverity, warning, warning, warning, warning, warning, warning, warning, warning
public void checkValidAttributeValue(org.eclipse.gef4.dot.internal.parser.dot.Attribute attribute)
Attribute
only valid attribute values are
used (dependent on context, in which the attribute is specified).attribute
- The Attribute
to validate.public java.util.List<org.eclipse.emf.common.util.Diagnostic> validateAttributeValue(DotJavaValidator.AttributeContext context, java.lang.String name, java.lang.String value)
context
- The context element the attribute is related to.name
- The name of the attribute.value
- The value of the attribute (may be quoted).Diagnostic
objects representing the identified
issues, or an empty list if no issues were found.public static boolean isNodeAttribute(org.eclipse.gef4.dot.internal.parser.dot.Attribute attribute)
Attribute
is used in the context of a
node. That is, it is either nested below an NodeStmt
or used
within an AttrStmt
of type AttributeType.NODE
.attribute
- The Attribute
to test.true
if the Attribute
is used in the context
of an node, false
otherwise.public static boolean isSubgraphAttribute(org.eclipse.gef4.dot.internal.parser.dot.Attribute attribute)
Attribute
is used in the context of a
subgraph.attribute
- The Attribute
to test.true
if the Attribute
is used in the context
of subgraph, false
otherwise.public static boolean isGraphAttribute(org.eclipse.gef4.dot.internal.parser.dot.Attribute attribute)
Attribute
is used in the context of a
top-level graph.attribute
- The Attribute
to test.true
if the Attribute
is used in the context
of a top-level graph, false
otherwise.public static boolean isEdgeAttribute(org.eclipse.gef4.dot.internal.parser.dot.Attribute attribute)
Attribute
is used in the context of an
edge. That is, it is either nested below an EdgeStmtNode
or an
EdgeStmtSubgraph
, or used within an AttrStmt
of type
AttributeType.EDGE
.attribute
- The Attribute
to test.true
if the Attribute
is used in the context
of an edge, false
otherwise.public void checkEdgeOpCorrespondsToGraphType(org.eclipse.gef4.dot.internal.parser.dot.EdgeRhsNode edgeRhsNode)
EdgeRhsNode
, '->' is used in directed
graphs, while '--' is used in undirected graphs.edgeRhsNode
- The EdgeRhsNode to validate.public void checkEdgeOpCorrespondsToGraphType(org.eclipse.gef4.dot.internal.parser.dot.EdgeRhsSubgraph edgeRhsSubgraph)
EdgeRhsSubgraph
'->' is used in directed
graphs, while '--' is used in undirected graphs.edgeRhsSubgraph
- The EdgeRhsSubgraph to validate.Copyright (c) 2014 itemis AG and others. All rights reserved.