本文整理汇总了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;
}
示例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);
}
示例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
}
}
示例4: getFilter
import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
public LSSerializerFilter getFilter()
{
return serializer.getFilter();
}
示例5: setFilter
import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
public void setFilter( LSSerializerFilter filter )
{
serializer.setFilter( filter );
}
示例6: getFilter
import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
public LSSerializerFilter getFilter()
{
return filter;
}
示例7: setFilter
import org.w3c.dom.ls.LSSerializerFilter; //导入依赖的package包/类
public void setFilter(LSSerializerFilter filter)
{
this.filter = filter;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}