Class TracingSugar
- java.lang.Object
-
- org.eclipse.xtext.generator.trace.node.GeneratorNodeExtensions
-
- org.eclipse.xtext.generator.trace.node.TracingSugar
-
public class TracingSugar extends GeneratorNodeExtensions
Some additional sugar extension to - create generator nodes for EObjects - create ILocationData for EObjects. - enhance FileSystemAccess for tracing
-
-
Field Summary
Fields Modifier and Type Field Description protected ILocationInFileProvider
locationProvider
protected GeneratorNodeProcessor
processor
protected ITraceURIConverter
traceURIConverter
protected GeneratorWhiteSpaceConfig
whiteSpaceConfig
-
Constructor Summary
Constructors Constructor Description TracingSugar()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generateTracedFile(IFileSystemAccess2 fsa, java.lang.String path, org.eclipse.emf.ecore.EObject rootTrace, org.eclipse.xtend2.lib.StringConcatenationClient code)
Convenience extension, to generate traced code.void
generateTracedFile(IFileSystemAccess2 fsa, java.lang.String path, CompositeGeneratorNode rootNode)
Use to generate a file based on generator node.ILocationData
location(org.eclipse.emf.ecore.EObject obj)
ILocationData
location(org.eclipse.emf.ecore.EObject obj, org.eclipse.emf.ecore.EStructuralFeature feature, int idx)
CompositeGeneratorNode
trace(org.eclipse.emf.ecore.EObject obj)
Convenience shorthand forobj.location.trace
CompositeGeneratorNode
trace(org.eclipse.emf.ecore.EObject obj, org.eclipse.xtend2.lib.StringConcatenationClient code)
Convenience shorthand forobj.trace.appendTemplate('''some template''')
-
Methods inherited from class org.eclipse.xtext.generator.trace.node.GeneratorNodeExtensions
append, appendNewLine, appendNewLine, appendNewLineIfNotEmpty, appendTemplate, indent, indent, trace, trace, trace, trace
-
-
-
-
Field Detail
-
locationProvider
@Inject protected ILocationInFileProvider locationProvider
-
traceURIConverter
@Inject protected ITraceURIConverter traceURIConverter
-
whiteSpaceConfig
@Inject protected GeneratorWhiteSpaceConfig whiteSpaceConfig
-
processor
@Inject protected GeneratorNodeProcessor processor
-
-
Method Detail
-
generateTracedFile
public void generateTracedFile(IFileSystemAccess2 fsa, java.lang.String path, org.eclipse.emf.ecore.EObject rootTrace, org.eclipse.xtend2.lib.StringConcatenationClient code)
Convenience extension, to generate traced code.
-
generateTracedFile
public void generateTracedFile(IFileSystemAccess2 fsa, java.lang.String path, CompositeGeneratorNode rootNode)
Use to generate a file based on generator node.
-
trace
public CompositeGeneratorNode trace(org.eclipse.emf.ecore.EObject obj)
Convenience shorthand forobj.location.trace
-
trace
public CompositeGeneratorNode trace(org.eclipse.emf.ecore.EObject obj, org.eclipse.xtend2.lib.StringConcatenationClient code)
Convenience shorthand forobj.trace.appendTemplate('''some template''')
-
location
public ILocationData location(org.eclipse.emf.ecore.EObject obj)
- Returns:
- ILocationData covering the
fullTextRegion
of the given EObject.
-
location
public ILocationData location(org.eclipse.emf.ecore.EObject obj, org.eclipse.emf.ecore.EStructuralFeature feature, int idx)
- Parameters:
obj
- the EObject containing the featurefeature
- the EStructuralFeature to traceidx
- the index of the value to trace, in case the feature contains a list, should be-1
otherwise.- Returns:
- ILocationData covering the
fullTextRegion
of the given feature in the given EObject.
-
-