|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.xtext.nodemodel.util.NodeModelUtils
public class NodeModelUtils
The NodeModelUtils are a collection of useful methods when dealing with the node model directly. They encapsulate the default construction semantics of the node model as it is created by the parser.
Constructor Summary | |
---|---|
NodeModelUtils()
|
Method Summary | |
---|---|
static java.lang.String |
compactDump(INode node,
boolean showHidden)
Creates a string representation of the given node. |
static ICompositeNode |
findActualNodeFor(org.eclipse.emf.ecore.EObject semanticObject)
Returns the node that covers all assigned values of the given object. |
static org.eclipse.emf.ecore.EObject |
findActualSemanticObjectFor(INode node)
Returns the semantic object that is really associated with the actual container node of the given node. |
static ILeafNode |
findLeafNodeAtOffset(INode node,
int leafNodeOffset)
Find the leaf node at the given offset. |
static java.util.List<INode> |
findNodesForFeature(org.eclipse.emf.ecore.EObject semanticObject,
org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
Returns the list of nodes that were used to assign values to the given feature for the given object. |
static ICompositeNode |
getNode(org.eclipse.emf.ecore.EObject object)
Returns the node that is directly associated with the given object by means of an EMF-Adapter. |
static java.lang.String |
getTokenText(INode node)
This method converts a node to text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NodeModelUtils()
Method Detail |
---|
public static ILeafNode findLeafNodeAtOffset(INode node, int leafNodeOffset)
null
if the given offset is not valid for the
node (sub-)tree.
A node matches the leafNodeOffset
if it fulfills the following condition:
node.totalOffset <= leafNodeOffset && node.totalEndOffset > leafNodeOffset
node
- the container node. May not be null
.leafNodeOffset
- the offset that is covered by the searched node.
null
.public static ICompositeNode getNode(org.eclipse.emf.ecore.EObject object)
findActualNodeFor(EObject)
public static java.util.List<INode> findNodesForFeature(org.eclipse.emf.ecore.EObject semanticObject, org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
public static ICompositeNode findActualNodeFor(org.eclipse.emf.ecore.EObject semanticObject)
actions
and unassigned rule calls
.
public static org.eclipse.emf.ecore.EObject findActualSemanticObjectFor(INode node)
Actions
and unassigned rule
calls
.
public static java.lang.String compactDump(INode node, boolean showHidden)
public static java.lang.String getTokenText(INode node)
ICompositeNode
that has been created for a data
type rule to text.
This is also the recommended way to convert a node to text if you want to invoke
IValueConverterService.toValue(String, String, INode)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |