Package javax.xml.parsers

Examples of javax.xml.parsers.SAXParser


              throws ParserConfigurationException, SAXException, IOException {
        if (nmgr == null) {
            throw new RuntimeException("can't create a new Node without a NodeManager");
        }

        SAXParser parser = factory.newSAXParser();

        currentNode = null;

        parser.parse(file, this);

        return currentNode;
    }


               throws ParserConfigurationException, SAXException, IOException {
        if (helmaNode == null) {
            throw new RuntimeException("Can't create a new Node without a root Node");
        }

        SAXParser parser = factory.newSAXParser();

        rootNode = helmaNode;
        currentNode = null;
        convertedNodes = new HashMap();
        nodeStack = new Stack();
        parsingHopObject = true;

        parser.parse(in, this);

        return rootNode;
    }

    protected static final XMLReader getXMLReader(DocumentTableBuilder handler) throws Exception {
        final XMLReader myReader;

        SAXParserFactory factory = SAXParserFactory.newInstance();
        factory.setNamespaceAware(true);
        SAXParser parser = factory.newSAXParser();
        myReader = parser.getXMLReader();

        // setup handlers (requires saxHandler)
        myReader.setContentHandler(handler);
        myReader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
        myReader.setFeature("http://xml.org/sax/features/validation", true);

/**
* Reads parameter values from whichever input method was specified
* in the constructor.
*/
public void read() throws Exception {
    SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
    if (inFile != null)
  parser.parse(inFile, this);
    else if (inInputSource != null)
  parser.parse(inInputSource, this);
}

  protected static void parseNew(InputStream in, Channel ch, devplugin.Date day,
      Hashtable<String, MutableChannelDayProgram> ht, SweDBTvDataService dataService) throws Exception {
    SAXParserFactory fac = SAXParserFactory.newInstance();
    fac.setValidating(false);
    SAXParser sax = fac.newSAXParser();
    InputSource input = new InputSource(in);
    input.setSystemId(new File("/").toURI().toURL().toString());
    sax.parse(input, new DataHydraDayParser(ch, ht, dataService));
  }

    if (!mConfig.hasValidAddress()) {
      return null;
    }
    try {
      InputStream stream = openStreamForLocalUrl("/web/getservices?bRef=" + service);
      SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
      DreamboxHandler handler = new DreamboxHandler();
      saxParser.parse(stream, handler);
      return handler.getData();
    } catch (ParserConfigurationException e) {
      e.printStackTrace();
    } catch (SAXException e) {
      e.printStackTrace();

    if (!mConfig.hasValidAddress()) {
      return null;
    }
    try {
      InputStream stream = openStreamForLocalUrl("/web/getservices?sRef=" + service);
      SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
      DreamboxHandler handler = new DreamboxHandler();
      saxParser.parse(stream, handler);
      return handler.getData();
    } catch (ParserConfigurationException e) {
      e.printStackTrace();
    } catch (SAXException e) {
      e.printStackTrace();

    if (!mConfig.hasValidAddress()) {
      return null;
    }
    try {
      InputStream stream = openStreamForLocalUrl("/web/timerlist");
      SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
      DreamboxTimerHandler handler = new DreamboxTimerHandler();
      saxParser.parse(stream, handler);

      return handler.getTimers();
    } catch (ParserConfigurationException e) {
      e.printStackTrace();
    } catch (SAXException e) {

          + "&name=" + URLEncoder.encode(prgTime.getProgram().getTitle(), "UTF8") + "&description="
          + URLEncoder.encode(shortInfo, "UTF8") +

          "&afterevent=" + afterEvent + "&eit=&disabled=0&justplay=0&repeated=0");

      SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
      DreamboxStateHandler handler = new DreamboxStateHandler();
      saxParser.parse(stream, handler);
      return (Boolean.valueOf(handler.getState()));
    } catch (UnsupportedEncodingException e) {
      e.printStackTrace();
    } catch (MalformedURLException e) {
      e.printStackTrace();

          + "&name=" + URLEncoder.encode(prgTime.getProgram().getTitle(), "UTF8") + "&description="
          + URLEncoder.encode(shortInfo, "UTF8") +

          "&afterevent=0&eit=&disabled=0&justplay=0&repeated=0");

      SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
      DreamboxStateHandler handler = new DreamboxStateHandler();
      saxParser.parse(stream, handler);
      return Boolean.valueOf(handler.getState());
    } catch (UnsupportedEncodingException e) {
      e.printStackTrace();
    } catch (MalformedURLException e) {
      e.printStackTrace();

TOP

Related Classes of javax.xml.parsers.SAXParser

Copyright © 2018 www.massapicom. 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.