javax.xml.xpath.XPathFactoryFinder.debugPrintln()方法的使用及代码示例

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

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

XPathFactoryFinder.debugPrintln介绍

[英]Conditional debug printing.
[中]条件调试打印。

代码示例

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

  1. private void debugDisplayClassLoader() {
  2. if (classLoader == Thread.currentThread().getContextClassLoader()) {
  3. debugPrintln("using thread context class loader (" + classLoader + ") for search");
  4. return;
  5. }
  6. if (classLoader==ClassLoader.getSystemClassLoader()) {
  7. debugPrintln("using system class loader (" + classLoader + ") for search");
  8. return;
  9. }
  10. debugPrintln("using class loader (" + classLoader + ") for search");
  11. }

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

  1. /**
  2. * Returns an {@link Iterator} that enumerates all
  3. * the META-INF/services files that we care.
  4. */
  5. private Iterable<URL> createServiceFileIterator() {
  6. if (classLoader == null) {
  7. URL resource = XPathFactoryFinder.class.getClassLoader().getResource(SERVICE_ID);
  8. return Collections.singleton(resource);
  9. } else {
  10. try {
  11. Enumeration<URL> e = classLoader.getResources(SERVICE_ID);
  12. if (debug && !e.hasMoreElements()) {
  13. debugPrintln("no "+SERVICE_ID+" file was found");
  14. }
  15. return Collections.list(e);
  16. } catch (IOException e) {
  17. if (debug) {
  18. debugPrintln("failed to enumerate resources "+SERVICE_ID);
  19. e.printStackTrace();
  20. }
  21. return Collections.emptySet();
  22. }
  23. }
  24. }

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

  1. /**
  2. * <p>Creates a new {@link XPathFactory} object for the specified
  3. * schema language.</p>
  4. *
  5. * @param uri
  6. * Identifies the underlying object model.
  7. *
  8. * @return <code>null</code> if the callee fails to create one.
  9. *
  10. * @throws NullPointerException
  11. * If the parameter is null.
  12. */
  13. public XPathFactory newFactory(String uri) {
  14. if (uri == null) {
  15. throw new NullPointerException("uri == null");
  16. }
  17. XPathFactory f = _newFactory(uri);
  18. if (debug) {
  19. if (f != null) {
  20. debugPrintln("factory '" + f.getClass().getName() + "' was found for " + uri);
  21. } else {
  22. debugPrintln("unable to find a factory for " + uri);
  23. }
  24. }
  25. return f;
  26. }

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

  1. if (debug) debugPrintln("instantiating "+className);
  2. Class clazz;
  3. if( classLoader!=null )
  4. else
  5. clazz = Class.forName(className);
  6. if(debug) debugPrintln("loaded it from "+which(clazz));
  7. Object o = clazz.newInstance();
  8. return (XPathFactory)o;
  9. if (debug) debugPrintln(className+" is not assignable to "+SERVICE_CLASS.getName());
  10. debugPrintln("failed to instantiate "+className);
  11. t.printStackTrace();

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

  1. if (debug) debugPrintln("Looking up system property '"+propertyName+"'" );
  2. String r = System.getProperty(propertyName);
  3. if (r != null && r.length() > 0) {
  4. if (debug) debugPrintln("The value is '"+r+"'");
  5. xpf = createInstance(r);
  6. if(xpf!=null) return xpf;
  7. } else if (debug) {
  8. debugPrintln("The property is undefined.");
  9. firstTime = false;
  10. if (f.exists()) {
  11. if (debug) debugPrintln("Read properties file " + f);
  12. cacheProps.load(new FileInputStream(f));
  13. if (debug) debugPrintln("found " + factoryClassName + " in $java.home/jaxp.properties");
  14. if (debug) debugPrintln("looking into " + resource);
  15. try {
  16. xpf = loadFromServicesFile(uri, resource.toExternalForm(), resource.openStream());
  17. } catch(IOException e) {
  18. if( debug ) {
  19. debugPrintln("failed to read "+resource);
  20. e.printStackTrace();
  21. if (debug) debugPrintln("attempting to use the platform default W3C DOM XPath lib");
  22. return createInstance("org.apache.xpath.jaxp.XPathFactoryImpl");
  23. if (debug) debugPrintln("all things were tried, but none was found. bailing out.");

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

  1. if (debug) debugPrintln("Reading " + resourceName );

代码示例来源:origin: MobiVM/robovm

  1. private void debugDisplayClassLoader() {
  2. if (classLoader == Thread.currentThread().getContextClassLoader()) {
  3. debugPrintln("using thread context class loader (" + classLoader + ") for search");
  4. return;
  5. }
  6. if (classLoader==ClassLoader.getSystemClassLoader()) {
  7. debugPrintln("using system class loader (" + classLoader + ") for search");
  8. return;
  9. }
  10. debugPrintln("using class loader (" + classLoader + ") for search");
  11. }

代码示例来源:origin: com.bugvm/bugvm-rt

  1. private void debugDisplayClassLoader() {
  2. if (classLoader == Thread.currentThread().getContextClassLoader()) {
  3. debugPrintln("using thread context class loader (" + classLoader + ") for search");
  4. return;
  5. }
  6. if (classLoader==ClassLoader.getSystemClassLoader()) {
  7. debugPrintln("using system class loader (" + classLoader + ") for search");
  8. return;
  9. }
  10. debugPrintln("using class loader (" + classLoader + ") for search");
  11. }

代码示例来源:origin: ibinti/bugvm

  1. private void debugDisplayClassLoader() {
  2. if (classLoader == Thread.currentThread().getContextClassLoader()) {
  3. debugPrintln("using thread context class loader (" + classLoader + ") for search");
  4. return;
  5. }
  6. if (classLoader==ClassLoader.getSystemClassLoader()) {
  7. debugPrintln("using system class loader (" + classLoader + ") for search");
  8. return;
  9. }
  10. debugPrintln("using class loader (" + classLoader + ") for search");
  11. }

代码示例来源:origin: com.gluonhq/robovm-rt

  1. private void debugDisplayClassLoader() {
  2. if (classLoader == Thread.currentThread().getContextClassLoader()) {
  3. debugPrintln("using thread context class loader (" + classLoader + ") for search");
  4. return;
  5. }
  6. if (classLoader==ClassLoader.getSystemClassLoader()) {
  7. debugPrintln("using system class loader (" + classLoader + ") for search");
  8. return;
  9. }
  10. debugPrintln("using class loader (" + classLoader + ") for search");
  11. }

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

  1. private void debugDisplayClassLoader() {
  2. if (classLoader == Thread.currentThread().getContextClassLoader()) {
  3. debugPrintln("using thread context class loader (" + classLoader + ") for search");
  4. return;
  5. }
  6. if (classLoader==ClassLoader.getSystemClassLoader()) {
  7. debugPrintln("using system class loader (" + classLoader + ") for search");
  8. return;
  9. }
  10. debugPrintln("using class loader (" + classLoader + ") for search");
  11. }

代码示例来源:origin: FlexoVM/flexovm

  1. private void debugDisplayClassLoader() {
  2. if (classLoader == Thread.currentThread().getContextClassLoader()) {
  3. debugPrintln("using thread context class loader (" + classLoader + ") for search");
  4. return;
  5. }
  6. if (classLoader==ClassLoader.getSystemClassLoader()) {
  7. debugPrintln("using system class loader (" + classLoader + ") for search");
  8. return;
  9. }
  10. debugPrintln("using class loader (" + classLoader + ") for search");
  11. }

代码示例来源:origin: org.apache.servicemix.specs/org.apache.servicemix.specs.jaxp-api-1.4

  1. private void debugDisplayClassLoader() {
  2. try {
  3. if( classLoader == SecuritySupport.getContextClassLoader() ) {
  4. debugPrintln("using thread context class loader ("+classLoader+") for search");
  5. return;
  6. }
  7. } catch( Throwable _ ) {
  8. ; // getContextClassLoader() undefined in JDK1.1
  9. }
  10. if( classLoader==ClassLoader.getSystemClassLoader() ) {
  11. debugPrintln("using system class loader ("+classLoader+") for search");
  12. return;
  13. }
  14. debugPrintln("using class loader ("+classLoader+") for search");
  15. }

代码示例来源:origin: javax.xml.parsers/jaxp-api

  1. private void debugDisplayClassLoader() {
  2. try {
  3. if( classLoader == ss.getContextClassLoader() ) {
  4. debugPrintln("using thread context class loader ("+classLoader+") for search");
  5. return;
  6. }
  7. } catch( Throwable _ ) {
  8. ; // getContextClassLoader() undefined in JDK1.1
  9. }
  10. if( classLoader==ClassLoader.getSystemClassLoader() ) {
  11. debugPrintln("using system class loader ("+classLoader+") for search");
  12. return;
  13. }
  14. debugPrintln("using class loader ("+classLoader+") for search");
  15. }

代码示例来源:origin: javax.xml.parsers/jaxp-api

  1. /**
  2. * Looks up a value in a property file
  3. * while producing all sorts of debug messages.
  4. *
  5. * @return null
  6. * if there was an error.
  7. */
  8. private XPathFactory loadFromProperty( String keyName, String resourceName, InputStream in )
  9. throws IOException {
  10. debugPrintln("Reading "+resourceName );
  11. Properties props = new Properties();
  12. props.load(in);
  13. in.close();
  14. String factoryClassName = props.getProperty(keyName);
  15. if(factoryClassName != null){
  16. debugPrintln("found "+keyName+" = " + factoryClassName);
  17. return createInstance(factoryClassName);
  18. } else {
  19. debugPrintln(keyName+" is not in the property file");
  20. return null;
  21. }
  22. }

代码示例来源:origin: MobiVM/robovm

  1. /**
  2. * Returns an {@link Iterator} that enumerates all
  3. * the META-INF/services files that we care.
  4. */
  5. private Iterable<URL> createServiceFileIterator() {
  6. if (classLoader == null) {
  7. URL resource = XPathFactoryFinder.class.getClassLoader().getResource(SERVICE_ID);
  8. return Collections.singleton(resource);
  9. } else {
  10. try {
  11. Enumeration<URL> e = classLoader.getResources(SERVICE_ID);
  12. if (debug && !e.hasMoreElements()) {
  13. debugPrintln("no "+SERVICE_ID+" file was found");
  14. }
  15. return Collections.list(e);
  16. } catch (IOException e) {
  17. if (debug) {
  18. debugPrintln("failed to enumerate resources "+SERVICE_ID);
  19. e.printStackTrace();
  20. }
  21. return Collections.emptySet();
  22. }
  23. }
  24. }

代码示例来源:origin: ibinti/bugvm

  1. /**
  2. * Returns an {@link Iterator} that enumerates all
  3. * the META-INF/services files that we care.
  4. */
  5. private Iterable<URL> createServiceFileIterator() {
  6. if (classLoader == null) {
  7. URL resource = XPathFactoryFinder.class.getClassLoader().getResource(SERVICE_ID);
  8. return Collections.singleton(resource);
  9. } else {
  10. try {
  11. Enumeration<URL> e = classLoader.getResources(SERVICE_ID);
  12. if (debug && !e.hasMoreElements()) {
  13. debugPrintln("no "+SERVICE_ID+" file was found");
  14. }
  15. return Collections.list(e);
  16. } catch (IOException e) {
  17. if (debug) {
  18. debugPrintln("failed to enumerate resources "+SERVICE_ID);
  19. e.printStackTrace();
  20. }
  21. return Collections.emptySet();
  22. }
  23. }
  24. }

代码示例来源:origin: com.bugvm/bugvm-rt

  1. /**
  2. * Returns an {@link Iterator} that enumerates all
  3. * the META-INF/services files that we care.
  4. */
  5. private Iterable<URL> createServiceFileIterator() {
  6. if (classLoader == null) {
  7. URL resource = XPathFactoryFinder.class.getClassLoader().getResource(SERVICE_ID);
  8. return Collections.singleton(resource);
  9. } else {
  10. try {
  11. Enumeration<URL> e = classLoader.getResources(SERVICE_ID);
  12. if (debug && !e.hasMoreElements()) {
  13. debugPrintln("no "+SERVICE_ID+" file was found");
  14. }
  15. return Collections.list(e);
  16. } catch (IOException e) {
  17. if (debug) {
  18. debugPrintln("failed to enumerate resources "+SERVICE_ID);
  19. e.printStackTrace();
  20. }
  21. return Collections.emptySet();
  22. }
  23. }
  24. }

代码示例来源:origin: javax.xml.parsers/jaxp-api

  1. /**
  2. * <p>Creates a new {@link XPathFactory} object for the specified
  3. * schema language.</p>
  4. *
  5. * @param uri
  6. * Identifies the underlying object model.
  7. *
  8. * @return <code>null</code> if the callee fails to create one.
  9. *
  10. * @throws NullPointerException
  11. * If the parameter is null.
  12. */
  13. public XPathFactory newFactory(String uri) {
  14. if(uri==null) throw new NullPointerException();
  15. XPathFactory f = _newFactory(uri);
  16. if (f != null) {
  17. debugPrintln("factory '" + f.getClass().getName() + "' was found for " + uri);
  18. } else {
  19. debugPrintln("unable to find a factory for " + uri);
  20. }
  21. return f;
  22. }

代码示例来源:origin: org.apache.servicemix.specs/org.apache.servicemix.specs.jaxp-api-1.4

  1. /**
  2. * <p>Creates a new {@link XPathFactory} object for the specified
  3. * schema language.</p>
  4. *
  5. * @param uri
  6. * Identifies the underlying object model.
  7. *
  8. * @return <code>null</code> if the callee fails to create one.
  9. *
  10. * @throws NullPointerException
  11. * If the parameter is null.
  12. */
  13. public XPathFactory newFactory(String uri) {
  14. if(uri==null) throw new NullPointerException();
  15. XPathFactory f = _newFactory(uri);
  16. if (debug) {
  17. if (f != null) {
  18. debugPrintln("factory '" + f.getClass().getName() + "' was found for " + uri);
  19. } else {
  20. debugPrintln("unable to find a factory for " + uri);
  21. }
  22. }
  23. return f;
  24. }

相关文章