com.sun.syndication.io.WireFeedInput.createSAXBuilder()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(108)

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

WireFeedInput.createSAXBuilder介绍

[英]Creates and sets up a org.jdom2.input.SAXBuilder for parsing.
[中]创建并建立一个组织。jdom2。输入用于解析的SAXBuilder。

代码示例

代码示例来源:origin: org.apache.marmotta/sesame-tools-rio-rss

  1. /**
  2. * Builds an WireFeed (RSS or Atom) from an W3C SAX InputSource.
  3. * <p>
  4. * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'.
  5. * <p>
  6. * @param is W3C SAX InputSource to read to create the WireFeed.
  7. * @return the WireFeed read from the W3C SAX InputSource.
  8. * @throws IllegalArgumentException thrown if feed type could not be understood by any of the underlying parsers.
  9. * @throws FeedException if the feed could not be parsed
  10. *
  11. */
  12. public WireFeed build(InputSource is) throws IllegalArgumentException,FeedException {
  13. SAXBuilder saxBuilder = createSAXBuilder();
  14. try {
  15. Document document = saxBuilder.build(is);
  16. return build(document);
  17. }
  18. catch (JDOMParseException ex) {
  19. throw new ParsingFeedException("Invalid XML: " + ex.getMessage(), ex);
  20. }
  21. catch (IllegalArgumentException ex) {
  22. throw ex;
  23. }
  24. catch (Exception ex) {
  25. throw new ParsingFeedException("Invalid XML",ex);
  26. }
  27. }

代码示例来源:origin: rome/rome

  1. /**
  2. * Builds an WireFeed (RSS or Atom) from an W3C SAX InputSource.
  3. * <p>
  4. * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom.Document)'.
  5. * <p>
  6. * @param is W3C SAX InputSource to read to create the WireFeed.
  7. * @return the WireFeed read from the W3C SAX InputSource.
  8. * @throws IllegalArgumentException thrown if feed type could not be understood by any of the underlying parsers.
  9. * @throws FeedException if the feed could not be parsed
  10. *
  11. */
  12. public WireFeed build(InputSource is) throws IllegalArgumentException,FeedException {
  13. SAXBuilder saxBuilder = createSAXBuilder();
  14. try {
  15. Document document = saxBuilder.build(is);
  16. return build(document);
  17. }
  18. catch (JDOMParseException ex) {
  19. throw new ParsingFeedException("Invalid XML: " + ex.getMessage(), ex);
  20. }
  21. catch (IllegalArgumentException ex) {
  22. throw ex;
  23. }
  24. catch (Exception ex) {
  25. throw new ParsingFeedException("Invalid XML",ex);
  26. }
  27. }

代码示例来源:origin: com.sun.syndication/com.springsource.com.sun.syndication

  1. /**
  2. * Builds an WireFeed (RSS or Atom) from an W3C SAX InputSource.
  3. * <p>
  4. * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom.Document)'.
  5. * <p>
  6. * @param is W3C SAX InputSource to read to create the WireFeed.
  7. * @return the WireFeed read from the W3C SAX InputSource.
  8. * @throws IllegalArgumentException thrown if feed type could not be understood by any of the underlying parsers.
  9. * @throws FeedException if the feed could not be parsed
  10. *
  11. */
  12. public WireFeed build(InputSource is) throws IllegalArgumentException,FeedException {
  13. SAXBuilder saxBuilder = createSAXBuilder();
  14. try {
  15. Document document = saxBuilder.build(is);
  16. return build(document);
  17. }
  18. catch (JDOMParseException ex) {
  19. throw new ParsingFeedException("Invalid XML: " + ex.getMessage(), ex);
  20. }
  21. catch (IllegalArgumentException ex) {
  22. throw ex;
  23. }
  24. catch (Exception ex) {
  25. throw new ParsingFeedException("Invalid XML",ex);
  26. }
  27. }

代码示例来源:origin: apache/marmotta

  1. /**
  2. * Builds an WireFeed (RSS or Atom) from an W3C SAX InputSource.
  3. * <p>
  4. * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'.
  5. * <p>
  6. * @param is W3C SAX InputSource to read to create the WireFeed.
  7. * @return the WireFeed read from the W3C SAX InputSource.
  8. * @throws IllegalArgumentException thrown if feed type could not be understood by any of the underlying parsers.
  9. * @throws FeedException if the feed could not be parsed
  10. *
  11. */
  12. public WireFeed build(InputSource is) throws IllegalArgumentException,FeedException {
  13. SAXBuilder saxBuilder = createSAXBuilder();
  14. try {
  15. Document document = saxBuilder.build(is);
  16. return build(document);
  17. }
  18. catch (JDOMParseException ex) {
  19. throw new ParsingFeedException("Invalid XML: " + ex.getMessage(), ex);
  20. }
  21. catch (IllegalArgumentException ex) {
  22. throw ex;
  23. }
  24. catch (Exception ex) {
  25. throw new ParsingFeedException("Invalid XML",ex);
  26. }
  27. }

