APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.org.apache.xalan.internal.xsltc.trax

public Class TransformerFactoryImpl

extends SAXTransformerFactory
implements SourceLoader
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader
Imports
com.sun.org.apache.xalan.internal.utils.ObjectFactory, com.sun.org.apache.xalan.internal.xsltc.compiler.Constants, .SourceLoader, .XSLTC, com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg, com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager, com.sun.org.apache.xml.internal.utils.StopParseException, .StylesheetPIHandler, java.io.File, .FileInputStream, .FileNotFoundException, .FilenameFilter, .IOException, .InputStream, java.net.MalformedURLException, .URL, java.util.ArrayList, .Enumeration, .List, .Map, .Properties, java.util.zip.ZipEntry, .ZipFile, javax.xml.XMLConstants, javax.xml.catalog.CatalogException, .CatalogFeatures.Feature, .CatalogFeatures, .CatalogManager, .CatalogResolver, javax.xml.transform.ErrorListener, .Source, .Templates, .Transformer, .TransformerConfigurationException, .TransformerException, .URIResolver, javax.xml.transform.dom.DOMResult, .DOMSource, javax.xml.transform.sax.SAXResult, .SAXSource, .SAXTransformerFactory, .TemplatesHandler, .TransformerHandler, javax.xml.transform.stax.*, javax.xml.transform.stream.StreamResult, .StreamSource, jdk.xml.internal.FeaturePropertyBase, .JdkConstants, .JdkProperty, .JdkXmlConfig, .JdkXmlFeatures, .JdkXmlUtils, .JdkProperty.ImplPropMap, .JdkProperty.State, .TransformErrorListener, .XMLSecurityManager, .XMLSecurityPropertyManager, .XMLSecurityPropertyManager.Property, org.xml.sax.InputSource, .SAXException, .XMLFilter, .XMLReader

Implementation of a JAXP TransformerFactory for Translets.
Authors
G. Todd Miller, Morten Jorgensen, Santiago Pericas-Geertsen

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
TransformerFactoryImpl.PIParamWrapper

The above Map stores objects of this class.

Field Summary

Modifier and TypeField and Description
private String
_accessExternalDTD

protocols allowed for external DTD references in source file and/or stylesheet.

private String
_accessExternalStylesheet

protocols allowed for external references set by the stylesheet processing instruction, Import and Include element.

private boolean
_autoTranslet

If this is set to true, we attempt to use translet classes for transformation if possible without compiling the stylesheet.

pack-priv String
pack-priv CatalogFeatures
pack-priv String
pack-priv String
pack-priv String
pack-priv CatalogResolver
pack-priv int
private boolean
_debug

Set to true when debugging is enabled.

private final ErrorListener
_defaultListener

Default error listener

private String
_destinationDirectory

The destination directory for the translet

private boolean
_enableInlining

Set to true when templates are inlined.

private ErrorListener
_errorListener

This error listener is used only for this factory and is not passed to the Templates or Transformer objects that we create.

private JdkProperty<ClassLoader>
private boolean
_generateTranslet

Set to true when we want to generate translet classes from the stylesheet.

private boolean
private int
_indentNumber

Number of indent spaces when indentation is turned on.

private boolean
_isNotSecureProcessing

State of secure processing feature.

private boolean
_isSecureMode

State of secure mode.

private String
_jarFileName

The jar file name which the translet classes are packaged into

private boolean
_overrideDefaultParser

Indicates whether 3rd party parser may be used to override the system-default Note the default value (false) is the safe option.

private String
private Map<Source, TransformerFactoryImpl.PIParamWrapper>
_piParams

This Map is used to store parameters for locating <?xml-stylesheet ...?

private String
_transletName

The class name of the translet

private URIResolver
_uriResolver

This URIResolver is passed to all created Templates and Transformers

private boolean
_useClasspath

If this is set to true, we attempt to load the translet from the CLASSPATH.

private final JdkXmlFeatures
private XMLSecurityManager
private XMLSecurityPropertyManager
private Map<String, Class<?>>
public static final String
pack-priv CatalogFeatures.Builder
public static final String
private static final String
DEFAULT_TRANSLATE_PACKAGE

The package name prefix for all generated translet classes

protected static final String
DEFAULT_TRANSLET_NAME

As Gregor Samsa awoke one morning from uneasy dreams he found himself transformed in his bed into a gigantic insect.

public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
Inherited from javax.xml.transform.sax.SAXTransformerFactory:
FEATUREFEATURE_XMLFILTER

Constructor Summary

AccessConstructor and Description
public
TransformerFactoryImpl()

javax.xml.transform.sax.TransformerFactory implementation.

Method Summary

Modifier and TypeMethod and Description
private CatalogFeatures
buildCatalogFeatures()

Build the CatalogFeatures object when a newTemplates or newTransformer is created.

protected final XSLTCDTMManager
createNewDTMManagerInstance()

Returns a new instance of the XSLTC DTM Manager service.

public Source

Returns:

A Source object suitable for passing to the TransformerFactory.
getAssociatedStylesheet
(Source
The XML source document.
source
,
String
The media attribute to be matched. May be null, in which case the prefered templates will be used (i.e. alternate = no).
media
,
String
The value of the title attribute to match. May be null.
title
,
String
The value of the charset attribute to match. May be null.
charset
)

Implements abstract javax.xml.transform.TransformerFactory.getAssociatedStylesheet.

javax.xml.transform.sax.TransformerFactory implementation.

public Object

Returns:

An object representing the attribute value
getAttribute
(String
The attribute name
name
)

Implements abstract javax.xml.transform.TransformerFactory.getAttribute.

javax.xml.transform.sax.TransformerFactory implementation.

private byte[][]

Returns:

The bytecode array
getBytecodesFromClasses
(Source
The xsl source
source
,
String
The full name of the translet
fullClassName
)

Load the translet classes from local .class files and return the bytecode array.

private byte[][]

Returns:

The bytecode array
getBytecodesFromJar
(Source
The xsl source
source
,
String
The full name of the translet
fullClassName
)

Load the translet classes from the jar file and return the bytecode.

public ErrorListener

Returns:

The error listener used with the TransformerFactory
getErrorListener
()

Implements abstract javax.xml.transform.TransformerFactory.getErrorListener.

javax.xml.transform.sax.TransformerFactory implementation.

public Map<String, Class<?>>
public boolean

Returns:

'true' if feature is supported, 'false' if not
getFeature
(String
The feature name
name
)

Implements abstract javax.xml.transform.TransformerFactory.getFeature.

javax.xml.transform.sax.TransformerFactory implementation.

public JdkXmlFeatures
getJdkXmlFeatures()

Returns: the feature manager

pack-priv String
getPackageName()

Returns the package name.

private String

Returns:

The file name in the local filesystem, or null if the systemId does not represent a local file.
getStylesheetFileName
(Source
The Source
source
)

Return the local file name from the systemId of the Source object

private String

Returns:

The name of the translet class
getTransletBaseName
(Source
The input Source
source
)

Return the base class name of the translet.

public URIResolver

Returns:

The URLResolver used for this TransformerFactory and all Templates and Transformer objects created using this factory
getURIResolver
()

Implements abstract javax.xml.transform.TransformerFactory.getURIResolver.

javax.xml.transform.sax.TransformerFactory implementation.

public InputSource

Returns:

An InputSource with the loaded document
loadSource
(String
The URI of the document to load
href
,
String
The URI of the currently loaded document
context
,
XSLTC
The compiler that resuests the document
xsltc
)

Implements com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader.loadSource.

This method implements XSLTC's SourceLoader interface.

public Templates

Returns:

A Templates object that can be used to create Transformers.
newTemplates
(Source
The input stylesheet - DOMSource not supported!!!
source
)

Implements abstract javax.xml.transform.TransformerFactory.newTemplates.

javax.xml.transform.sax.TransformerFactory implementation.

public TemplatesHandler

Returns:

A TemplatesHandler object that can handle SAX events
newTemplatesHandler
()

Implements abstract javax.xml.transform.sax.SAXTransformerFactory.newTemplatesHandler.

javax.xml.transform.sax.SAXTransformerFactory implementation.

public Transformer

Returns:

A Transformer object that simply copies the source to the result.
newTransformer
()

Implements abstract javax.xml.transform.TransformerFactory.newTransformer.

javax.xml.transform.sax.TransformerFactory implementation.

public Transformer

Returns:

A Templates object that can be used to create Transformers.
newTransformer
(Source source)

Implements abstract javax.xml.transform.TransformerFactory.newTransformer.

javax.xml.transform.sax.TransformerFactory implementation.

public TransformerHandler

Returns:

A TransformerHandler object that can handle SAX events
newTransformerHandler
()

Implements abstract javax.xml.transform.sax.SAXTransformerFactory.newTransformerHandler.

javax.xml.transform.sax.SAXTransformerFactory implementation.

public TransformerHandler

Returns:

A TransformerHandler object that can handle SAX events
newTransformerHandler
(Source
The source of the transformation instructions.
src
)

Implements abstract javax.xml.transform.sax.SAXTransformerFactory.newTransformerHandler.

javax.xml.transform.sax.SAXTransformerFactory implementation.

public TransformerHandler

Returns:

A TransformerHandler object that can handle SAX events
newTransformerHandler
(Templates
Represents a pre-processed stylesheet
templates
)

Implements abstract javax.xml.transform.sax.SAXTransformerFactory.newTransformerHandler.

javax.xml.transform.sax.SAXTransformerFactory implementation.

public XMLFilter

Returns:

An XMLFilter object, or null if this feature is not supported.
newXMLFilter
(Source
The source of the transformation instructions.
src
)

Implements abstract javax.xml.transform.sax.SAXTransformerFactory.newXMLFilter.

javax.xml.transform.sax.SAXTransformerFactory implementation.

public XMLFilter

Returns:

An XMLFilter object, or null if this feature is not supported.
newXMLFilter
(Templates
The source of the transformation instructions.
templates
)

Implements abstract javax.xml.transform.sax.SAXTransformerFactory.newXMLFilter.

javax.xml.transform.sax.SAXTransformerFactory implementation.

public boolean
overrideDefaultParser()

Return the state of the services mechanism feature.

private void
passErrorsToListener(List<ErrorMsg> messages)

Pass error messages from the compiler to the error listener

private void
passWarningsToListener(List<ErrorMsg> messages)

Pass warning messages from the compiler to the error listener

private void
readFromInputStream(byte[]
The byte array to store the input content.
bytes
,
InputStream
The input stream.
input
,
int
The number of bytes to read.
size
)

Read a given number of bytes from the InputStream into a byte array.

private void
resetTransientAttributes()

Reset the per-session attributes to their default values

public void
setAttribute(String
The attribute name
name
,
Object
An object representing the attribute value
value
)

Implements abstract javax.xml.transform.TransformerFactory.setAttribute.

javax.xml.transform.sax.TransformerFactory implementation.

public void
setErrorListener(ErrorListener
The error listener to use with the TransformerFactory
listener
)

Implements abstract javax.xml.transform.TransformerFactory.setErrorListener.

javax.xml.transform.sax.TransformerFactory implementation.

public void
setFeature(String
Feature name.
name
,
boolean
Is feature state true or false.
value
)

Implements abstract javax.xml.transform.TransformerFactory.setFeature.

Set a feature for this TransformerFactory and Transformers or Templates created by this factory.

public void
setURIResolver(URIResolver
The URLResolver used for this TransformerFactory and all Templates and Transformer objects created using this factory
resolver
)

Implements abstract javax.xml.transform.TransformerFactory.setURIResolver.

javax.xml.transform.sax.TransformerFactory implementation.

Field Detail

_accessExternalDTDback to summary
private String _accessExternalDTD

protocols allowed for external DTD references in source file and/or stylesheet.

_accessExternalStylesheetback to summary
private String _accessExternalStylesheet

protocols allowed for external references set by the stylesheet processing instruction, Import and Include element.

_autoTransletback to summary
private boolean _autoTranslet

If this is set to true, we attempt to use translet classes for transformation if possible without compiling the stylesheet. The translet class is only used if its timestamp is newer than the timestamp of the stylesheet.

_catalogDeferback to summary
pack-priv String _catalogDefer
_catalogFeaturesback to summary
pack-priv CatalogFeatures _catalogFeatures
_catalogFilesback to summary
pack-priv String _catalogFiles
_catalogPreferback to summary
pack-priv String _catalogPrefer
_catalogResolveback to summary
pack-priv String _catalogResolve
_catalogUriResolverback to summary
pack-priv CatalogResolver _catalogUriResolver
_cdataChunkSizeback to summary
pack-priv int _cdataChunkSize
_debugback to summary
private boolean _debug

Set to true when debugging is enabled.

_defaultListenerback to summary
private final ErrorListener _defaultListener

Default error listener

_destinationDirectoryback to summary
private String _destinationDirectory

The destination directory for the translet

_enableInliningback to summary
private boolean _enableInlining

Set to true when templates are inlined.

_errorListenerback to summary
private ErrorListener _errorListener

This error listener is used only for this factory and is not passed to the Templates or Transformer objects that we create.

_extensionClassLoaderback to summary
private JdkProperty<ClassLoader> _extensionClassLoader
_generateTransletback to summary
private boolean _generateTranslet

Set to true when we want to generate translet classes from the stylesheet.

_hasUserErrListenerback to summary
private boolean _hasUserErrListener
_indentNumberback to summary
private int _indentNumber

Number of indent spaces when indentation is turned on.

_isNotSecureProcessingback to summary
private boolean _isNotSecureProcessing

State of secure processing feature.

_isSecureModeback to summary
private boolean _isSecureMode

State of secure mode.

_jarFileNameback to summary
private String _jarFileName

The jar file name which the translet classes are packaged into

_overrideDefaultParserback to summary
private boolean _overrideDefaultParser

Indicates whether 3rd party parser may be used to override the system-default Note the default value (false) is the safe option. Note same as the old property useServicesMechanism

_packageNameback to summary
private String _packageName
_piParamsback to summary
private Map<Source, TransformerFactoryImpl.PIParamWrapper> _piParams

This Map is used to store parameters for locating <?xml-stylesheet ...?> processing instructions in XML docs.

_transletNameback to summary
private String _transletName

The class name of the translet

_uriResolverback to summary
private URIResolver _uriResolver

This URIResolver is passed to all created Templates and Transformers

_useClasspathback to summary
private boolean _useClasspath

If this is set to true, we attempt to load the translet from the CLASSPATH.

_xmlFeaturesback to summary
private final JdkXmlFeatures _xmlFeatures
_xmlSecurityManagerback to summary
private XMLSecurityManager _xmlSecurityManager
_xmlSecurityPropertyMgrback to summary
private XMLSecurityPropertyManager _xmlSecurityPropertyMgr
_xsltcExtensionFunctionsback to summary
private Map<String, Class<?>> _xsltcExtensionFunctions
AUTO_TRANSLETback to summary
public static final String AUTO_TRANSLET
cfBuilderback to summary
pack-priv CatalogFeatures.Builder cfBuilder
DEBUGback to summary
public static final String DEBUG
DEFAULT_TRANSLATE_PACKAGEback to summary
private static final String DEFAULT_TRANSLATE_PACKAGE

The package name prefix for all generated translet classes

DEFAULT_TRANSLET_NAMEback to summary
protected static final String DEFAULT_TRANSLET_NAME

As Gregor Samsa awoke one morning from uneasy dreams he found himself transformed in his bed into a gigantic insect. He was lying on his hard, as it were armour plated, back, and if he lifted his head a little he could see his big, brown belly divided into stiff, arched segments, on top of which the bed quilt could hardly keep in position and was about to slide off completely. His numerous legs, which were pitifully thin compared to the rest of his bulk, waved helplessly before his eyes. "What has happened to me?", he thought. It was no dream....

