gpt4 book ai didi

org.fcrepo.utilities.XmlTransformUtility.returnTransformerFactory()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 01:09:05 28 4
gpt4 key购买 nike

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

XmlTransformUtility.returnTransformerFactory介绍

暂无

代码示例

代码示例来源:origin: org.fcrepo/fcrepo-common

public static Templates getTemplates(StreamSource source)
  throws TransformerException {
  TransformerFactory tf = null;
  Templates result = null;
  try {
    tf = borrowTransformerFactory();
    result = tf.newTemplates(source);
  } catch (Exception e) {
    throw new TransformerException(e.getMessage(), e);
  } finally {
    if (tf != null) returnTransformerFactory(tf);
  }
  return result;
}

代码示例来源:origin: fcrepo3/fcrepo

public static Templates getTemplates(StreamSource source)
  throws TransformerException {
  TransformerFactory tf = null;
  Templates result = null;
  try {
    tf = borrowTransformerFactory();
    result = tf.newTemplates(source);
  } catch (Exception e) {
    throw new TransformerException(e.getMessage(), e);
  } finally {
    if (tf != null) returnTransformerFactory(tf);
  }
  return result;
}

代码示例来源:origin: org.fcrepo/fcrepo-common

/**
 * Try to cache parsed Templates, but check for changes on disk
 * @param src
 * @return Templates
 */
public static Templates getTemplates(File src) throws TransformerException {
  String key = src.getAbsolutePath();
  TimestampedCacheEntry<Templates> entry = TEMPLATES_CACHE.get(key);
  // check to see if it is null or has changed
  if (entry == null || entry.timestamp() < src.lastModified()) {
    TransformerFactory factory = null;
    try {
      factory = borrowTransformerFactory();
      Templates template = factory.newTemplates(new StreamSource(src));
      entry = new TimestampedCacheEntry<Templates>(src.lastModified(), template);
    } catch (Exception e) {
      throw new TransformerException(e.getMessage(), e);
    } finally {
      if (factory != null) returnTransformerFactory(factory);
    }
    TEMPLATES_CACHE.put(key, entry);
  }
  return entry.value();
}

代码示例来源:origin: fcrepo3/fcrepo

/**
 * Try to cache parsed Templates, but check for changes on disk
 * @param src
 * @return Templates
 */
public static Templates getTemplates(File src) throws TransformerException {
  String key = src.getAbsolutePath();
  TimestampedCacheEntry<Templates> entry = TEMPLATES_CACHE.get(key);
  // check to see if it is null or has changed
  if (entry == null || entry.timestamp() < src.lastModified()) {
    TransformerFactory factory = null;
    try {
      factory = borrowTransformerFactory();
      Templates template = factory.newTemplates(new StreamSource(src));
      entry = new TimestampedCacheEntry<Templates>(src.lastModified(), template);
    } catch (Exception e) {
      throw new TransformerException(e.getMessage(), e);
    } finally {
      if (factory != null) returnTransformerFactory(factory);
    }
    TEMPLATES_CACHE.put(key, entry);
  }
  return entry.value();
}

代码示例来源:origin: fcrepo3/fcrepo

} catch (Exception e) {
  logger.warn("Error loading the rdfxml2nTriples.xsl stylesheet", e);
  if (xFormerFactory != null) XmlTransformUtility.returnTransformerFactory(xFormerFactory);
  throw new PEPException("Error loading the rdfxml2nTriples.xsl stylesheet",
              e);
  throw new PEPException(fnfe.getMessage());
} finally {
  XmlTransformUtility.returnTransformerFactory(xFormerFactory);

代码示例来源:origin: fcrepo3/fcrepo

failedBuildCount++;
} finally {
  XmlTransformUtility.returnTransformerFactory(tfactory);

代码示例来源:origin: fcrepo3/fcrepo

StreamSource sheet = new StreamSource(in);
Transformer validator = factory.newTransformer(sheet);
XmlTransformUtility.returnTransformerFactory(factory);
validator.setOutputProperty("method", "text");
temp = new StringWriter();

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com