Examples of Parser


Examples of org.papoose.core.filter.Parser

        poo.start();

        try
        {
            poo.setParser(new Parser());
            Assert.fail("Should not allow parser to be set after framework starts");
        }
        catch (Exception e)
        {
        }

        try
        {
            poo.setResolver(new MockResolver());
            Assert.fail("Should not allow resolver to be set after framework starts");
        }
        catch (Exception e)
        {
        }

        poo.stop();
        poo.waitForStop(0);

        try
        {
            poo.setParser(new Parser());
        }
        catch (Exception e)
        {
            Assert.fail("Should allow parser to be set before framework starts: " + poo.getState());
        }
View Full Code Here

Examples of org.pdfclown.documents.contents.tokens.Parser

  // <private>
  private void load(
    )
  {
    final Parser parser = new Parser(getBaseDataObject());
    try
    {items = parser.parseContentObjects();}
    catch(Exception e)
    {throw new RuntimeException(e);}
  }
View Full Code Here

Examples of org.pdfclown.tokens.Parser

          case Free:
            break;
          // In-use entry (late-bound data object).
          case InUse:
          {
            Parser parser = file.getReader().getParser();
            // Retrieve the associated data object among the original objects!
            parser.seek(xrefEntry.getOffset());
            // Get the indirect data object!
            dataObject = parser.parsePdfObject(4); // NOTE: Skips the indirect-object header.
            break;
          }
          case InUseCompressed:
          {
            // Get the object stream where its data object is stored!
View Full Code Here

Examples of org.tautua.markdownpapers.parser.Parser

public class PlaintextTest {

    public void renderAndCompare(String mdFile, String txtFile) throws Exception {
        StringWriter sw = new StringWriter();
        try (InputStreamReader stream = new InputStreamReader(PlaintextTest.class.getResourceAsStream(mdFile))) {
            Parser parser = new Parser(stream);
            Document document = parser.parse();
            PlaintextMarkdownVisitor emitter = new PlaintextMarkdownVisitor(new WordWrap(sw));
            document.accept(emitter);
        }
       
        StringBuilder sb = new StringBuilder();
View Full Code Here

Examples of org.testng.xml.Parser

    try {
      URL jarfile = new URL("jar", "", "file:" + jarFile.getAbsolutePath() + "!/");
      URLClassLoader jarLoader = new URLClassLoader(new URL[] { jarfile });
      Thread.currentThread().setContextClassLoader(jarLoader);

      m_suites.addAll(new Parser().parse());
    }
    catch(MalformedURLException mfurle) {
      System.err.println("could not find jar file named: " + jarFile.getAbsolutePath());
    }
    catch(IOException ioe) {
View Full Code Here

Examples of org.w3c.css.sac.Parser

                         final ResourceKey context)
      throws ResourceCreationException, ResourceLoadingException
  {
    try
    {
      final Parser parser = CSSParserFactory.getInstance().createCSSParser();
      final ResourceKey key;
      final long version;
      if (context == null)
      {
        key = data.getKey();
        version = data.getVersion(manager);
      }
      else
      {
        key = context;
        version = -1;
      }

      final DocumentContext documentContext;

      final StyleSheetHandler handler = new StyleSheetHandler();
      handler.init(StyleKeyRegistry.getRegistry(), manager, key, version, null);
      parser.setDocumentHandler(handler);

      final InputSource inputSource = new InputSource();
      inputSource.setByteStream(data.getResourceAsStream(manager));

      handler.initParseContext(inputSource);
      handler.setStyleRule(new CSSStyleRule(null, null));
      parser.parseStyleDeclaration(inputSource);

      final DependencyCollector dependencies = handler.getDependencies();
      if (context != null)
      {
        dependencies.add(data.getKey(), data.getVersion(manager));
View Full Code Here

Examples of org.w3c.flute.parser.Parser

  /**
   * Create a CssStylesheet from the contents of a URL.
   */
  public static CssStylesheet exec(TreeLogger logger, URL[] stylesheets)
      throws UnableToCompleteException {
    Parser p = new Parser();
    Errors errors = new Errors(logger);
    GenerationHandler g = new GenerationHandler(errors);
    p.setDocumentHandler(g);
    p.setErrorHandler(errors);

    for (URL stylesheet : stylesheets) {
      TreeLogger branchLogger = logger.branch(TreeLogger.DEBUG,
          "Parsing CSS stylesheet " + stylesheet.toExternalForm());
      try {
        p.parseStyleSheet(stylesheet.toURI().toString());
        continue;
      } catch (CSSException e) {
        branchLogger.log(TreeLogger.ERROR, "Unable to parse CSS", e);
      } catch (IOException e) {
        branchLogger.log(TreeLogger.ERROR, "Unable to parse CSS", e);
View Full Code Here

Examples of org.xml.sax.Parser

      throws InstantiationException,IllegalAccessException,ClassNotFoundException,IOException,SAXException {
        // This method parses an XML document into a ShoppingBasket instace

        // local variables
        XMLReader parser;
        Parser sax1Parser;
        StringBufferInputStream oStrBuff;
        InputSource ioSrc;

        if (DebugFile.trace) {
          DebugFile.writeln ("Begin ShoppingBasket.parse(String)");
View Full Code Here

Examples of org.yaml.snakeyaml.parser.Parser

        if (target.respondsTo("read")) {
            reader = new StreamReader(new InputStreamReader(new IOInputStream(target)));
        } else {
            reader = new StreamReader(new StringReader(target.convertToString().asJavaString()));
        }
        Parser parser = new ParserImpl(reader);
        IRubyObject handler = getInstanceVariable("@handler");
        Event event;

        while (true) {
            try {
                event = parser.getEvent();

                // FIXME: Event should expose a getID, so it can be switched
                if (event.is(ID.StreamStart)) {
                    invoke(
                            context,
View Full Code Here

Examples of org.zkoss.selector.lang.Parser

    //String selector = "div#id.class span.class2 > #id3 ~ intbox";
    //String selector = "[attr$=\"value\"]    +   div:pseudo(2)[attr2*=596]  tab#kerker";
    String selector = ":first-child";
   
    List<Token> tokens = new Tokenizer().tokenize(selector);
    Parser p = new Parser();
    p.setDebugMode(true);
   
    Selector model = p.parse(tokens, selector);
   
    System.out.println("\n\n==== Selector ====\n\n");
    System.out.println(model.toDebugString());
    System.out.println("\n\n==== Selector repacked ====\n\n");
    System.out.println(model);
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.