org.apache.xml.resolver.helpers.Debug.message()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(11.8k)|赞(0)|评价(0)|浏览(238)

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

Debug.message介绍

[英]Print debug message (if the debug level is high enough).

Prints "the message"
[中]打印调试消息(如果调试级别足够高)。
打印“消息”

代码示例

代码示例来源:origin: org.apache.commons/commons-configuration2

  1. catalogCwd = base;
  2. default_override = catalogManager.getPreferPublic();
  3. catalogManager.debug.message(DEBUG_NORMAL, "Parse catalog: " + fileName);
  4. catalogManager.debug.message(DEBUG_NORMAL, "Unable to access " + base
  5. + ex.getMessage());
  6. break;
  7. catalogManager.debug.message(DEBUG_NORMAL, "Parse failed for " + fileName
  8. + ce.getMessage());
  9. if (ce.getExceptionType() == CatalogException.PARSE_FAILED)

代码示例来源:origin: org.apache.commons/commons-configuration2

  1. catalogManager.debug.message(DEBUG_ALL,
  2. "Unable to get input stream for " + name + ". " + ce.getMessage());
  3. catalogManager.debug.message(DEBUG_ALL,
  4. "Exception caught parsing input stream for " + fileName + ". "
  5. + ex.getMessage());

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver

  1. /**
  2. * Handle unknown CatalogEntry types.
  3. *
  4. * <p>This method exists to allow subclasses to deal with unknown
  5. * entry types.</p>
  6. */
  7. public void unknownEntry(Vector strings) {
  8. if (strings != null && strings.size() > 0) {
  9. String keyword = (String) strings.elementAt(0);
  10. catalogManager.debug.message(2, "Unrecognized token parsing catalog", keyword);
  11. }
  12. }

