org.geotools.xml.Parser.parser()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中org.geotools.xml.Parser.parser()方法的一些代码示例,展示了Parser.parser()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parser.parser()方法的具体详情如下:
包路径:org.geotools.xml.Parser
类名称:Parser
方法名:parser

Parser.parser介绍

[英]the sax parser driving the handler
[中]驱动处理程序的sax解析器

代码示例

代码示例来源:origin: org.geotools/gt2-xml-core

  1. /**
  2. * Parses an instance documented defined by a sax input source.
  3. * <p>
  4. * The object returned from the parse is the object which has been bound to the root
  5. * element of the document. This method should only be called once for a single instance document.
  6. * </p>
  7. *
  8. * @return The object representation of the root element of the document.
  9. *
  10. * @throws IOException
  11. * @throws SAXException
  12. * @throws ParserConfigurationException
  13. */
  14. public Object parse(InputSource source)
  15. throws IOException, SAXException, ParserConfigurationException {
  16. parser = parser();
  17. parser.setContentHandler(handler);
  18. parser.setErrorHandler(handler);
  19. parser.parse(source);
  20. return handler.getValue();
  21. }

代码示例来源:origin: org.geotools/gt2-xml-xsd

  1. /**
  2. * Parses an instance documented defined by a sax input source.
  3. * <p>
  4. * The object returned from the parse is the object which has been bound to the root
  5. * element of the document. This method should only be called once for a single instance document.
  6. * </p>
  7. *
  8. * @return The object representation of the root element of the document.
  9. *
  10. * @throws IOException
  11. * @throws SAXException
  12. * @throws ParserConfigurationException
  13. */
  14. public Object parse(InputSource source) throws IOException, SAXException, ParserConfigurationException {
  15. parser = parser();
  16. parser.setContentHandler( handler );
  17. parser.setErrorHandler( handler );
  18. parser.parse( source );
  19. return handler.getValue();
  20. }

代码示例来源:origin: org.geotools.xsd/gt-core

  1. /**
  2. * Parses an instance documented defined by a sax input source.
  3. * <p>
  4. * The object returned from the parse is the object which has been bound to the root
  5. * element of the document. This method should only be called once for a single instance document.
  6. * </p>
  7. *
  8. * @return The object representation of the root element of the document.
  9. *
  10. * @throws IOException
  11. * @throws SAXException
  12. * @throws ParserConfigurationException
  13. */
  14. public Object parse(InputSource source)
  15. throws IOException, SAXException, ParserConfigurationException {
  16. parser = parser();
  17. parser.setContentHandler(handler);
  18. parser.setErrorHandler(handler);
  19. parser.parse(source);
  20. return handler.getValue();
  21. }

相关文章