本文整理了Java中javax.xml.xpath.XPathFactoryFinder.debugPrintln()
方法的一些代码示例,展示了XPathFactoryFinder.debugPrintln()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XPathFactoryFinder.debugPrintln()
方法的具体详情如下:
包路径:javax.xml.xpath.XPathFactoryFinder
类名称:XPathFactoryFinder
方法名:debugPrintln
[英]Conditional debug printing.
[中]条件调试打印。
代码示例来源:origin: robovm/robovm
private void debugDisplayClassLoader() {
if (classLoader == Thread.currentThread().getContextClassLoader()) {
debugPrintln("using thread context class loader (" + classLoader + ") for search");
return;
}
if (classLoader==ClassLoader.getSystemClassLoader()) {
debugPrintln("using system class loader (" + classLoader + ") for search");
return;
}
debugPrintln("using class loader (" + classLoader + ") for search");
}
代码示例来源:origin: robovm/robovm
/**
* Returns an {@link Iterator} that enumerates all
* the META-INF/services files that we care.
*/
private Iterable<URL> createServiceFileIterator() {
if (classLoader == null) {
URL resource = XPathFactoryFinder.class.getClassLoader().getResource(SERVICE_ID);
return Collections.singleton(resource);
} else {
try {
Enumeration<URL> e = classLoader.getResources(SERVICE_ID);
if (debug && !e.hasMoreElements()) {
debugPrintln("no "+SERVICE_ID+" file was found");
}
return Collections.list(e);
} catch (IOException e) {
if (debug) {
debugPrintln("failed to enumerate resources "+SERVICE_ID);
e.printStackTrace();
}
return Collections.emptySet();
}
}
}
代码示例来源:origin: robovm/robovm
/**
* <p>Creates a new {@link XPathFactory} object for the specified
* schema language.</p>
*
* @param uri
* Identifies the underlying object model.
*
* @return <code>null</code> if the callee fails to create one.
*
* @throws NullPointerException
* If the parameter is null.
*/
public XPathFactory newFactory(String uri) {
if (uri == null) {
throw new NullPointerException("uri == null");
}
XPathFactory f = _newFactory(uri);
if (debug) {
if (f != null) {
debugPrintln("factory '" + f.getClass().getName() + "' was found for " + uri);
} else {
debugPrintln("unable to find a factory for " + uri);
}
}
return f;
}
代码示例来源:origin: robovm/robovm
if (debug) debugPrintln("instantiating "+className);
Class clazz;
if( classLoader!=null )
else
clazz = Class.forName(className);
if(debug) debugPrintln("loaded it from "+which(clazz));
Object o = clazz.newInstance();
return (XPathFactory)o;
if (debug) debugPrintln(className+" is not assignable to "+SERVICE_CLASS.getName());
debugPrintln("failed to instantiate "+className);
t.printStackTrace();
代码示例来源:origin: robovm/robovm
if (debug) debugPrintln("Looking up system property '"+propertyName+"'" );
String r = System.getProperty(propertyName);
if (r != null && r.length() > 0) {
if (debug) debugPrintln("The value is '"+r+"'");
xpf = createInstance(r);
if(xpf!=null) return xpf;
} else if (debug) {
debugPrintln("The property is undefined.");
firstTime = false;
if (f.exists()) {
if (debug) debugPrintln("Read properties file " + f);
cacheProps.load(new FileInputStream(f));
if (debug) debugPrintln("found " + factoryClassName + " in $java.home/jaxp.properties");
if (debug) debugPrintln("looking into " + resource);
try {
xpf = loadFromServicesFile(uri, resource.toExternalForm(), resource.openStream());
} catch(IOException e) {
if( debug ) {
debugPrintln("failed to read "+resource);
e.printStackTrace();
if (debug) debugPrintln("attempting to use the platform default W3C DOM XPath lib");
return createInstance("org.apache.xpath.jaxp.XPathFactoryImpl");
if (debug) debugPrintln("all things were tried, but none was found. bailing out.");
代码示例来源:origin: robovm/robovm
if (debug) debugPrintln("Reading " + resourceName );
代码示例来源:origin: MobiVM/robovm
private void debugDisplayClassLoader() {
if (classLoader == Thread.currentThread().getContextClassLoader()) {
debugPrintln("using thread context class loader (" + classLoader + ") for search");
return;
}
if (classLoader==ClassLoader.getSystemClassLoader()) {
debugPrintln("using system class loader (" + classLoader + ") for search");
return;
}
debugPrintln("using class loader (" + classLoader + ") for search");
}
代码示例来源:origin: com.bugvm/bugvm-rt
private void debugDisplayClassLoader() {
if (classLoader == Thread.currentThread().getContextClassLoader()) {
debugPrintln("using thread context class loader (" + classLoader + ") for search");
return;
}
if (classLoader==ClassLoader.getSystemClassLoader()) {
debugPrintln("using system class loader (" + classLoader + ") for search");
return;
}
debugPrintln("using class loader (" + classLoader + ") for search");
}
代码示例来源:origin: ibinti/bugvm
private void debugDisplayClassLoader() {
if (classLoader == Thread.currentThread().getContextClassLoader()) {
debugPrintln("using thread context class loader (" + classLoader + ") for search");
return;
}
if (classLoader==ClassLoader.getSystemClassLoader()) {
debugPrintln("using system class loader (" + classLoader + ") for search");
return;
}
debugPrintln("using class loader (" + classLoader + ") for search");
}
代码示例来源:origin: com.gluonhq/robovm-rt
private void debugDisplayClassLoader() {
if (classLoader == Thread.currentThread().getContextClassLoader()) {
debugPrintln("using thread context class loader (" + classLoader + ") for search");
return;
}
if (classLoader==ClassLoader.getSystemClassLoader()) {
debugPrintln("using system class loader (" + classLoader + ") for search");
return;
}
debugPrintln("using class loader (" + classLoader + ") for search");
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
private void debugDisplayClassLoader() {
if (classLoader == Thread.currentThread().getContextClassLoader()) {
debugPrintln("using thread context class loader (" + classLoader + ") for search");
return;
}
if (classLoader==ClassLoader.getSystemClassLoader()) {
debugPrintln("using system class loader (" + classLoader + ") for search");
return;
}
debugPrintln("using class loader (" + classLoader + ") for search");
}
代码示例来源:origin: FlexoVM/flexovm
private void debugDisplayClassLoader() {
if (classLoader == Thread.currentThread().getContextClassLoader()) {
debugPrintln("using thread context class loader (" + classLoader + ") for search");
return;
}
if (classLoader==ClassLoader.getSystemClassLoader()) {
debugPrintln("using system class loader (" + classLoader + ") for search");
return;
}
debugPrintln("using class loader (" + classLoader + ") for search");
}
代码示例来源:origin: org.apache.servicemix.specs/org.apache.servicemix.specs.jaxp-api-1.4
private void debugDisplayClassLoader() {
try {
if( classLoader == SecuritySupport.getContextClassLoader() ) {
debugPrintln("using thread context class loader ("+classLoader+") for search");
return;
}
} catch( Throwable _ ) {
; // getContextClassLoader() undefined in JDK1.1
}
if( classLoader==ClassLoader.getSystemClassLoader() ) {
debugPrintln("using system class loader ("+classLoader+") for search");
return;
}
debugPrintln("using class loader ("+classLoader+") for search");
}
代码示例来源:origin: javax.xml.parsers/jaxp-api
private void debugDisplayClassLoader() {
try {
if( classLoader == ss.getContextClassLoader() ) {
debugPrintln("using thread context class loader ("+classLoader+") for search");
return;
}
} catch( Throwable _ ) {
; // getContextClassLoader() undefined in JDK1.1
}
if( classLoader==ClassLoader.getSystemClassLoader() ) {
debugPrintln("using system class loader ("+classLoader+") for search");
return;
}
debugPrintln("using class loader ("+classLoader+") for search");
}
代码示例来源:origin: javax.xml.parsers/jaxp-api
/**
* Looks up a value in a property file
* while producing all sorts of debug messages.
*
* @return null
* if there was an error.
*/
private XPathFactory loadFromProperty( String keyName, String resourceName, InputStream in )
throws IOException {
debugPrintln("Reading "+resourceName );
Properties props = new Properties();
props.load(in);
in.close();
String factoryClassName = props.getProperty(keyName);
if(factoryClassName != null){
debugPrintln("found "+keyName+" = " + factoryClassName);
return createInstance(factoryClassName);
} else {
debugPrintln(keyName+" is not in the property file");
return null;
}
}
代码示例来源:origin: MobiVM/robovm
/**
* Returns an {@link Iterator} that enumerates all
* the META-INF/services files that we care.
*/
private Iterable<URL> createServiceFileIterator() {
if (classLoader == null) {
URL resource = XPathFactoryFinder.class.getClassLoader().getResource(SERVICE_ID);
return Collections.singleton(resource);
} else {
try {
Enumeration<URL> e = classLoader.getResources(SERVICE_ID);
if (debug && !e.hasMoreElements()) {
debugPrintln("no "+SERVICE_ID+" file was found");
}
return Collections.list(e);
} catch (IOException e) {
if (debug) {
debugPrintln("failed to enumerate resources "+SERVICE_ID);
e.printStackTrace();
}
return Collections.emptySet();
}
}
}
代码示例来源:origin: ibinti/bugvm
/**
* Returns an {@link Iterator} that enumerates all
* the META-INF/services files that we care.
*/
private Iterable<URL> createServiceFileIterator() {
if (classLoader == null) {
URL resource = XPathFactoryFinder.class.getClassLoader().getResource(SERVICE_ID);
return Collections.singleton(resource);
} else {
try {
Enumeration<URL> e = classLoader.getResources(SERVICE_ID);
if (debug && !e.hasMoreElements()) {
debugPrintln("no "+SERVICE_ID+" file was found");
}
return Collections.list(e);
} catch (IOException e) {
if (debug) {
debugPrintln("failed to enumerate resources "+SERVICE_ID);
e.printStackTrace();
}
return Collections.emptySet();
}
}
}
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* Returns an {@link Iterator} that enumerates all
* the META-INF/services files that we care.
*/
private Iterable<URL> createServiceFileIterator() {
if (classLoader == null) {
URL resource = XPathFactoryFinder.class.getClassLoader().getResource(SERVICE_ID);
return Collections.singleton(resource);
} else {
try {
Enumeration<URL> e = classLoader.getResources(SERVICE_ID);
if (debug && !e.hasMoreElements()) {
debugPrintln("no "+SERVICE_ID+" file was found");
}
return Collections.list(e);
} catch (IOException e) {
if (debug) {
debugPrintln("failed to enumerate resources "+SERVICE_ID);
e.printStackTrace();
}
return Collections.emptySet();
}
}
}
代码示例来源:origin: javax.xml.parsers/jaxp-api
/**
* <p>Creates a new {@link XPathFactory} object for the specified
* schema language.</p>
*
* @param uri
* Identifies the underlying object model.
*
* @return <code>null</code> if the callee fails to create one.
*
* @throws NullPointerException
* If the parameter is null.
*/
public XPathFactory newFactory(String uri) {
if(uri==null) throw new NullPointerException();
XPathFactory f = _newFactory(uri);
if (f != null) {
debugPrintln("factory '" + f.getClass().getName() + "' was found for " + uri);
} else {
debugPrintln("unable to find a factory for " + uri);
}
return f;
}
代码示例来源:origin: org.apache.servicemix.specs/org.apache.servicemix.specs.jaxp-api-1.4
/**
* <p>Creates a new {@link XPathFactory} object for the specified
* schema language.</p>
*
* @param uri
* Identifies the underlying object model.
*
* @return <code>null</code> if the callee fails to create one.
*
* @throws NullPointerException
* If the parameter is null.
*/
public XPathFactory newFactory(String uri) {
if(uri==null) throw new NullPointerException();
XPathFactory f = _newFactory(uri);
if (debug) {
if (f != null) {
debugPrintln("factory '" + f.getClass().getName() + "' was found for " + uri);
} else {
debugPrintln("unable to find a factory for " + uri);
}
}
return f;
}
内容来源于网络,如有侵权,请联系作者删除!