Most visited

Recently visited

Added in API level 8

SAXTransformerFactory

public abstract class SAXTransformerFactory
extends TransformerFactory

java.lang.Object
   ↳ javax.xml.transform.TransformerFactory
     ↳ javax.xml.transform.sax.SAXTransformerFactory


这个类扩展了TransformerFactory以提供特定于SAX的工厂方法。 它提供了两种类型的ContentHandler,一种用于创建变形金刚,另一种用于创建模板对象。

如果应用程序想要为转换期间使用的XMLReader设置ErrorHandler或EntityResolver,则应使用URIResolver返回提供(通过getXMLReader)对XMLReader的引用的SAXSource。

Summary

Constants

String FEATURE

如果 getFeature(String)返回true时,将此值作为参数,从的TransformerFactory返回 newInstance()可以安全地转换为SAXTransformerFactory。

String FEATURE_XMLFILTER

如果 getFeature(String)在将此值作为参数传递时返回true,则支持 newXMLFilter(Source)newXMLFilter(Templates)方法。

Protected constructors

SAXTransformerFactory()

默认的构造函数是有意保护的。

Public methods

abstract TemplatesHandler newTemplatesHandler()

获取可以将SAX ContentHandler事件处理为Templates对象的TemplatesHandler对象。

abstract TransformerHandler newTransformerHandler()

获取一个可以将SAX ContentHandler事件处理成Result的TransformerHandler对象。

abstract TransformerHandler newTransformerHandler(Source src)

根据参数指定的转换指令,获取可将SAX ContentHandler事件处理成Result的TransformerHandler对象。

abstract TransformerHandler newTransformerHandler(Templates templates)

根据Templates参数获取可将SAX ContentHandler事件处理成Result的TransformerHandler对象。

abstract XMLFilter newXMLFilter(Source src)

创建一个使用给定Source作为转换指令的XMLFilter。

abstract XMLFilter newXMLFilter(Templates templates)

基于Templates参数创建一个XMLFilter ..

Inherited methods

From class javax.xml.transform.TransformerFactory
From class java.lang.Object

Constants

FEATURE

Added in API level 8
String FEATURE

如果 getFeature(String)返回true时,将此值作为参数,从的TransformerFactory返回 newInstance()可以安全地转换为SAXTransformerFactory。

常量值:“http://javax.xml.transform.sax.SAXTransformerFactory/feature”

FEATURE_XMLFILTER

Added in API level 8
String FEATURE_XMLFILTER

如果 getFeature(String)在将此值作为参数传递时返回true,则支持 newXMLFilter(Source)newXMLFilter(Templates)方法。

常量值:“http://javax.xml.transform.sax.SAXTransformerFactory/feature/xmlfilter”

Protected constructors

SAXTransformerFactory

Added in API level 8
SAXTransformerFactory ()

默认的构造函数是有意保护的。

Public methods

newTemplatesHandler

Added in API level 8
TemplatesHandler newTemplatesHandler ()

获取可以将SAX ContentHandler事件处理为Templates对象的TemplatesHandler对象。

Returns
TemplatesHandler A non-null reference to a TransformerHandler, that may be used as a ContentHandler for SAX parse events.
Throws
TransformerConfigurationException If for some reason the TemplatesHandler cannot be created.

newTransformerHandler

Added in API level 8
TransformerHandler newTransformerHandler ()

获取一个可以将SAX ContentHandler事件处理成Result的TransformerHandler对象。 转换定义为身份(或复制)转换,例如将一系列SAX解析事件复制到DOM树中。

Returns
TransformerHandler A non-null reference to a TransformerHandler, that may be used as a ContentHandler for SAX parse events.
Throws
TransformerConfigurationException If for some reason the TransformerHandler cannot be created.

newTransformerHandler

Added in API level 8
TransformerHandler newTransformerHandler (Source src)

根据参数指定的转换指令,获取可将SAX ContentHandler事件处理成Result的TransformerHandler对象。

Parameters
src Source: The Source of the transformation instructions.
Returns
TransformerHandler TransformerHandler ready to transform SAX events.
Throws
TransformerConfigurationException If for some reason the TransformerHandler can not be created.

newTransformerHandler

Added in API level 8
TransformerHandler newTransformerHandler (Templates templates)

根据Templates参数获取可将SAX ContentHandler事件处理成Result的TransformerHandler对象。

Parameters
templates Templates: The compiled transformation instructions.
Returns
TransformerHandler TransformerHandler ready to transform SAX events.
Throws
TransformerConfigurationException If for some reason the TransformerHandler can not be created.

newXMLFilter

Added in API level 8
XMLFilter newXMLFilter (Source src)

创建一个使用给定Source作为转换指令的XMLFilter。

Parameters
src Source: The Source of the transformation instructions.
Returns
XMLFilter An XMLFilter object, or null if this feature is not supported.
Throws
TransformerConfigurationException If for some reason the TemplatesHandler cannot be created.

newXMLFilter

Added in API level 8
XMLFilter newXMLFilter (Templates templates)

基于Templates参数创建一个XMLFilter ..

Parameters
templates Templates: The compiled transformation instructions.
Returns
XMLFilter An XMLFilter object, or null if this feature is not supported.
Throws
TransformerConfigurationException If for some reason the TemplatesHandler cannot be created.

Hooray!