当前位置: 首页>>代码示例>>Java>>正文


Java LSSerializerFilter类代码示例

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


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

示例1: getLSSerializer

import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
/**
 * Obtain a the DOM, level 3, Load/Save serializer {@link LSSerializer} instance from the
 * given {@link DOMImplementationLS} instance.
 * 
 * <p>
 * The serializer instance will be configured with the parameters passed as the <code>serializerParams</code>
 * argument. It will also be configured with an {@link LSSerializerFilter} that shows all nodes to the filter, 
 * and accepts all nodes shown.
 * </p>
 * 
 * @param domImplLS the DOM Level 3 Load/Save implementation to use
 * @param serializerParams parameters to pass to the {@link DOMConfiguration} of the serializer
 *         instance, obtained via {@link LSSerializer#getDomConfig()}. May be null.
 *         
 * @return a new LSSerializer instance
 */
public static LSSerializer getLSSerializer(DOMImplementationLS domImplLS, Map<String, Object> serializerParams) {
    LSSerializer serializer = domImplLS.createLSSerializer();
    
    serializer.setFilter(new LSSerializerFilter() {

        public short acceptNode(Node arg0) {
            return FILTER_ACCEPT;
        }

        public int getWhatToShow() {
            return SHOW_ALL;
        }
    });
    
    
    if (serializerParams != null) {
        DOMConfiguration serializerDOMConfig = serializer.getDomConfig();
        for (String key : serializerParams.keySet()) {
            serializerDOMConfig.setParameter(key, serializerParams.get(key));
        }
    }
    
    return serializer;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:41,代码来源:XMLHelper.java

示例2: DOM3TreeWalker

import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
/**
 * Constructor.
 * @param   contentHandler serialHandler The implemention of the SerializationHandler interface
 */
DOM3TreeWalker(
    SerializationHandler serialHandler,
    DOMErrorHandler errHandler,
    LSSerializerFilter filter,
    String newLine) {
    fSerializer = serialHandler;
    //fErrorHandler = errHandler == null ? new DOMErrorHandlerImpl() : errHandler; // Should we be using the default?
    fErrorHandler = errHandler;
    fFilter = filter;
    fLexicalHandler = null;
    fNewLine = newLine;

    fNSBinder = new NamespaceSupport();
    fLocalNSBinder = new NamespaceSupport();

    fDOMConfigProperties = fSerializer.getOutputFormat();
    fSerializer.setDocumentLocator(fLocator);
    initProperties(fDOMConfigProperties);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:DOM3TreeWalker.java

示例3: DOM3TreeWalker

import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
/**
 * Constructor.
 * @param   contentHandler serialHandler The implemention of the SerializationHandler interface
 */
DOM3TreeWalker(
    SerializationHandler serialHandler,
    DOMErrorHandler errHandler,
    LSSerializerFilter filter,
    String newLine) {
    fSerializer = serialHandler;
    //fErrorHandler = errHandler == null ? new DOMErrorHandlerImpl() : errHandler; // Should we be using the default?
    fErrorHandler = errHandler;
    fFilter = filter;
    fLexicalHandler = null;
    fNewLine = newLine;

    fNSBinder = new NamespaceSupport();
    fLocalNSBinder = new NamespaceSupport();
    
    fDOMConfigProperties = fSerializer.getOutputFormat();
    fSerializer.setDocumentLocator(fLocator);
    initProperties(fDOMConfigProperties);
    
    try {
        // Bug see Bugzilla  26741
        fLocator.setSystemId(
            System.getProperty("user.dir") + File.separator + "dummy.xsl");
    } catch (SecurityException se) { // user.dir not accessible from applet

    }
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:32,代码来源:DOM3TreeWalker.java

示例4: getFilter

import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
public LSSerializerFilter getFilter()
{
    return serializer.getFilter();
}
 
开发者ID:peter-mount,项目名称:opendata-common,代码行数:5,代码来源:XMLDomWriter.java

示例5: setFilter

import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
public void setFilter( LSSerializerFilter filter )
{
    serializer.setFilter( filter );
}
 
开发者ID:peter-mount,项目名称:opendata-common,代码行数:5,代码来源:XMLDomWriter.java

示例6: getFilter

import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
public LSSerializerFilter getFilter()
{
  return filter;
}
 
开发者ID:vilie,项目名称:javify,代码行数:5,代码来源:DomLSSerializer.java

示例7: setFilter

import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
public void setFilter(LSSerializerFilter filter)
{
  this.filter = filter;
}
 
开发者ID:vilie,项目名称:javify,代码行数:5,代码来源:DomLSSerializer.java

示例8: getFilter

import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
/**
 *  When the application provides a filter, the serializer will call out
 * to the filter before serializing each Node. Attribute nodes are never
 * passed to the filter. The filter implementation can choose to remove
 * the node from the stream or to terminate the serialization early.
 */
public LSSerializerFilter getFilter(){
    return serializer.fDOMFilter;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:DOMSerializerImpl.java

示例9: setFilter

import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
/**
 *  When the application provides a filter, the serializer will call out
 * to the filter before serializing each Node. Attribute nodes are never
 * passed to the filter. The filter implementation can choose to remove
 * the node from the stream or to terminate the serialization early.
 */
public void setFilter(LSSerializerFilter filter){
    serializer.fDOMFilter = filter;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:DOMSerializerImpl.java

示例10: getFilter

import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
/**
 * When the application provides a filter, the serializer will call out to
 * the filter before serializing each Node. Attribute nodes are never passed
 * to the filter. The filter implementation can choose to remove the node
 * from the stream or to terminate the serialization early.
 */
public LSSerializerFilter getFilter() {
    return serializer.fDOMFilter;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:DOMSerializerImpl.java

示例11: setFilter

import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
/**
 * When the application provides a filter, the serializer will call out to
 * the filter before serializing each Node. Attribute nodes are never passed
 * to the filter. The filter implementation can choose to remove the node
 * from the stream or to terminate the serialization early.
 */
public void setFilter(LSSerializerFilter filter) {
    serializer.fDOMFilter = filter;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:DOMSerializerImpl.java

示例12: getFilter

import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
/**
 * Returns the DOMConfiguration of the LSSerializer.
 *
 * @see org.w3c.dom.ls.LSSerializer#getFilter()
 * @since DOM Level 3
 * @return A LSSerializerFilter object.
 */
public LSSerializerFilter getFilter() {
    return fSerializerFilter;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:LSSerializerImpl.java

示例13: setFilter

import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
/**
 * Set a LSSerilizerFilter on the LSSerializer.  When set, the filter is
 * called before each node is serialized which depending on its implemention
 * determines if the node is to be serialized or not.
 *
 * @see org.w3c.dom.ls.LSSerializer#setFilter
 * @since DOM Level 3
 * @param filter A LSSerializerFilter to be applied to the stream to serialize.
 */
public void setFilter(LSSerializerFilter filter) {
    fSerializerFilter = filter;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:LSSerializerImpl.java

示例14: getNodeFilter

import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
/**
 * Returns a LSSerializerFilter set on the DOM Level 3 Serializer to filter nodes
 * during serialization.
 *
 * This interface is a public API.
 *
 * @return The Level 3 LSSerializerFilter
 */
public LSSerializerFilter getNodeFilter() {
    return fSerializerFilter;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:DOM3SerializerImpl.java

示例15: setNodeFilter

import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
/**
 * Sets a LSSerializerFilter on the DOM Level 3 Serializer to filter nodes
 * during serialization.
 *
 * This interface is a public API.
 *
 * @param filter the Level 3 LSSerializerFilter
 */
public void setNodeFilter(LSSerializerFilter filter) {
    fSerializerFilter = filter;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:DOM3SerializerImpl.java


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