代码示例来源:origin: rome/rome

  1. /**
  2. * Builds an WireFeed (RSS or Atom) from an Reader.
  3. * <p>
  4. * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom.Document)'.
  5. * <p>
  6. * @param reader Reader to read to create the WireFeed.
  7. * @return the WireFeed read from the Reader.
  8. * @throws IllegalArgumentException thrown if feed type could not be understood by any of the underlying parsers.
  9. * @throws FeedException if the feed could not be parsed
  10. *
  11. */
  12. public WireFeed build(Reader reader) throws IllegalArgumentException,FeedException {
  13. SAXBuilder saxBuilder = createSAXBuilder();
  14. try {
  15. if (_xmlHealerOn) {
  16. reader = new XmlFixerReader(reader);
  17. }
  18. Document document = saxBuilder.build(reader);
  19. return build(document);
  20. }
  21. catch (JDOMParseException ex) {
  22. throw new ParsingFeedException("Invalid XML: " + ex.getMessage(), ex);
  23. }
  24. catch (IllegalArgumentException ex) {
  25. throw ex;
  26. }
  27. catch (Exception ex) {
  28. throw new ParsingFeedException("Invalid XML",ex);
  29. }
  30. }

代码示例来源:origin: com.sun.syndication/com.springsource.com.sun.syndication

  1. /**
  2. * Builds an WireFeed (RSS or Atom) from an Reader.
  3. * <p>
  4. * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom.Document)'.
  5. * <p>
  6. * @param reader Reader to read to create the WireFeed.
  7. * @return the WireFeed read from the Reader.
  8. * @throws IllegalArgumentException thrown if feed type could not be understood by any of the underlying parsers.
  9. * @throws FeedException if the feed could not be parsed
  10. *
  11. */
  12. public WireFeed build(Reader reader) throws IllegalArgumentException,FeedException {
  13. SAXBuilder saxBuilder = createSAXBuilder();
  14. try {
  15. if (_xmlHealerOn) {
  16. reader = new XmlFixerReader(reader);
  17. }
  18. Document document = saxBuilder.build(reader);
  19. return build(document);
  20. }
  21. catch (JDOMParseException ex) {
  22. throw new ParsingFeedException("Invalid XML: " + ex.getMessage(), ex);
  23. }
  24. catch (IllegalArgumentException ex) {
  25. throw ex;
  26. }
  27. catch (Exception ex) {
  28. throw new ParsingFeedException("Invalid XML",ex);
  29. }
  30. }

代码示例来源:origin: org.apache.marmotta/sesame-tools-rio-rss

  1. /**
  2. * Builds an WireFeed (RSS or Atom) from an Reader.
  3. * <p>
  4. * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'.
  5. * <p>
  6. * @param reader Reader to read to create the WireFeed.
  7. * @return the WireFeed read from the Reader.
  8. * @throws IllegalArgumentException thrown if feed type could not be understood by any of the underlying parsers.
  9. * @throws FeedException if the feed could not be parsed
  10. *
  11. */
  12. public WireFeed build(Reader reader) throws IllegalArgumentException,FeedException {
  13. SAXBuilder saxBuilder = createSAXBuilder();
  14. try {
  15. if (_xmlHealerOn) {
  16. reader = new XmlFixerReader(reader);
  17. }
  18. Document document = saxBuilder.build(reader);
  19. return build(document);
  20. }
  21. catch (JDOMParseException ex) {
  22. throw new ParsingFeedException("Invalid XML: " + ex.getMessage(), ex);
  23. }
  24. catch (IllegalArgumentException ex) {
  25. throw ex;
  26. }
  27. catch (Exception ex) {
  28. throw new ParsingFeedException("Invalid XML",ex);
  29. }
  30. }

代码示例来源:origin: apache/marmotta

  1. /**
  2. * Builds an WireFeed (RSS or Atom) from an Reader.
  3. * <p>
  4. * NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'.
  5. * <p>
  6. * @param reader Reader to read to create the WireFeed.
  7. * @return the WireFeed read from the Reader.
  8. * @throws IllegalArgumentException thrown if feed type could not be understood by any of the underlying parsers.
  9. * @throws FeedException if the feed could not be parsed
  10. *
  11. */
  12. public WireFeed build(Reader reader) throws IllegalArgumentException,FeedException {
  13. SAXBuilder saxBuilder = createSAXBuilder();
  14. try {
  15. if (_xmlHealerOn) {
  16. reader = new XmlFixerReader(reader);
  17. }
  18. Document document = saxBuilder.build(reader);
  19. return build(document);
  20. }
  21. catch (JDOMParseException ex) {
  22. throw new ParsingFeedException("Invalid XML: " + ex.getMessage(), ex);
  23. }
  24. catch (IllegalArgumentException ex) {
  25. throw ex;
  26. }
  27. catch (Exception ex) {
  28. throw new ParsingFeedException("Invalid XML",ex);
  29. }
  30. }

相关文章