Examples of Parser


Examples of org.eclipse.jetty.websocket.common.Parser

        expected.put(b);
        expected.put(bytes);

        expected.flip();

        Parser parser = new UnitParser(policy);
        IncomingFramesCapture capture = new IncomingFramesCapture();
        parser.setIncomingFramesHandler(capture);
        parser.parse(expected);

        capture.assertNoErrors();
        capture.assertHasFrame(OpCode.PING,1);

        Frame pActual = capture.getFrames().poll();
View Full Code Here

Examples of org.eclipse.orion.server.cf.manifest.v2.Parser

  private ManifestParseTree parse(InputStream inputStream) throws IOException, TokenizerException, ParserException {
    Preprocessor preprocessor = new ManifestPreprocessor();
    List<InputLine> contents = preprocessor.process(inputStream);
    Tokenizer tokenizer = new ManifestTokenizer(contents);

    Parser parser = new ManifestParser();
    return parser.parse(tokenizer);
  }
View Full Code Here

Examples of org.eigenbase.xom.Parser

     * @param catalogUrl URL of catalog
     * @param catalogStr Text of catalog, or null
     */
    protected void load(String catalogUrl, String catalogStr) {
        try {
            final Parser xmlParser = XOMUtil.createDefaultParser();

            final DOMWrapper def;
            if (catalogStr == null) {
                InputStream in = null;
                try {
                    in = Util.readVirtualFile(catalogUrl);
                    def = xmlParser.parse(in);
                } finally {
                    if (in != null) {
                        in.close();
                    }
                }

                if (getLogger().isDebugEnabled()) {
                    try {
                        StringBuilder buf = new StringBuilder(1000);
                        InputStream debugIn = Util.readVirtualFile(catalogUrl);
                        int n;
                        while ((n = debugIn.read()) != -1) {
                            buf.append((char) n);
                        }
                        getLogger().debug(
                            "RolapSchema.load: content: \n" + buf.toString());
                    } catch (java.io.IOException ex) {
                        getLogger().debug("RolapSchema.load: ex=" + ex);
                    }
                }

            } else {
                if (getLogger().isDebugEnabled()) {
                    getLogger().debug(
                        "RolapSchema.load: catalogStr: \n" + catalogStr);
                }

                def = xmlParser.parse(catalogStr);
            }

            xmlSchema = new MondrianDef.Schema(def);

            if (getLogger().isDebugEnabled()) {
View Full Code Here

Examples of org.exolab.castor.jdo.oql.Parser

            createCall(oql);
            return;
        }

        Lexer lexer = new Lexer(oql);
        Parser parser = new Parser(lexer);
        ParseTreeNode parseTree = parser.getParseTree();

        _dbEngine = ((AbstractDatabaseImpl) _database).getLockEngine();
        if (_dbEngine == null) {
            throw new QueryException("Could not get a persistence engine");
        }
View Full Code Here

Examples of org.fife.ui.rsyntaxtextarea.parser.Parser

    String style = textArea.getSyntaxEditingStyle();
    doc.readLock();
    try {
      for (int i=0; i<parserCount; i++) {
        Parser parser = getParser(i);
        ParseResult res = parser.parse(doc, style);
        addParserNoticeHighlights(res);
      }
      textArea.fireParserNoticesChange();
    } finally {
      doc.readUnlock();
View Full Code Here

Examples of org.formulacompiler.spreadsheet.internal.odf.xml.stream.Parser

  {
    final SpreadsheetBuilder spreadsheetBuilder = new SpreadsheetBuilder( ComputationMode.OPEN_OFFICE_CALC );

    try {
      final SpreadsheetParser spreadsheetParser = new SpreadsheetParser( spreadsheetBuilder, this.config );
      final Parser parser = new Parser( Collections.singletonMap( XMLConstants.Office.SPREADSHEET, spreadsheetParser ) );
      parser.parse( _inputStream );
    }
    catch (XMLStreamException e) {
      final Throwable nestedException = e.getNestedException();
      if (nestedException != null) {
        e.initCause( nestedException );
View Full Code Here

Examples of org.geotools.referencing.wkt.Parser

    /**
     * Tests the distance between points function
     */
    public void testOrthodromicDistance() throws Exception {
        final Parser parser = new Parser();
        final DefaultProjectedCRS crs  = (DefaultProjectedCRS) parser.parseObject(NAD83_BC);
        double d = JTS.orthodromicDistance(new Coordinate(1402848.1938534670, 651571.1729878788),
                                           new Coordinate(1389481.3104009738, 641990.9430108378), crs);
        double realValue = 16451.33114;
        assertEquals(realValue, d, 0.1);
    }
View Full Code Here

Examples of org.geotools.xml.Parser

        StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory();
     // try SLD 1.1 first
        SLDConfiguration config = new SLDConfiguration();
        Reader reader = null;
        try {
            Parser parser = new Parser( config );
            reader = new FileReader(file);
            Object object = parser.parse( reader );
            if( object instanceof StyledLayerDescriptor){
                StyledLayerDescriptor sld = (StyledLayerDescriptor) object;
                return sld;
            }
            else if ( object instanceof NamedStyle ){
                NamedStyle style = (NamedStyle) object;
                StyledLayerDescriptor sld = createDefaultSLD( style );
                return sld;
            }
        }
        catch(Exception ignore){
            // we are ignoring this error and will try the more forgiving option below
            UiPlugin.trace(SLDs.class,"SLD 1.1 configuration failed to parse "+file, ignore);
        }
        finally {
            if( reader != null){
                reader.close();
            }
        }
        // parse it up
        SLDParser parser = new SLDParser(styleFactory);
        try {
            parser.setInput(file);
            StyledLayerDescriptor sld = parser.parseSLD();
            return sld;
        } catch (FileNotFoundException e) {
            return null; // well that is unexpected since f.exists()
        }
    }
View Full Code Here

Examples of org.glassfish.hk2.classmodel.reflect.Parser

        if (null != inhabitantsClassPath) {
          builder.locator(new Locator(inhabitantsClassPath));
        }
       
        context = builder.build();
        parser = new Parser(context);
    }
View Full Code Here

Examples of org.graphstream.util.parser.Parser

   * (non-Javadoc)
   *
   * @see org.graphstream.stream.file.FileSource#readAll(java.lang.String)
   */
  public void readAll(String fileName) throws IOException {
    Parser parser = factory.newParser(createReaderForFile(fileName));

    try {
      parser.all();
      parser.close();
    } catch (ParseException e) {
      throw new IOException(e);
    }
  }
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.