Examples of Parseable


Examples of org.kohsuke.rngom.parse.Parseable

            throw new UnsupportedOperationException("visitNull");
        }
    }

    public static void main(String[] args) throws Exception {
        Parseable p;

        ErrorHandler eh = new DefaultHandler() {
            @Override
            public void error(SAXParseException e) throws SAXException {
                throw e;
            }
        };

        // the error handler passed to Parseable will receive parsing errors.
        String path = new File(args[0]).toURL().toString();
        if (args[0].endsWith(".rng")) {
            p = new SAXParseable(new InputSource(path), eh);
        } else {
            p = new CompactParseable(new InputSource(path), eh);
        }

        // the error handler passed to CheckingSchemaBuilder will receive additional
        // errors found during the RELAX NG restrictions check.
        // typically you'd want to pass in the same error handler,
        // as there's really no distinction between those two kinds of errors.
        SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(), eh);
        try {
            // run the parser
            DGrammarPattern grammar = (DGrammarPattern) p.parse(sb);
            OutputStream out = new FileOutputStream(args[1]);
            XMLOutputFactory factory = XMLOutputFactory.newInstance();
            factory.setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.TRUE);
            XMLStreamWriter output = factory.createXMLStreamWriter(out);
            DXMLPrinter printer = new DXMLPrinter(output);
View Full Code Here

Examples of org.kohsuke.rngom.parse.Parseable

        }

        if(opts.xsd.isOn())
            return new XmlSchemaLoader(in);

        final Parseable parseable = makeRELAXNGSource(opts, in, eh, f);

        return new RELAXNGLoader(parseable);
    }
View Full Code Here

Examples of us.bpsm.edn.parser.Parseable

   * @param ednString
   * @return
   */
  public static AMatrix parse(String ednString) {
    Parser p = Parsers.newParser(getMatrixParserConfig());
    Parseable ps = Parsers.newParseable(ednString);
    @SuppressWarnings("unchecked")
    List<List<Object>> data = (List<List<Object>>) p.nextValue(ps);
    int rc = data.size();
    int cc = (rc == 0) ? 0 : data.get(0).size();
    AMatrix m = newMatrix(rc, cc);
View Full Code Here

Examples of us.bpsm.edn.parser.Parseable

      return Array.createFromVector(a,shape);
    }
  }
 
  public static INDArray load(Reader reader) {
    Parseable pbr=Parsers.newParseable(reader);
    Parser p = Parsers.newParser(Parsers.defaultConfiguration());
    return Arrayz.create(p.nextValue(pbr));
  }
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.