代码示例来源:origin: xml-resolver/xml-resolver

  1. public boolean checkAttributes (Attributes atts, String attName) {
  2. if (atts.getValue(attName) == null) {
  3. debug.message(1, "Error: required attribute " + attName + " missing.");
  4. return false;
  5. } else {
  6. return true;
  7. }
  8. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver

  1. public boolean checkAttributes (Attributes atts, String attName) {
  2. if (atts.getValue(attName) == null) {
  3. debug.message(1, "Error: required attribute " + attName + " missing.");
  4. return false;
  5. } else {
  6. return true;
  7. }
  8. }

代码示例来源:origin: org.apache.xml/com.springsource.org.apache.xml.resolver

  1. public boolean checkAttributes (Attributes atts, String attName) {
  2. if (atts.getValue(attName) == null) {
  3. debug.message(1, "Error: required attribute " + attName + " missing.");
  4. return false;
  5. } else {
  6. return true;
  7. }
  8. }

代码示例来源:origin: xml-resolver/xml-resolver

  1. /**
  2. * Handle unknown CatalogEntry types.
  3. *
  4. * <p>This method exists to allow subclasses to deal with unknown
  5. * entry types.</p>
  6. */
  7. public void unknownEntry(Vector strings) {
  8. if (strings != null && strings.size() > 0) {
  9. String keyword = (String) strings.elementAt(0);
  10. catalogManager.debug.message(2, "Unrecognized token parsing catalog", keyword);
  11. }
  12. }

代码示例来源:origin: org.apache.xml/com.springsource.org.apache.xml.resolver

  1. /**
  2. * Handle unknown CatalogEntry types.
  3. *
  4. * <p>This method exists to allow subclasses to deal with unknown
  5. * entry types.</p>
  6. */
  7. public void unknownEntry(Vector strings) {
  8. if (strings != null && strings.size() > 0) {
  9. String keyword = (String) strings.elementAt(0);
  10. catalogManager.debug.message(2, "Unrecognized token parsing catalog", keyword);
  11. }
  12. }

代码示例来源:origin: xml-resolver/xml-resolver

  1. /**
  2. * Construct an absolute URI from a relative one, using the current
  3. * base URI.
  4. *
  5. * @param sysid The (possibly relative) system identifier
  6. * @return The system identifier made absolute with respect to the
  7. * current {@link #base}.
  8. */
  9. protected String makeAbsolute(String sysid) {
  10. URL local = null;
  11. sysid = fixSlashes(sysid);
  12. try {
  13. local = new URL(base, sysid);
  14. } catch (MalformedURLException e) {
  15. catalogManager.debug.message(1, "Malformed URL on system identifier", sysid);
  16. }
  17. if (local != null) {
  18. return local.toString();
  19. } else {
  20. return sysid;
  21. }
  22. }

代码示例来源:origin: org.apache.xml/com.springsource.org.apache.xml.resolver

  1. /**
  2. * Construct an absolute URI from a relative one, using the current
  3. * base URI.
  4. *
  5. * @param sysid The (possibly relative) system identifier
  6. * @return The system identifier made absolute with respect to the
  7. * current {@link #base}.
  8. */
  9. protected String makeAbsolute(String sysid) {
  10. URL local = null;
  11. sysid = fixSlashes(sysid);
  12. try {
  13. local = new URL(base, sysid);
  14. } catch (MalformedURLException e) {
  15. catalogManager.debug.message(1, "Malformed URL on system identifier", sysid);
  16. }
  17. if (local != null) {
  18. return local.toString();
  19. } else {
  20. return sysid;
  21. }
  22. }

代码示例来源:origin: xml-resolver/xml-resolver

  1. /**
  2. * Start parsing a text catalog file. The file is
  3. * actually read and parsed
  4. * as needed by <code>nextEntry</code>.</p>
  5. *
  6. * @param fileUrl The URL or filename of the catalog file to process
  7. *
  8. * @throws MalformedURLException Improper fileUrl
  9. * @throws IOException Error reading catalog file
  10. */
  11. public void readCatalog(Catalog catalog, String fileUrl)
  12. throws MalformedURLException, IOException {
  13. URL catURL = null;
  14. try {
  15. catURL = new URL(fileUrl);
  16. } catch (MalformedURLException e) {
  17. catURL = new URL("file:///" + fileUrl);
  18. }
  19. URLConnection urlCon = catURL.openConnection();
  20. try {
  21. readCatalog(catalog, urlCon.getInputStream());
  22. } catch (FileNotFoundException e) {
  23. catalog.getCatalogManager().debug.message(1, "Failed to load catalog, file not found",
  24. catURL.toString());
  25. }
  26. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver

  1. /**
  2. * Start parsing a text catalog file. The file is
  3. * actually read and parsed
  4. * as needed by <code>nextEntry</code>.</p>
  5. *
  6. * @param fileUrl The URL or filename of the catalog file to process
  7. *
  8. * @throws MalformedURLException Improper fileUrl
  9. * @throws IOException Error reading catalog file
  10. */
  11. public void readCatalog(Catalog catalog, String fileUrl)
  12. throws MalformedURLException, IOException {
  13. URL catURL = null;
  14. try {
  15. catURL = new URL(fileUrl);
  16. } catch (MalformedURLException e) {
  17. catURL = new URL("file:///" + fileUrl);
  18. }
  19. URLConnection urlCon = catURL.openConnection();
  20. try {
  21. readCatalog(catalog, urlCon.getInputStream());
  22. } catch (FileNotFoundException e) {
  23. catalog.getCatalogManager().debug.message(1, "Failed to load catalog, file not found",
  24. catURL.toString());
  25. }
  26. }

代码示例来源:origin: xml-resolver/xml-resolver

  1. /**
  2. * Parse a catalog file, augmenting internal data structures.
  3. *
  4. * @param fileName The filename of the catalog file to process
  5. *
  6. * @throws MalformedURLException The fileName cannot be turned into
  7. * a valid URL.
  8. * @throws IOException Error reading catalog file.
  9. */
  10. public synchronized void parseCatalog(String fileName)
  11. throws MalformedURLException, IOException {
  12. default_override = catalogManager.getPreferPublic();
  13. catalogManager.debug.message(4, "Parse catalog: " + fileName);
  14. // Put the file into the list of catalogs to process...
  15. // In all cases except the case when initCatalog() is the
  16. // caller, this will be the only catalog initially in the list...
  17. catalogFiles.addElement(fileName);
  18. // Now process all the pending catalogs...
  19. parsePendingCatalogs();
  20. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver

  1. /**
  2. * Parse a catalog file, augmenting internal data structures.
  3. *
  4. * @param fileName The filename of the catalog file to process
  5. *
  6. * @throws MalformedURLException The fileName cannot be turned into
  7. * a valid URL.
  8. * @throws IOException Error reading catalog file.
  9. */
  10. public synchronized void parseCatalog(String fileName)
  11. throws MalformedURLException, IOException {
  12. default_override = catalogManager.getPreferPublic();
  13. catalogManager.debug.message(4, "Parse catalog: " + fileName);
  14. // Put the file into the list of catalogs to process...
  15. // In all cases except the case when initCatalog() is the
  16. // caller, this will be the only catalog initially in the list...
  17. catalogFiles.addElement(fileName);
  18. // Now process all the pending catalogs...
  19. parsePendingCatalogs();
  20. }

代码示例来源:origin: org.apache.xml/com.springsource.org.apache.xml.resolver

  1. /**
  2. * Parse a catalog file, augmenting internal data structures.
  3. *
  4. * @param fileName The filename of the catalog file to process
  5. *
  6. * @throws MalformedURLException The fileName cannot be turned into
  7. * a valid URL.
  8. * @throws IOException Error reading catalog file.
  9. */
  10. public synchronized void parseCatalog(String fileName)
  11. throws MalformedURLException, IOException {
  12. default_override = catalogManager.getPreferPublic();
  13. catalogManager.debug.message(4, "Parse catalog: " + fileName);
  14. // Put the file into the list of catalogs to process...
  15. // In all cases except the case when initCatalog() is the
  16. // caller, this will be the only catalog initially in the list...
  17. catalogFiles.addElement(fileName);
  18. // Now process all the pending catalogs...
  19. parsePendingCatalogs();
  20. }

代码示例来源:origin: xml-resolver/xml-resolver

  1. /**
  2. * Parse an XML Catalog file.
  3. *
  4. * @param catalog The catalog to which this catalog file belongs
  5. * @param fileUrl The URL or filename of the catalog file to process
  6. *
  7. * @throws MalformedURLException Improper fileUrl
  8. * @throws IOException Error reading catalog file
  9. */
  10. public void readCatalog(Catalog catalog, String fileUrl)
  11. throws MalformedURLException, IOException,
  12. CatalogException {
  13. URL url = null;
  14. try {
  15. url = new URL(fileUrl);
  16. } catch (MalformedURLException e) {
  17. url = new URL("file:///" + fileUrl);
  18. }
  19. debug = catalog.getCatalogManager().debug;
  20. try {
  21. URLConnection urlCon = url.openConnection();
  22. readCatalog(catalog, urlCon.getInputStream());
  23. } catch (FileNotFoundException e) {
  24. catalog.getCatalogManager().debug.message(1, "Failed to load catalog, file not found",
  25. url.toString());
  26. }
  27. }

代码示例来源:origin: xml-resolver/xml-resolver

  1. /**
  2. * Return the applicable DOCUMENT entry.
  3. *
  4. * @return The system identifier to use for the doctype.
  5. *
  6. * @throws MalformedURLException The formal system identifier of a
  7. * subordinate catalog cannot be turned into a valid URL.
  8. * @throws IOException Error reading subordinate catalog file.
  9. */
  10. public String resolveDocument()
  11. throws MalformedURLException, IOException {
  12. // If there's a DOCUMENT entry, return it
  13. catalogManager.debug.message(3, "resolveDocument");
  14. Enumeration en = catalogEntries.elements();
  15. while (en.hasMoreElements()) {
  16. CatalogEntry e = (CatalogEntry) en.nextElement();
  17. if (e.getEntryType() == DOCUMENT) {
  18. return e.getEntryArg(0);
  19. }
  20. }
  21. return resolveSubordinateCatalogs(DOCUMENT,
  22. null, null, null);
  23. }

代码示例来源:origin: org.apache.xml/com.springsource.org.apache.xml.resolver

  1. /**
  2. * Return the applicable DOCUMENT entry.
  3. *
  4. * @return The system identifier to use for the doctype.
  5. *
  6. * @throws MalformedURLException The formal system identifier of a
  7. * subordinate catalog cannot be turned into a valid URL.
  8. * @throws IOException Error reading subordinate catalog file.
  9. */
  10. public String resolveDocument()
  11. throws MalformedURLException, IOException {
  12. // If there's a DOCUMENT entry, return it
  13. catalogManager.debug.message(3, "resolveDocument");
  14. Enumeration en = catalogEntries.elements();
  15. while (en.hasMoreElements()) {
  16. CatalogEntry e = (CatalogEntry) en.nextElement();
  17. if (e.getEntryType() == DOCUMENT) {
  18. return e.getEntryArg(0);
  19. }
  20. }
  21. return resolveSubordinateCatalogs(DOCUMENT,
  22. null, null, null);
  23. }

代码示例来源:origin: xml-resolver/xml-resolver

  1. /**
  2. * Cleanup and process a Catalog entry.
  3. *
  4. * <p>This method processes each Catalog entry, changing mapped
  5. * relative system identifiers into absolute ones (based on the current
  6. * base URI), and maintaining other information about the current
  7. * catalog.</p>
  8. *
  9. * @param entry The CatalogEntry to process.
  10. */
  11. public void addEntry(CatalogEntry entry) {
  12. int type = entry.getEntryType();
  13. if (type == URISUFFIX) {
  14. String suffix = normalizeURI(entry.getEntryArg(0));
  15. String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
  16. entry.setEntryArg(1, fsi);
  17. catalogManager.debug.message(4, "URISUFFIX", suffix, fsi);
  18. } else if (type == SYSTEMSUFFIX) {
  19. String suffix = normalizeURI(entry.getEntryArg(0));
  20. String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
  21. entry.setEntryArg(1, fsi);
  22. catalogManager.debug.message(4, "SYSTEMSUFFIX", suffix, fsi);
  23. }
  24. super.addEntry(entry);
  25. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver

  1. /**
  2. * Cleanup and process a Catalog entry.
  3. *
  4. * <p>This method processes each Catalog entry, changing mapped
  5. * relative system identifiers into absolute ones (based on the current
  6. * base URI), and maintaining other information about the current
  7. * catalog.</p>
  8. *
  9. * @param entry The CatalogEntry to process.
  10. */
  11. public void addEntry(CatalogEntry entry) {
  12. int type = entry.getEntryType();
  13. if (type == URISUFFIX) {
  14. String suffix = normalizeURI(entry.getEntryArg(0));
  15. String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
  16. entry.setEntryArg(1, fsi);
  17. catalogManager.debug.message(4, "URISUFFIX", suffix, fsi);
  18. } else if (type == SYSTEMSUFFIX) {
  19. String suffix = normalizeURI(entry.getEntryArg(0));
  20. String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
  21. entry.setEntryArg(1, fsi);
  22. catalogManager.debug.message(4, "SYSTEMSUFFIX", suffix, fsi);
  23. }
  24. super.addEntry(entry);
  25. }

相关文章