Last change
on this file since 20 was
5,
checked in by zeiss, 14 years ago
|
|
-
Property svn:mime-type set to
text/plain
|
File size:
755 bytes
|
Rev | Line | |
---|
[5] | 1 | package de.ugoe.cs.swe.bnftools.utils;
|
---|
| 2 |
|
---|
| 3 | import org.eclipse.emf.ecore.EObject;
|
---|
| 4 | import org.eclipse.xtext.parsetree.CompositeNode;
|
---|
| 5 | import org.eclipse.xtext.parsetree.NodeAdapter;
|
---|
| 6 | import org.eclipse.xtext.parsetree.NodeUtil;
|
---|
| 7 | import org.eclipse.xtext.resource.XtextResource;
|
---|
| 8 | import org.eclipse.xtext.util.concurrent.IUnitOfWork;
|
---|
| 9 |
|
---|
| 10 | public class URIFragmentResolver implements
|
---|
| 11 | IUnitOfWork<CompositeNode, XtextResource> {
|
---|
| 12 | private String uriFragment;
|
---|
| 13 |
|
---|
| 14 | public URIFragmentResolver(String uriFragment) {
|
---|
| 15 | this.uriFragment = uriFragment;
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 | public CompositeNode exec(XtextResource state) throws Exception {
|
---|
| 19 | EObject o = state.getEObject(uriFragment);
|
---|
| 20 | NodeAdapter node = NodeUtil.getNodeAdapter(o);
|
---|
| 21 |
|
---|
| 22 | return node.getParserNode();
|
---|
| 23 |
|
---|
| 24 | }
|
---|
| 25 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.