gpt4 book ai didi

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

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

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

XmlTransformUtility.borrowTransformerFactory介绍

[英]Convenience method to get a new instance of a TransformerFactory. If the TransformerFactory is an instance of net.sf.saxon.TransformerFactoryImpl, the attribute net.sf.saxon.FeatureKeys#VERSION_WARNING will be set to false in order to suppress the warning about using an XSLT1 stylesheet with an XSLT2 processor.
[中]获取TransformerFactory新实例的便捷方法。如果TransformerFactory是net的实例。旧金山。撒克逊人。TransformerFactoryImpl,属性网络。旧金山。撒克逊人。FeatureKeys#VERSION_WARNING将被设置为false,以抑制有关将XSLT1样式表与XSLT2处理器一起使用的警告。

代码示例

代码示例来源: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

final void process() throws TransformerConfigurationException, Exception {
  TransformerFactory tfactory = XmlTransformUtility.borrowTransformerFactory();
  keys = new Vector<String>();
  if (good2go) {

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

xFormerFactory = XmlTransformUtility.borrowTransformerFactory();
Transformer transformer = xFormerFactory.newTransformer();
m_transformers.put("RDF/XML", transformer);

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

TransformerFactory factory = XmlTransformUtility.borrowTransformerFactory();
Transformer xform = factory.newTransformer(skeleton);
xform.transform(schema, result);

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