📄 transformerfactory.html
字号:
Obtain a new instance of a <code>TransformerFactory</code>. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="../../../javax/xml/transform/Templates.html" title="interface in javax.xml.transform">Templates</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/transform/TransformerFactory.html#newTemplates(javax.xml.transform.Source)">newTemplates</A></B>(<A HREF="../../../javax/xml/transform/Source.html" title="interface in javax.xml.transform">Source</A> source)</CODE><BR> Process the Source into a Templates object, which is a a compiled representation of the source. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="../../../javax/xml/transform/Transformer.html" title="class in javax.xml.transform">Transformer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/transform/TransformerFactory.html#newTransformer()">newTransformer</A></B>()</CODE><BR> Create a new Transformer object that performs a copy of the source to the result.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="../../../javax/xml/transform/Transformer.html" title="class in javax.xml.transform">Transformer</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/transform/TransformerFactory.html#newTransformer(javax.xml.transform.Source)">newTransformer</A></B>(<A HREF="../../../javax/xml/transform/Source.html" title="interface in javax.xml.transform">Source</A> source)</CODE><BR> Process the Source into a Transformer object. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/transform/TransformerFactory.html#setAttribute(java.lang.String, java.lang.Object)">setAttribute</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> value)</CODE><BR> Allows the user to set specific attributes on the underlying implementation. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/transform/TransformerFactory.html#setErrorListener(javax.xml.transform.ErrorListener)">setErrorListener</A></B>(<A HREF="../../../javax/xml/transform/ErrorListener.html" title="interface in javax.xml.transform">ErrorListener</A> listener)</CODE><BR> Set the error event listener for the TransformerFactory, which is used for the processing of transformation instructions, and not for the transformation itself.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/xml/transform/TransformerFactory.html#setURIResolver(javax.xml.transform.URIResolver)">setURIResolver</A></B>(<A HREF="../../../javax/xml/transform/URIResolver.html" title="interface in javax.xml.transform">URIResolver</A> resolver)</CODE><BR> Set an object that is used by default during the transformation to resolve URIs used in xsl:import, or xsl:include.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="TransformerFactory()"><!-- --></A><H3>TransformerFactory</H3><PRE>protected <B>TransformerFactory</B>()</PRE><DL><DD>Default constructor is protected on purpose.<P></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="newInstance()"><!-- --></A><H3>newInstance</H3><PRE>public static <A HREF="../../../javax/xml/transform/TransformerFactory.html" title="class in javax.xml.transform">TransformerFactory</A> <B>newInstance</B>() throws <A HREF="../../../javax/xml/transform/TransformerFactoryConfigurationError.html" title="class in javax.xml.transform">TransformerFactoryConfigurationError</A></PRE><DL><DD>Obtain a new instance of a <code>TransformerFactory</code>. This static method creates a new factory instance This method uses the following ordered lookup procedure to determine the <code>TransformerFactory</code> implementation class to load: <ul> <li> Use the <code>javax.xml.transform.TransformerFactory</code> system property. </li> <li> Use the properties file "lib/jaxp.properties" in the JRE directory. This configuration file is in standard <code>java.util.Properties </code> format and contains the fully qualified name of the implementation class with the key being the system property defined above. </li> <li> Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file <code>META-INF/services/javax.xml.transform.TransformerFactory</code> in jars available to the runtime. </li> <li> Platform default <code>TransformerFactory</code> instance. </li> </ul> Once an application has obtained a reference to a <code> TransformerFactory</code> it can use the factory to configure and obtain parser instances.<P><DD><DL><DT><B>Returns:</B><DD>new TransformerFactory instance, never null.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/transform/TransformerFactoryConfigurationError.html" title="class in javax.xml.transform">TransformerFactoryConfigurationError</A></CODE> - if the implmentation is not available or cannot be instantiated.</DL></DD></DL><HR><A NAME="newTransformer(javax.xml.transform.Source)"><!-- --></A><H3>newTransformer</H3><PRE>public abstract <A HREF="../../../javax/xml/transform/Transformer.html" title="class in javax.xml.transform">Transformer</A> <B>newTransformer</B>(<A HREF="../../../javax/xml/transform/Source.html" title="interface in javax.xml.transform">Source</A> source) throws <A HREF="../../../javax/xml/transform/TransformerConfigurationException.html" title="class in javax.xml.transform">TransformerConfigurationException</A></PRE><DL><DD>Process the Source into a Transformer object. Care must be given not to use this object in multiple threads running concurrently. Different TransformerFactories can be used concurrently by different threads.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>source</CODE> - An object that holds a URI, input stream, etc.<DT><B>Returns:</B><DD>A Transformer object that may be used to perform a transformation in a single thread, never null.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/transform/TransformerConfigurationException.html" title="class in javax.xml.transform">TransformerConfigurationException</A></CODE> - May throw this during the parse when it is constructing the Templates object and fails.</DL></DD></DL><HR><A NAME="newTransformer()"><!-- --></A><H3>newTransformer</H3><PRE>public abstract <A HREF="../../../javax/xml/transform/Transformer.html" title="class in javax.xml.transform">Transformer</A> <B>newTransformer</B>() throws <A HREF="../../../javax/xml/transform/TransformerConfigurationException.html" title="class in javax.xml.transform">TransformerConfigurationException</A></PRE><DL><DD>Create a new Transformer object that performs a copy of the source to the result.<P><DD><DL><DT><B>Returns:</B><DD>A Transformer object that may be used to perform a transformation in a single thread, never null.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/xml/transform/TransformerConfigurationException.html" title="class in javax.xml.transform">TransformerConfigurationException</A></CODE> - May throw this during the parse when it is constructing the Templates object and fails.</DL></DD></DL><HR><A NAME="newTemplates(javax.xml.transform.Source)"><!-- --></A><H3>newTemplates</H3><PRE>public abstract <A HREF="../../../javax/xml/transform/Templates.html" title="interface in javax.xml.transform">Templates</A> <B>newTemplates</B>(<A HREF="../../../javax/xml/transform/Source.html" title="interface in javax.xml.transform">Source</A> source) throws <A HREF="../../../javax/xml/transform/TransformerConfigurationException.html" title="class in javax.xml.transform">TransformerConfigurationException</A></PRE><DL><DD>Process the Source into a Templates object, which is a a compiled representation of the source. This Templates object may then be used concurrently across multiple threads. Creating a Templates object allows the TransformerFactory to do detailed performance optimization of transformation instructions, without penalizing runtime transformation.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>source</CODE> - An object that holds a URL, input stream, etc.<DT><B>Returns:</B><DD>A Templates object capable of being used for transformation purposes, never null.<DT><B>Throws:</B>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -