本文整理了Java中org.apache.xml.resolver.helpers.Debug.message()
方法的一些代码示例,展示了Debug.message()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Debug.message()
方法的具体详情如下:
包路径:org.apache.xml.resolver.helpers.Debug
类名称:Debug
方法名:message
[英]Print debug message (if the debug level is high enough).
Prints "the message"
[中]打印调试消息(如果调试级别足够高)。
打印“消息”
代码示例来源:origin: org.apache.commons/commons-configuration2
catalogCwd = base;
default_override = catalogManager.getPreferPublic();
catalogManager.debug.message(DEBUG_NORMAL, "Parse catalog: " + fileName);
catalogManager.debug.message(DEBUG_NORMAL, "Unable to access " + base
+ ex.getMessage());
break;
catalogManager.debug.message(DEBUG_NORMAL, "Parse failed for " + fileName
+ ce.getMessage());
if (ce.getExceptionType() == CatalogException.PARSE_FAILED)
代码示例来源:origin: org.apache.commons/commons-configuration2
catalogManager.debug.message(DEBUG_ALL,
"Unable to get input stream for " + name + ". " + ce.getMessage());
catalogManager.debug.message(DEBUG_ALL,
"Exception caught parsing input stream for " + fileName + ". "
+ ex.getMessage());
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver
/**
* Handle unknown CatalogEntry types.
*
* <p>This method exists to allow subclasses to deal with unknown
* entry types.</p>
*/
public void unknownEntry(Vector strings) {
if (strings != null && strings.size() > 0) {
String keyword = (String) strings.elementAt(0);
catalogManager.debug.message(2, "Unrecognized token parsing catalog", keyword);
}
}
代码示例来源:origin: xml-resolver/xml-resolver
public boolean checkAttributes (Attributes atts, String attName) {
if (atts.getValue(attName) == null) {
debug.message(1, "Error: required attribute " + attName + " missing.");
return false;
} else {
return true;
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver
public boolean checkAttributes (Attributes atts, String attName) {
if (atts.getValue(attName) == null) {
debug.message(1, "Error: required attribute " + attName + " missing.");
return false;
} else {
return true;
}
}
代码示例来源:origin: org.apache.xml/com.springsource.org.apache.xml.resolver
public boolean checkAttributes (Attributes atts, String attName) {
if (atts.getValue(attName) == null) {
debug.message(1, "Error: required attribute " + attName + " missing.");
return false;
} else {
return true;
}
}
代码示例来源:origin: xml-resolver/xml-resolver
/**
* Handle unknown CatalogEntry types.
*
* <p>This method exists to allow subclasses to deal with unknown
* entry types.</p>
*/
public void unknownEntry(Vector strings) {
if (strings != null && strings.size() > 0) {
String keyword = (String) strings.elementAt(0);
catalogManager.debug.message(2, "Unrecognized token parsing catalog", keyword);
}
}
代码示例来源:origin: org.apache.xml/com.springsource.org.apache.xml.resolver
/**
* Handle unknown CatalogEntry types.
*
* <p>This method exists to allow subclasses to deal with unknown
* entry types.</p>
*/
public void unknownEntry(Vector strings) {
if (strings != null && strings.size() > 0) {
String keyword = (String) strings.elementAt(0);
catalogManager.debug.message(2, "Unrecognized token parsing catalog", keyword);
}
}
代码示例来源:origin: xml-resolver/xml-resolver
/**
* Construct an absolute URI from a relative one, using the current
* base URI.
*
* @param sysid The (possibly relative) system identifier
* @return The system identifier made absolute with respect to the
* current {@link #base}.
*/
protected String makeAbsolute(String sysid) {
URL local = null;
sysid = fixSlashes(sysid);
try {
local = new URL(base, sysid);
} catch (MalformedURLException e) {
catalogManager.debug.message(1, "Malformed URL on system identifier", sysid);
}
if (local != null) {
return local.toString();
} else {
return sysid;
}
}
代码示例来源:origin: org.apache.xml/com.springsource.org.apache.xml.resolver
/**
* Construct an absolute URI from a relative one, using the current
* base URI.
*
* @param sysid The (possibly relative) system identifier
* @return The system identifier made absolute with respect to the
* current {@link #base}.
*/
protected String makeAbsolute(String sysid) {
URL local = null;
sysid = fixSlashes(sysid);
try {
local = new URL(base, sysid);
} catch (MalformedURLException e) {
catalogManager.debug.message(1, "Malformed URL on system identifier", sysid);
}
if (local != null) {
return local.toString();
} else {
return sysid;
}
}
代码示例来源:origin: xml-resolver/xml-resolver
/**
* Start parsing a text catalog file. The file is
* actually read and parsed
* as needed by <code>nextEntry</code>.</p>
*
* @param fileUrl The URL or filename of the catalog file to process
*
* @throws MalformedURLException Improper fileUrl
* @throws IOException Error reading catalog file
*/
public void readCatalog(Catalog catalog, String fileUrl)
throws MalformedURLException, IOException {
URL catURL = null;
try {
catURL = new URL(fileUrl);
} catch (MalformedURLException e) {
catURL = new URL("file:///" + fileUrl);
}
URLConnection urlCon = catURL.openConnection();
try {
readCatalog(catalog, urlCon.getInputStream());
} catch (FileNotFoundException e) {
catalog.getCatalogManager().debug.message(1, "Failed to load catalog, file not found",
catURL.toString());
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver
/**
* Start parsing a text catalog file. The file is
* actually read and parsed
* as needed by <code>nextEntry</code>.</p>
*
* @param fileUrl The URL or filename of the catalog file to process
*
* @throws MalformedURLException Improper fileUrl
* @throws IOException Error reading catalog file
*/
public void readCatalog(Catalog catalog, String fileUrl)
throws MalformedURLException, IOException {
URL catURL = null;
try {
catURL = new URL(fileUrl);
} catch (MalformedURLException e) {
catURL = new URL("file:///" + fileUrl);
}
URLConnection urlCon = catURL.openConnection();
try {
readCatalog(catalog, urlCon.getInputStream());
} catch (FileNotFoundException e) {
catalog.getCatalogManager().debug.message(1, "Failed to load catalog, file not found",
catURL.toString());
}
}
代码示例来源:origin: xml-resolver/xml-resolver
/**
* Parse a catalog file, augmenting internal data structures.
*
* @param fileName The filename of the catalog file to process
*
* @throws MalformedURLException The fileName cannot be turned into
* a valid URL.
* @throws IOException Error reading catalog file.
*/
public synchronized void parseCatalog(String fileName)
throws MalformedURLException, IOException {
default_override = catalogManager.getPreferPublic();
catalogManager.debug.message(4, "Parse catalog: " + fileName);
// Put the file into the list of catalogs to process...
// In all cases except the case when initCatalog() is the
// caller, this will be the only catalog initially in the list...
catalogFiles.addElement(fileName);
// Now process all the pending catalogs...
parsePendingCatalogs();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver
/**
* Parse a catalog file, augmenting internal data structures.
*
* @param fileName The filename of the catalog file to process
*
* @throws MalformedURLException The fileName cannot be turned into
* a valid URL.
* @throws IOException Error reading catalog file.
*/
public synchronized void parseCatalog(String fileName)
throws MalformedURLException, IOException {
default_override = catalogManager.getPreferPublic();
catalogManager.debug.message(4, "Parse catalog: " + fileName);
// Put the file into the list of catalogs to process...
// In all cases except the case when initCatalog() is the
// caller, this will be the only catalog initially in the list...
catalogFiles.addElement(fileName);
// Now process all the pending catalogs...
parsePendingCatalogs();
}
代码示例来源:origin: org.apache.xml/com.springsource.org.apache.xml.resolver
/**
* Parse a catalog file, augmenting internal data structures.
*
* @param fileName The filename of the catalog file to process
*
* @throws MalformedURLException The fileName cannot be turned into
* a valid URL.
* @throws IOException Error reading catalog file.
*/
public synchronized void parseCatalog(String fileName)
throws MalformedURLException, IOException {
default_override = catalogManager.getPreferPublic();
catalogManager.debug.message(4, "Parse catalog: " + fileName);
// Put the file into the list of catalogs to process...
// In all cases except the case when initCatalog() is the
// caller, this will be the only catalog initially in the list...
catalogFiles.addElement(fileName);
// Now process all the pending catalogs...
parsePendingCatalogs();
}
代码示例来源:origin: xml-resolver/xml-resolver
/**
* Parse an XML Catalog file.
*
* @param catalog The catalog to which this catalog file belongs
* @param fileUrl The URL or filename of the catalog file to process
*
* @throws MalformedURLException Improper fileUrl
* @throws IOException Error reading catalog file
*/
public void readCatalog(Catalog catalog, String fileUrl)
throws MalformedURLException, IOException,
CatalogException {
URL url = null;
try {
url = new URL(fileUrl);
} catch (MalformedURLException e) {
url = new URL("file:///" + fileUrl);
}
debug = catalog.getCatalogManager().debug;
try {
URLConnection urlCon = url.openConnection();
readCatalog(catalog, urlCon.getInputStream());
} catch (FileNotFoundException e) {
catalog.getCatalogManager().debug.message(1, "Failed to load catalog, file not found",
url.toString());
}
}
代码示例来源:origin: xml-resolver/xml-resolver
/**
* Return the applicable DOCUMENT entry.
*
* @return The system identifier to use for the doctype.
*
* @throws MalformedURLException The formal system identifier of a
* subordinate catalog cannot be turned into a valid URL.
* @throws IOException Error reading subordinate catalog file.
*/
public String resolveDocument()
throws MalformedURLException, IOException {
// If there's a DOCUMENT entry, return it
catalogManager.debug.message(3, "resolveDocument");
Enumeration en = catalogEntries.elements();
while (en.hasMoreElements()) {
CatalogEntry e = (CatalogEntry) en.nextElement();
if (e.getEntryType() == DOCUMENT) {
return e.getEntryArg(0);
}
}
return resolveSubordinateCatalogs(DOCUMENT,
null, null, null);
}
代码示例来源:origin: org.apache.xml/com.springsource.org.apache.xml.resolver
/**
* Return the applicable DOCUMENT entry.
*
* @return The system identifier to use for the doctype.
*
* @throws MalformedURLException The formal system identifier of a
* subordinate catalog cannot be turned into a valid URL.
* @throws IOException Error reading subordinate catalog file.
*/
public String resolveDocument()
throws MalformedURLException, IOException {
// If there's a DOCUMENT entry, return it
catalogManager.debug.message(3, "resolveDocument");
Enumeration en = catalogEntries.elements();
while (en.hasMoreElements()) {
CatalogEntry e = (CatalogEntry) en.nextElement();
if (e.getEntryType() == DOCUMENT) {
return e.getEntryArg(0);
}
}
return resolveSubordinateCatalogs(DOCUMENT,
null, null, null);
}
代码示例来源:origin: xml-resolver/xml-resolver
/**
* Cleanup and process a Catalog entry.
*
* <p>This method processes each Catalog entry, changing mapped
* relative system identifiers into absolute ones (based on the current
* base URI), and maintaining other information about the current
* catalog.</p>
*
* @param entry The CatalogEntry to process.
*/
public void addEntry(CatalogEntry entry) {
int type = entry.getEntryType();
if (type == URISUFFIX) {
String suffix = normalizeURI(entry.getEntryArg(0));
String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
entry.setEntryArg(1, fsi);
catalogManager.debug.message(4, "URISUFFIX", suffix, fsi);
} else if (type == SYSTEMSUFFIX) {
String suffix = normalizeURI(entry.getEntryArg(0));
String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
entry.setEntryArg(1, fsi);
catalogManager.debug.message(4, "SYSTEMSUFFIX", suffix, fsi);
}
super.addEntry(entry);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver
/**
* Cleanup and process a Catalog entry.
*
* <p>This method processes each Catalog entry, changing mapped
* relative system identifiers into absolute ones (based on the current
* base URI), and maintaining other information about the current
* catalog.</p>
*
* @param entry The CatalogEntry to process.
*/
public void addEntry(CatalogEntry entry) {
int type = entry.getEntryType();
if (type == URISUFFIX) {
String suffix = normalizeURI(entry.getEntryArg(0));
String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
entry.setEntryArg(1, fsi);
catalogManager.debug.message(4, "URISUFFIX", suffix, fsi);
} else if (type == SYSTEMSUFFIX) {
String suffix = normalizeURI(entry.getEntryArg(0));
String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
entry.setEntryArg(1, fsi);
catalogManager.debug.message(4, "SYSTEMSUFFIX", suffix, fsi);
}
super.addEntry(entry);
}
内容来源于网络,如有侵权,请联系作者删除!