Examples of StringInputStream


Examples of org.eclipse.xtext.util.StringInputStream

    this.injector = injector;
  }

  public IParseResult parseText(String text) {
    boolean ignoreSyntaxErrors = shouldIgnoreSyntaxErrorsIn(text);
    XtextResource resource = createResourceFrom(new StringInputStream(text));
    IParseResult parseResult = resource.getParseResult();
    if (ignoreSyntaxErrors || !parseResult.hasSyntaxErrors()) {
      return parseResult;
    }
    StringBuilder builder = new StringBuilder();
View Full Code Here

Examples of org.eclipse.xtext.util.StringInputStream

    reader = new ContentReader();
  }

  @Test public void should_read_InputStream() throws IOException {
    String contents = "Hello \r\n World";
    InputStream input = new StringInputStream(contents);
    assertThat(reader.contentsOf(input), equalTo(contents));
  }
View Full Code Here

Examples of org.eclipse.xtext.util.StringInputStream

   */
  public XtextResource createResource(URI uri, String contents) throws IOException {
    // TODO get project from URI.
    ResourceSet resourceSet = resourceSetProvider.get(projects.activeProject());
    XtextResource resource = (XtextResource) resourceSet.createResource(uri, UNSPECIFIED_CONTENT_TYPE);
    resource.load(new StringInputStream(contents), singletonMap(OPTION_ENCODING, UTF_8));
    resolveLazyCrossReferences(resource, NullImpl);
    return resource;
  }
View Full Code Here

Examples of org.hsqldb.lib.StringInputStream

        if (s == null) {
            return null;
        }

        return new StringInputStream(s);
    }
View Full Code Here

Examples of org.hsqldb.lib.StringInputStream

       
        // Now take the resulting HTML, process it using Dom4J
        SAXReader reader = new SAXReader(new Parser());
        reader.setEncoding("UTF-8");
        String htmlWithMarkup = parsedDatum.getParsedText();
        Document doc = reader.read(new StringInputStream(htmlWithMarkup));
       
        // We have to do helicopter stunts since HTML has a global namespace on it, set
        // at the <html> element level.
        XPath xpath = DocumentHelper.createXPath("/xhtml:html/xhtml:body/xhtml:p");
        Map<String, String> namespaceUris = new HashMap<String, String>();
View Full Code Here

Examples of org.hsqldb.lib.StringInputStream

    }
   
    @Override
    public void operate(FlowProcess process, FunctionCall<NullContext> funcCall) {
        _input.setTupleEntry(funcCall.getArguments());
        InputStream is = new StringInputStream(_input.getParsedText());
       
        try {
            Document parsedContent = _reader.read(is);
            process(_input, parsedContent, funcCall.getOutputCollector(), process);
        } catch (Exception e) {
View Full Code Here

Examples of org.hsqldb.lib.StringInputStream

        if (s == null) {
            return null;
        }

        return new StringInputStream(s);
    }
View Full Code Here

Examples of org.hsqldb.lib.StringInputStream

        if (s == null) {
            return null;
        }

        return new StringInputStream(s);
    }
View Full Code Here

Examples of org.hsqldb_voltpatches.lib.StringInputStream

        if (s == null) {
            return null;
        }

        return new StringInputStream(s);
    }
View Full Code Here

Examples of org.nutz.lang.stream.StringInputStream

   * @param cs
   *            文本
   * @return 输出流对象
   */
  public static InputStream ins(CharSequence cs) {
    return new StringInputStream(cs);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.