DESTINATION_DIRECTORYback to summary
public static final String DESTINATION_DIRECTORY
ENABLE_INLININGback to summary
public static final String ENABLE_INLINING
GENERATE_TRANSLETback to summary
public static final String GENERATE_TRANSLET
INDENT_NUMBERback to summary
public static final String INDENT_NUMBER
JAR_NAMEback to summary
public static final String JAR_NAME
PACKAGE_NAMEback to summary
public static final String PACKAGE_NAME
TRANSLET_NAMEback to summary
public static final String TRANSLET_NAME
USE_CLASSPATHback to summary
public static final String USE_CLASSPATH

Constructor Detail

TransformerFactoryImplback to summary
public TransformerFactoryImpl()

javax.xml.transform.sax.TransformerFactory implementation.

Method Detail

buildCatalogFeaturesback to summary
private CatalogFeatures buildCatalogFeatures()

Build the CatalogFeatures object when a newTemplates or newTransformer is created. This will read any System Properties for the CatalogFeatures that may have been set.

createNewDTMManagerInstanceback to summary
protected final XSLTCDTMManager createNewDTMManagerInstance()

Returns a new instance of the XSLTC DTM Manager service.

getAssociatedStylesheetback to summary
public Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException

Implements abstract javax.xml.transform.TransformerFactory.getAssociatedStylesheet.

