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

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

本文整理了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

/**
 * Parses an instance documented defined by a sax input source.
 * <p>
 * The object returned from the parse is the object which has been bound to the root
 * element of the document. This method should only be called once for a single instance document.
 * </p>
 *
 * @return The object representation of the root element of the document.
 *
 * @throws IOException
 * @throws SAXException
 * @throws ParserConfigurationException
 */
public Object parse(InputSource source)
  throws IOException, SAXException, ParserConfigurationException {
  parser = parser();
  parser.setContentHandler(handler);
  parser.setErrorHandler(handler);
  parser.parse(source);
  return handler.getValue();
}

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

/**
 * Parses an instance documented defined by a sax input source.
 * <p>
 * The object returned from the parse is the object which has been bound to the root
 * element of the document. This method should only be called once for a single instance document.
 * </p>
 * 
 * @return The object representation of the root element of the document.
 *
 * @throws IOException
 * @throws SAXException
 * @throws ParserConfigurationException 
 */
public Object parse(InputSource source) throws IOException, SAXException, ParserConfigurationException {
  parser = parser();
  parser.setContentHandler( handler );
  parser.setErrorHandler( handler );
  
  parser.parse( source );
  
  return handler.getValue();
}

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

/**
 * Parses an instance documented defined by a sax input source.
 * <p>
 * The object returned from the parse is the object which has been bound to the root
 * element of the document. This method should only be called once for a single instance document.
 * </p>
 *
 * @return The object representation of the root element of the document.
 *
 * @throws IOException
 * @throws SAXException
 * @throws ParserConfigurationException
 */
public Object parse(InputSource source)
  throws IOException, SAXException, ParserConfigurationException {
  parser = parser();
  parser.setContentHandler(handler);
  parser.setErrorHandler(handler);
  parser.parse(source);
  return handler.getValue();
}

相关文章