Package org.eclipse.xtext.util

Examples of org.eclipse.xtext.util.StringInputStream


  }

  private XExpression parseScriptIntoXTextEObject(String scriptAsString) throws ScriptParsingException {
    Resource resource = resourceSet.createResource(computeUnusedUri(resourceSet)); // IS-A XtextResource
    try {
      resource.load(new StringInputStream(scriptAsString), resourceSet.getLoadOptions());
    } catch (IOException e) {
      throw new ScriptParsingException("Unexpected IOException; from close() of a String-based ByteArrayInputStream, no real I/O; how is that possible???", scriptAsString, e);
    }
   
    List<Diagnostic> errors = resource.getErrors();
View Full Code Here


    textPart = (TextPart) section4.getTitle().getContents().get(0);
    assertEquals("fu", textPart.getText());
  }

  protected XdocFile getDoc(String string) throws Exception {
    return (XdocFile) doGetResource(new StringInputStream(string),
        URI.createFileURI("mytestmodel.xdoc")).getContents().get(0);
  }
View Full Code Here

   * @param uri
   * @return
   * @throws Exception
   */
  public final Resource loadResource(String sourceString, URI uri) throws Exception {
    return loadResource(new StringInputStream(sourceString, getEncodingProvider().getEncoding(uri)), uri);
  }
View Full Code Here

   * @param uri
   * @return
   * @throws Exception
   */
  public final Resource loadResource(String sourceString, URI uri) throws Exception {
    return loadResource(new StringInputStream(sourceString, "UTF8"), uri);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.xtext.util.StringInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.