Examples of Parser


Examples of org.apache.abdera.parser.Parser

 
 
  protected Element _parse(String value, IRI baseUri) throws ParseException, IRISyntaxException {
    if (value == null) return null;
    FOMFactory fomfactory = (FOMFactory) factory;
    Parser parser = fomfactory.newParser();
    ByteArrayInputStream bais = new ByteArrayInputStream(value.getBytes());
    ParserOptions options = parser.getDefaultParserOptions();
    options.setCharset(getXMLStreamReader().getCharacterEncodingScheme());
    options.setFactory(fomfactory);
    Document doc = parser.parse(bais, baseUri.toString(), options);
    return doc.getRoot();
  }
View Full Code Here

Examples of org.apache.aries.blueprint.container.Parser

        return parse(name, handlers);
    }

    protected ComponentDefinitionRegistryImpl parse(String name, NamespaceHandlerRegistry.NamespaceHandlerSet handlers) throws Exception {
        ComponentDefinitionRegistryImpl registry = new ComponentDefinitionRegistryImpl();
        Parser parser = new Parser();
        parser.parse(Collections.singletonList(getClass().getResource(name)));
        parser.populate(handlers, registry);
        return registry;
    }
View Full Code Here

Examples of org.apache.aries.blueprint.parser.Parser

                LOGGER.debug("Running blueprint container for bundle {} in state {}", bundle.getSymbolicName(), state);
                switch (state) {
                    case Unknown:
                        readDirectives();
                        eventDispatcher.blueprintEvent(new BlueprintEvent(BlueprintEvent.CREATING, getBundle(), getExtenderBundle()));
                        parser = new Parser();
                        parser.parse(getResources());
                        namespaces = parser.getNamespaces();
                        handlerSet = handlers.getNamespaceHandlers(namespaces, getBundle());
                        handlerSet.addListener(this);
                        state = State.WaitForNamespaceHandlers;
View Full Code Here

Examples of org.apache.avalon.excalibur.xml.Parser

     * @throws ResourceNotFoundException if file not found or
     *         HTTP location does not exist.
     * @throws SAXException if failed to parse source document.
     */
    public void toSAX(ContentHandler handler) throws SAXException, ProcessingException {
        Parser parser = null;
        try {
            parser = (Parser)this.manager.lookup(Parser.ROLE);

            parser.parse( this.getInputSource(), handler);
        } catch (SAXException e) {
            // Preserve original exception
            throw e;
        } catch (Exception e){
            throw new ProcessingException("Exception during processing of "
View Full Code Here

Examples of org.apache.avro.Schema.Parser

  }
 
  @Test
  public void testGenerateAvro3() {
    try {
      Parser parser = new Schema.Parser();
      Schema peopleSchema = parser.parse(new File(getTestResource("people.avsc").toURI()));
      GenericDatumWriter<GenericRecord> datumWriter = new GenericDatumWriter<GenericRecord>(peopleSchema);
      DataFileWriter<GenericRecord> dfw = new DataFileWriter<GenericRecord>(datumWriter);
      File tempfile = File.createTempFile("karma-people", "avro");
     
      tempfile.deleteOnExit();
View Full Code Here

Examples of org.apache.avro.io.parsing.Parser

  }

  JsonEncoder(Schema sc, JsonGenerator out) throws IOException {
    configure(out);
    this.parser =
      new Parser(new JsonGrammarGenerator().generate(sc), this);
  }
View Full Code Here

Examples of org.apache.axis.wsdl.gen.Parser

    private PortTypeEntry portTypeEntry;
  private ArrayList methods; 

    public WSDL2Ws(CLArgParser cmdLineArgs) throws WrapperFault {
        try {
            Parser wsdlParser = new Parser();
            //get the commandline arguments
            String wsdlfile = cmdLineArgs.getArgument(0);
            wsdlParser.run(wsdlfile);

            symbolTable = wsdlParser.getSymbolTable();
           
            //get the target namespace
      targetNameSpaceOfWSDL = symbolTable.getDefinition().getTargetNamespace();
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

Examples of org.apache.batik.css.parser.Parser

            report.setErrorCode(ERROR_IS_INHERITED);
            report.setPassed(false);
            report.addDescriptionEntry(ERROR_IS_INHERITED, "");
        }

        Parser cssParser = new Parser();
        // see if the property supports the value 'inherit'
        try {
            LexicalUnit lu = cssParser.parsePropertyValue("inherit");
            Value v = manager.createValue(lu, null);
            String s = v.getCssText();
            if (!"inherit".equalsIgnoreCase(s)) {
                report.setErrorCode(ERROR_INHERIT_VALUE);
                report.setPassed(false);
                report.addDescriptionEntry(ERROR_INHERIT_VALUE, "inherit");
            }
        } catch (Exception ex) {
            report.setErrorCode(ERROR_INHERIT_VALUE);
            report.setPassed(false);
            report.addDescriptionEntry(ERROR_INHERIT_VALUE, ex.getMessage());
        }

        // test all possible identifiers
        if (identValues != null) {
            try {
                for (int i=0; i < identValues.length; ++i) {
                    LexicalUnit lu = cssParser.parsePropertyValue(identValues[i]);
                    Value v = manager.createValue(lu, null);
                    String s = v.getCssText();
                    if (!identValues[i].equalsIgnoreCase(s)) {
                        report.setErrorCode(ERROR_INVALID_VALUE);
                        report.setPassed(false);
View Full Code Here

Examples of org.apache.blur.jdbc.parser.Parser

  public ResultSet getResultSet() throws SQLException {
    try {
      System.out.println(sql);
      Iface client = BlurClient.getClient(connection.getConnectionString());
      Parser parser = new Parser();
      parser.parse(sql);
      if (isSuperQuery(parser, client)) {
        System.out.println("super");
        return new BlurResultSetRows(client, parser);
      } else {
        return new BlurResultSetRecords(client, parser);
View Full Code Here

Examples of org.apache.cayenne.wocompat.parser.Parser

        URL base = locator.findDirectoryResource(path);
        if (base == null) {
            throw new FileNotFoundException("Can't find EOModel: " + path);
        }

        Parser plistParser = new Parser();
        InputStream in = new URL(base, "index.eomodeld").openStream();

        try {
            plistParser.ReInit(in);
            return (Map) plistParser.propertyList();
        }
        finally {
            in.close();
        }
    }
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.