• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Translet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.org.apache.xalan.internal.xsltc.Translet的典型用法代码示例。如果您正苦于以下问题:Java Translet类的具体用法?Java Translet怎么用?Java Translet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Translet类属于com.sun.org.apache.xalan.internal.xsltc包,在下文中一共展示了Translet类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: TransformerImpl

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
protected TransformerImpl(Translet translet, Properties outputProperties,
    int indentNumber, TransformerFactoryImpl tfactory)
{
    _translet = (AbstractTranslet) translet;
    _properties = createOutputProperties(outputProperties);
    _propertiesClone = (Properties) _properties.clone();
    _indentNumber = indentNumber;
    _tfactory = tfactory;
    _useServicesMechanism = _tfactory.useServicesMechnism();
    _accessExternalStylesheet = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET);
    _accessExternalDTD = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_DTD);
    _securityManager = (XMLSecurityManager)_tfactory.getAttribute(XalanConstants.SECURITY_MANAGER);
    _readerManager = XMLReaderManager.getInstance(_useServicesMechanism);
    _readerManager.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD);
    _readerManager.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _isSecureProcessing);
    _readerManager.setProperty(XalanConstants.SECURITY_MANAGER, _securityManager);
    //_isIncremental = tfactory._incremental;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:TransformerImpl.java


示例2: retrieveDocument

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
/**
 * This class should only be used as a DOMCache for the translet if the
 * URIResolver has been set.
 *
 * The method implements XSLTC's DOMCache interface, which is used to
 * plug in an external document loader into a translet. This method acts
 * as an adapter between TrAX's URIResolver interface and XSLTC's
 * DOMCache interface. This approach is simple, but removes the
 * possibility of using external document caches with XSLTC.
 *
 * @param baseURI The base URI used by the document call.
 * @param href The href argument passed to the document function.
 * @param translet A reference to the translet requesting the document
 */
@Override
public DOM retrieveDocument(String baseURI, String href, Translet translet) {
    try {
        // Argument to document function was: document('');
        if (href.length() == 0) {
            href = baseURI;
        }

        /*
         *  Fix for bug 24188
         *  Incase the _uriResolver.resolve(href,base) is null
         *  try to still  retrieve the document before returning null
         *  and throwing the FileNotFoundException in
         *  com.sun.org.apache.xalan.internal.xsltc.dom.LoadDocument
         *
         */
        Source resolvedSource = _uriResolver.resolve(href, baseURI);
        if (resolvedSource == null)  {
            StreamSource streamSource = new StreamSource(
                 SystemIDResolver.getAbsoluteURI(href, baseURI));
            return getDOM(streamSource) ;
        }

        return getDOM(resolvedSource);
    }
    catch (TransformerException e) {
        if (_errorListener != null)
            postErrorToListener("File not found: " + e.getMessage());
        return(null);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:46,代码来源:TransformerImpl.java


示例3: NodeCounter

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
protected NodeCounter(Translet translet,
          DOM document, DTMAxisIterator iterator, boolean hasFrom) {
    _translet = translet;
    _document = document;
    _iterator = iterator;
    _hasFrom = hasFrom;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:NodeCounter.java


示例4: getTransletInstance

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
/**
 * This method generates an instance of the translet class that is
 * wrapped inside this Template. The translet instance will later
 * be wrapped inside a Transformer object.
 */
private Translet getTransletInstance()
    throws TransformerConfigurationException {
    try {
        if (_name == null) return null;

        if (_class == null) defineTransletClasses();

        // The translet needs to keep a reference to all its auxiliary
        // class to prevent the GC from collecting them
        AbstractTranslet translet = (AbstractTranslet)
                _class[_transletIndex].getConstructor().newInstance();
        translet.postInitialization();
        translet.setTemplates(this);
        translet.setServicesMechnism(_useServicesMechanism);
        translet.setAllowedProtocols(_accessExternalStylesheet);
        if (_auxClasses != null) {
            translet.setAuxiliaryClasses(_auxClasses);
        }

        return translet;
    }
    catch (InstantiationException | IllegalAccessException |
            NoSuchMethodException | InvocationTargetException e) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name);
        throw new TransformerConfigurationException(err.toString(), e);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:33,代码来源:TemplatesImpl.java


示例5: TransformerImpl

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
protected TransformerImpl(Translet translet, Properties outputProperties,
    int indentNumber, TransformerFactoryImpl tfactory)
{
    _translet = (AbstractTranslet) translet;
    _properties = createOutputProperties(outputProperties);
    _propertiesClone = (Properties) _properties.clone();
    _indentNumber = indentNumber;
    _tfactory = tfactory;
    _useServicesMechanism = _tfactory.useServicesMechnism();
    _accessExternalStylesheet = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET);
    _accessExternalDTD = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_DTD);
    _securityManager = (XMLSecurityManager)_tfactory.getAttribute(XalanConstants.SECURITY_MANAGER);
    _readerManager = XMLReaderManager.getInstance(_useServicesMechanism);
    _readerManager.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD);
    _readerManager.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _isSecureProcessing);
    _readerManager.setProperty(XalanConstants.SECURITY_MANAGER, _securityManager);
    _cdataChunkSize = JdkXmlUtils.getValue(_tfactory.getAttribute(JdkXmlUtils.CDATA_CHUNK_SIZE),
            JdkXmlUtils.CDATA_CHUNK_SIZE_DEFAULT);
    _readerManager.setProperty(JdkXmlUtils.CDATA_CHUNK_SIZE, _cdataChunkSize);

    _useCatalog = _tfactory.getFeature(XMLConstants.USE_CATALOG);
    if (_useCatalog) {
        _catalogFeatures = (CatalogFeatures)_tfactory.getAttribute(JdkXmlFeatures.CATALOG_FEATURES);
        String catalogFiles = _catalogFeatures.get(CatalogFeatures.Feature.DEFER);
        if (catalogFiles != null) {
            _readerManager.setFeature(XMLConstants.USE_CATALOG, _useCatalog);
            _readerManager.setProperty(JdkXmlFeatures.CATALOG_FEATURES, _catalogFeatures);
        }
    }
    //_isIncremental = tfactory._incremental;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:32,代码来源:TransformerImpl.java