javax.xml.transform.sax.TransformerFactory implementation. Get the stylesheet specification(s) associated via the xml-stylesheet processing instruction (see http://www.w3.org/TR/xml-stylesheet/) with the document document specified in the source parameter, and that match the given criteria.

Parameters
source:Source

The XML source document.

media:String

The media attribute to be matched. May be null, in which case the prefered templates will be used (i.e. alternate = no).

title:String

The value of the title attribute to match. May be null.

charset:String

The value of the charset attribute to match. May be null.

Returns:Source

A Source object suitable for passing to the TransformerFactory.

Annotations
@Override
Exceptions
TransformerConfigurationException:

Doc from javax.xml.transform.TransformerFactory.getAssociatedStylesheet.

An Exception is thrown if an error occurings during parsing of the source.

getAttributeback to summary
public Object getAttribute(String name) throws IllegalArgumentException

Implements abstract javax.xml.transform.TransformerFactory.getAttribute.

javax.xml.transform.sax.TransformerFactory implementation. Returns the value set for a TransformerFactory attribute

Parameters
name:String

The attribute name

Returns:Object

An object representing the attribute value

Annotations
@Override
Exceptions
IllegalArgumentException:

Doc from javax.xml.transform.TransformerFactory.getAttribute.

When implementation does not recognize the attribute.

getBytecodesFromClassesback to summary
private byte[][] getBytecodesFromClasses(Source source, String fullClassName)

Load the translet classes from local .class files and return the bytecode array.

Parameters
source:Source

The xsl source

fullClassName:String

The full name of the translet

Returns:byte[][]

The bytecode array

getBytecodesFromJarback to summary
private byte[][] getBytecodesFromJar(Source source, String fullClassName)

Load the translet classes from the jar file and return the bytecode.

Parameters
source:Source

The xsl source

fullClassName:String

The full name of the translet

Returns:byte[][]

The bytecode array

getErrorListenerback to summary
public ErrorListener getErrorListener()

Implements abstract javax.xml.transform.TransformerFactory.getErrorListener.

javax.xml.transform.sax.TransformerFactory implementation. Get the error event handler for the TransformerFactory.

Returns:ErrorListener

The error listener used with the TransformerFactory

Annotations
@Override
getExternalExtensionsMapback to summary
public Map<String, Class<?>> getExternalExtensionsMap()
getFeatureback to summary
public boolean getFeature(String name)

Implements abstract javax.xml.transform.TransformerFactory.getFeature.

javax.xml.transform.sax.TransformerFactory implementation. Look up the value of a feature (to see if it is supported). This method must be updated as the various methods and features of this class are implemented.

Parameters
name:String

The feature name

Returns:boolean

'true' if feature is supported, 'false' if not

Annotations
@Override
@SuppressWarnings:deprecation
getJdkXmlFeaturesback to summary
public JdkXmlFeatures getJdkXmlFeatures()
Returns:JdkXmlFeatures

the feature manager

getPackageNameback to summary
pack-priv String getPackageName()

Returns the package name.

getStylesheetFileNameback to summary
private String getStylesheetFileName(Source source)

Return the local file name from the systemId of the Source object

Parameters
source:Source

The Source

Returns:String

The file name in the local filesystem, or null if the systemId does not represent a local file.

getTransletBaseNameback to summary
private String getTransletBaseName(Source source)

Return the base class name of the translet. The translet name is resolved using the following rules: 1. if the _transletName attribute is set and its value is not "GregorSamsa", then _transletName is returned. 2. otherwise get the translet name from the base name of the system ID 3. return "GregorSamsa" if the result from step 2 is null.

Parameters
source:Source

The input Source

Returns:String

The name of the translet class

getURIResolverback to summary
public URIResolver getURIResolver()

Implements abstract javax.xml.transform.TransformerFactory.getURIResolver.

javax.xml.transform.sax.TransformerFactory implementation. Get the object that is used by default during the transformation to resolve URIs used in document(), xsl:import, or xsl:include.

Returns:URIResolver

The URLResolver used for this TransformerFactory and all Templates and Transformer objects created using this factory

Annotations
@Override
loadSourceback to summary
public InputSource loadSource(String href, String context, XSLTC xsltc)

Implements com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader.loadSource.

This method implements XSLTC's SourceLoader interface. It is used to glue a TrAX URIResolver to the XSLTC compiler's Input and Import classes.

Parameters
href:String

The URI of the document to load

context:String

The URI of the currently loaded document

xsltc:XSLTC

The compiler that resuests the document

Returns:InputSource

An InputSource with the loaded document

Annotations
@Override
newTemplatesback to summary
public Templates newTemplates(Source source) throws TransformerConfigurationException

Implements abstract javax.xml.transform.TransformerFactory.newTemplates.

javax.xml.transform.sax.TransformerFactory implementation. Process the Source into a Templates object, which is a a compiled representation of the source.

Parameters
source:Source

The input stylesheet - DOMSource not supported!!!

Returns:Templates

A Templates object that can be used to create Transformers.

Annotations
@Override
Exceptions
TransformerConfigurationException:

Doc from javax.xml.transform.TransformerFactory.newTemplates.

When parsing to construct the Templates object fails.

newTemplatesHandlerback to summary
public TemplatesHandler newTemplatesHandler() throws TransformerConfigurationException

Implements abstract javax.xml.transform.sax.SAXTransformerFactory.newTemplatesHandler.

javax.xml.transform.sax.SAXTransformerFactory implementation. Get a TemplatesHandler object that can process SAX ContentHandler events into a Templates object.

Returns:TemplatesHandler

A TemplatesHandler object that can handle SAX events

Annotations
@Override
Exceptions
TransformerConfigurationException:

Doc from javax.xml.transform.sax.SAXTransformerFactory.newTemplatesHandler.

If for some reason the TemplatesHandler cannot be created.

newTransformerback to summary
public Transformer newTransformer() throws TransformerConfigurationException

Implements abstract javax.xml.transform.TransformerFactory.newTransformer.

javax.xml.transform.sax.TransformerFactory implementation. Create a Transformer object that copies the input document to the result.

Returns:Transformer

A Transformer object that simply copies the source to the result.

Annotations
@Override
Exceptions
TransformerConfigurationException:

Doc from javax.xml.transform.TransformerFactory.newTransformer.

When it is not possible to create a Transformer instance.

newTransformerback to summary
public Transformer newTransformer(Source source) throws TransformerConfigurationException

Implements abstract javax.xml.transform.TransformerFactory.newTransformer.

javax.xml.transform.sax.TransformerFactory implementation. Process the Source into a Templates object, which is a a compiled representation of the source. Note that this method should not be used with XSLTC, as the time-consuming compilation is done for each and every transformation.

Returns:Transformer

A Templates object that can be used to create Transformers.

Annotations
@Override
Exceptions
TransformerConfigurationException:

Doc from javax.xml.transform.TransformerFactory.newTransformer.

Thrown if there are errors when parsing the Source or it is not possible to create a Transformer instance.

newTransformerHandlerback to summary
public TransformerHandler newTransformerHandler() throws TransformerConfigurationException

Implements abstract javax.xml.transform.sax.SAXTransformerFactory.newTransformerHandler.

javax.xml.transform.sax.SAXTransformerFactory implementation. Get a TransformerHandler object that can process SAX ContentHandler events into a Result. This method will return a pure copy transformer.

Returns:TransformerHandler

A TransformerHandler object that can handle SAX events

Annotations
@Override
Exceptions
TransformerConfigurationException:

Doc from javax.xml.transform.sax.SAXTransformerFactory.newTransformerHandler.

If for some reason the TransformerHandler cannot be created.

newTransformerHandlerback to summary
public TransformerHandler newTransformerHandler(Source src) throws TransformerConfigurationException

Implements abstract javax.xml.transform.sax.SAXTransformerFactory.newTransformerHandler.

javax.xml.transform.sax.SAXTransformerFactory implementation. Get a TransformerHandler object that can process SAX ContentHandler events into a Result, based on the transformation instructions specified by the argument.

Parameters
src:Source

The source of the transformation instructions.

Returns:TransformerHandler

A TransformerHandler object that can handle SAX events

Annotations
@Override
Exceptions
TransformerConfigurationException:

Doc from javax.xml.transform.sax.SAXTransformerFactory.newTransformerHandler.

If for some reason the TransformerHandler can not be created.

newTransformerHandlerback to summary
public TransformerHandler newTransformerHandler(Templates templates) throws TransformerConfigurationException

Implements abstract javax.xml.transform.sax.SAXTransformerFactory.newTransformerHandler.

javax.xml.transform.sax.SAXTransformerFactory implementation. Get a TransformerHandler object that can process SAX ContentHandler events into a Result, based on the transformation instructions specified by the argument.

Parameters
templates:Templates

Represents a pre-processed stylesheet

Returns:TransformerHandler

A TransformerHandler object that can handle SAX events

Annotations
@Override
Exceptions
TransformerConfigurationException:

Doc from javax.xml.transform.sax.SAXTransformerFactory.newTransformerHandler.

If for some reason the TransformerHandler can not be created.

newXMLFilterback to summary
public XMLFilter newXMLFilter(Source src) throws TransformerConfigurationException

Implements abstract javax.xml.transform.sax.SAXTransformerFactory.newXMLFilter.

javax.xml.transform.sax.SAXTransformerFactory implementation. Create an XMLFilter that uses the given source as the transformation instructions.

Parameters
src:Source

The source of the transformation instructions.

Returns:XMLFilter

An XMLFilter object, or null if this feature is not supported.

Annotations
@Override
Exceptions
TransformerConfigurationException:

Doc from javax.xml.transform.sax.SAXTransformerFactory.newXMLFilter.

If for some reason the TemplatesHandler cannot be created.

newXMLFilterback to summary
public XMLFilter newXMLFilter(Templates templates) throws TransformerConfigurationException

Implements abstract javax.xml.transform.sax.SAXTransformerFactory.newXMLFilter.

javax.xml.transform.sax.SAXTransformerFactory implementation. Create an XMLFilter that uses the given source as the transformation instructions.

Parameters
templates:Templates

The source of the transformation instructions.

Returns:XMLFilter

An XMLFilter object, or null if this feature is not supported.

Annotations
@Override
Exceptions
TransformerConfigurationException:

Doc from javax.xml.transform.sax.SAXTransformerFactory.newXMLFilter.

If for some reason the TemplatesHandler cannot be created.

overrideDefaultParserback to summary
public boolean overrideDefaultParser()

Return the state of the services mechanism feature.

passErrorsToListenerback to summary
private void passErrorsToListener(List<ErrorMsg> messages)

Pass error messages from the compiler to the error listener

passWarningsToListenerback to summary
private void passWarningsToListener(List<ErrorMsg> messages) throws TransformerException

Pass warning messages from the compiler to the error listener

readFromInputStreamback to summary
private void readFromInputStream(byte[] bytes, InputStream input, int size) throws IOException

Read a given number of bytes from the InputStream into a byte array.

Parameters
bytes:byte[]

The byte array to store the input content.

input:InputStream

The input stream.

size:int

The number of bytes to read.

resetTransientAttributesback to summary
private void resetTransientAttributes()

Reset the per-session attributes to their default values

setAttributeback to summary
public void setAttribute(String name, Object value) throws IllegalArgumentException

Implements abstract javax.xml.transform.TransformerFactory.setAttribute.

javax.xml.transform.sax.TransformerFactory implementation. Sets the value for a TransformerFactory attribute.

Parameters
name:String

The attribute name

value:Object

An object representing the attribute value

Annotations
@Override
Exceptions
IllegalArgumentException:

Doc from javax.xml.transform.TransformerFactory.setAttribute.

When implementation does not recognize the attribute.

setErrorListenerback to summary
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException

Implements abstract javax.xml.transform.TransformerFactory.setErrorListener.

javax.xml.transform.sax.TransformerFactory implementation. Set the error event listener for the TransformerFactory, which is used for the processing of transformation instructions, and not for the transformation itself.

Parameters
listener:ErrorListener

The error listener to use with the TransformerFactory

Annotations
@Override
Exceptions
IllegalArgumentException:

Doc from javax.xml.transform.TransformerFactory.setErrorListener.

When listener is null

setFeatureback to summary
public void setFeature(String name, boolean value) throws TransformerConfigurationException

Implements abstract javax.xml.transform.TransformerFactory.setFeature.

Set a feature for this TransformerFactory and Transformers or Templates created by this factory.

Feature names are fully qualified java.net.URIs. Implementations may define their own features. An TransformerConfigurationException is thrown if this TransformerFactory or the Transformers or Templates it creates cannot support the feature. It is possible for an TransformerFactory to expose a feature value but be unable to change its state.

See javax.xml.transform.TransformerFactory for full documentation of specific features.

Parameters
name:String

Feature name.

value:boolean

Is feature state true or false.

Annotations
@Override
@SuppressWarnings:deprecation
Exceptions
TransformerConfigurationException:
if this TransformerFactory or the Transformers or Templates it creates cannot support this feature.
NullPointerException:
If the name parameter is null.
setURIResolverback to summary
public void setURIResolver(URIResolver resolver)

Implements abstract javax.xml.transform.TransformerFactory.setURIResolver.

javax.xml.transform.sax.TransformerFactory implementation. Set the object that is used by default during the transformation to resolve URIs used in document(), xsl:import, or xsl:include. Note that this does not affect Templates and Transformers that are already created with this factory.

Parameters
resolver:URIResolver

The URLResolver used for this TransformerFactory and all Templates and Transformer objects created using this factory

Annotations
@Override
com.sun.org.apache.xalan.internal.xsltc.trax back to summary

private Class TransformerFactoryImpl.PIParamWrapper

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.PIParamWrapper

The above Map stores objects of this class.

Field Summary

Modifier and TypeField and Description
public String
public String
public String

Constructor Summary

AccessConstructor and Description
public
PIParamWrapper(String media, String title, String charset)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_charsetback to summary
public String _charset
_mediaback to summary
public String _media
_titleback to summary
public String _title

Constructor Detail

PIParamWrapperback to summary
public PIParamWrapper(String media, String title, String charset)