示例6: retrieveDocument

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
/**
 * This class should only be used as a DOMCache for the translet if the
 * URIResolver has been set.
 *
 * The method implements XSLTC's DOMCache interface, which is used to
 * plug in an external document loader into a translet. This method acts
 * as an adapter between TrAX's URIResolver interface and XSLTC's
 * DOMCache interface. This approach is simple, but removes the
 * possibility of using external document caches with XSLTC.
 *
 * @param baseURI The base URI used by the document call.
 * @param href The href argument passed to the document function.
 * @param translet A reference to the translet requesting the document
 */
public DOM retrieveDocument(String baseURI, String href, Translet translet) {
    try {
        // Argument to document function was: document('');
        if (href.length() == 0) {
            href = baseURI;
        }

        /*
         *  Fix for bug 24188
         *  Incase the _uriResolver.resolve(href,base) is null
         *  try to still  retrieve the document before returning null
         *  and throwing the FileNotFoundException in
         *  com.sun.org.apache.xalan.internal.xsltc.dom.LoadDocument
         *
         */
        Source resolvedSource = _uriResolver.resolve(href, baseURI);
        if (resolvedSource == null)  {
            StreamSource streamSource = new StreamSource(
                 SystemIDResolver.getAbsoluteURI(href, baseURI));
            return getDOM(streamSource) ;
        }

        return getDOM(resolvedSource);
    }
    catch (TransformerException e) {
        if (_errorListener != null)
            postErrorToListener("File not found: " + e.getMessage());
        return(null);
    }
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:45,代码来源:TransformerImpl.java


示例7: AnyNodeCounter

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
public AnyNodeCounter(Translet translet,
                      DOM document, DTMAxisIterator iterator) {
    super(translet, document, iterator);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:AnyNodeCounter.java


示例8: getDefaultNodeCounter

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
public static NodeCounter getDefaultNodeCounter(Translet translet,
                                                DOM document,
                                                DTMAxisIterator iterator) {
    return new DefaultAnyNodeCounter(translet, document, iterator);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:AnyNodeCounter.java


示例9: DefaultAnyNodeCounter

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
public DefaultAnyNodeCounter(Translet translet,
                             DOM document, DTMAxisIterator iterator) {
    super(translet, document, iterator);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:AnyNodeCounter.java


示例10: MultipleNodeCounter

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
public MultipleNodeCounter(Translet translet,
                           DOM document, DTMAxisIterator iterator) {
    super(translet, document, iterator);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:MultipleNodeCounter.java


示例11: getDefaultNodeCounter

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
public static NodeCounter getDefaultNodeCounter(Translet translet,
                                                DOM document,
                                                DTMAxisIterator iterator) {
    return new DefaultMultipleNodeCounter(translet, document, iterator);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:MultipleNodeCounter.java


示例12: DefaultMultipleNodeCounter

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
public DefaultMultipleNodeCounter(Translet translet,
                                  DOM document,
                                  DTMAxisIterator iterator) {
    super(translet, document, iterator);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:MultipleNodeCounter.java


示例13: SingleNodeCounter

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
public SingleNodeCounter(Translet translet,
                         DOM document,
                         DTMAxisIterator iterator) {
    super(translet, document, iterator);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:SingleNodeCounter.java


示例14: getDefaultNodeCounter

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
public static NodeCounter getDefaultNodeCounter(Translet translet,
                                                DOM document,
                                                DTMAxisIterator iterator) {
    return new DefaultSingleNodeCounter(translet, document, iterator);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:SingleNodeCounter.java


示例15: DefaultSingleNodeCounter

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
public DefaultSingleNodeCounter(Translet translet,
                                DOM document, DTMAxisIterator iterator) {
    super(translet, document, iterator);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:SingleNodeCounter.java


示例16: retrieveDocument

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
/**
 * Returns a document either by finding it in the cache or
 * downloading it and putting it in the cache.
 */
@Override
public DOM retrieveDocument(String baseURI, String href, Translet trs) {
    CachedDocument doc;

String uri = href;
if (baseURI != null && !baseURI.equals("")) {
    try {
        uri = SystemIDResolver.getAbsoluteURI(uri, baseURI);
    } catch (TransformerException te) {
        // ignore
    }
}

    // Try to get the document from the cache first
    if ((doc = lookupDocument(uri)) == null) {
        doc = new CachedDocument(uri);
        if (doc == null) return null; // better error handling needed!!!
        doc.setLastModified(getLastModified(uri));
        insertDocument(uri, doc);
    }
    // If the document is in the cache we must check if it is still valid
    else {
        long now = System.currentTimeMillis();
        long chk = doc.getLastChecked();
        doc.setLastChecked(now);
        // Has the modification time for this file been checked lately?
        if (now > (chk + REFRESH_INTERVAL)) {
            doc.setLastChecked(now);
            long last = getLastModified(uri);
            // Reload document if it has been modified since last download
            if (last > doc.getLastModified()) {
                doc = new CachedDocument(uri);
                if (doc == null) return null;
                doc.setLastModified(getLastModified(uri));
                replaceDocument(uri, doc);
            }
        }

    }

    // Get the references to the actual DOM and DTD handler
    final DOM dom = doc.getDocument();

    // The dom reference may be null if the URL pointed to a
    // non-existing document
    if (dom == null) return null;

    doc.incAccessCount(); // For statistics

    final AbstractTranslet translet = (AbstractTranslet)trs;

    // Give the translet an early opportunity to extract any
    // information from the DOM object that it would like.
    translet.prepassDocument(dom);

    return(doc.getDocument());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:62,代码来源:DocumentCache.java


示例17: retrieveDocument

import com.sun.org.apache.xalan.internal.xsltc.Translet; //导入依赖的package包/类
/**
 * This class should only be used as a DOMCache for the translet if the
 * URIResolver has been set.
 *
 * The method implements XSLTC's DOMCache interface, which is used to
 * plug in an external document loader into a translet. This method acts
 * as an adapter between TrAX's URIResolver interface and XSLTC's
 * DOMCache interface. This approach is simple, but removes the
 * possibility of using external document caches with XSLTC.
 *
 * @param baseURI The base URI used by the document call.
 * @param href The href argument passed to the document function.
 * @param translet A reference to the translet requesting the document
 */
@Override
public DOM retrieveDocument(String baseURI, String href, Translet translet) {
    try {
        // Argument to document function was: document('');
        if (href.length() == 0) {
            href = baseURI;
        }

        /*
         *  Fix for bug 24188
         *  Incase the _uriResolver.resolve(href,base) is null
         *  try to still  retrieve the document before returning null
         *  and throwing the FileNotFoundException in
         *  com.sun.org.apache.xalan.internal.xsltc.dom.LoadDocument
         *
         */
        Source resolvedSource = null;
        if (_uriResolver != null) {
            resolvedSource = _uriResolver.resolve(href, baseURI);
        }

        if (resolvedSource == null && _useCatalog &&
                _catalogFeatures.get(CatalogFeatures.Feature.FILES) != null)  {
            if (_catalogUriResolver == null) {
                _catalogUriResolver = CatalogManager.catalogResolver(_catalogFeatures);
            }
            resolvedSource = _catalogUriResolver.resolve(href, baseURI);
        }

        if (resolvedSource == null)  {
            StreamSource streamSource = new StreamSource(
                 SystemIDResolver.getAbsoluteURI(href, baseURI));
            return getDOM(streamSource) ;
        }

        return getDOM(resolvedSource);
    }
    catch (TransformerException | CatalogException e) {
        if (_errorListener != null)
            postErrorToListener("File not found: " + e.getMessage());
        return(null);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:58,代码来源:TransformerImpl.java



注:本文中的com.sun.org.apache.xalan.internal.xsltc.Translet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RelayCellImpl类代码示例发布时间:2022-05-23
下一篇:
Java KieSessionConfiguration类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap