|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.osjava.jardiff.ant.JDTraXLiaison
public class JDTraXLiaison
Custom TraX liaison class. This allows loading a stylesheet from a systemid (URL).
Field Summary | |
---|---|
private java.util.Vector |
attributes
factory attributes |
private org.xml.sax.EntityResolver |
entityResolver
possible resolver for publicIds |
private java.lang.String |
factoryName
the name of the factory implementation class to use or null for default JAXP lookup. |
private org.apache.tools.ant.taskdefs.XSLTLogger |
logger
|
private java.util.Vector |
outputProperties
transformer output properties |
private java.util.Vector |
params
stylesheet parameters |
private java.io.File |
stylesheet
stylesheet to use for transformation |
private java.lang.String |
systemid
The systemid of the stylesheet (a URL). |
private javax.xml.transform.Templates |
templates
The In memory version of the stylesheet |
private long |
templatesModTime
The modification time of the stylesheet from which the templates are read |
private javax.xml.transform.TransformerFactory |
tfactory
The trax TransformerFactory |
private javax.xml.transform.Transformer |
transformer
transformer to use for processing files |
private javax.xml.transform.URIResolver |
uriResolver
possible resolver for URIs |
Fields inherited from interface org.apache.tools.ant.taskdefs.XSLTLiaison |
---|
FILE_PROTOCOL_PREFIX |
Constructor Summary | |
---|---|
JDTraXLiaison()
Create a new JDTraXLiaison. |
Method Summary | |
---|---|
void |
addParam(java.lang.String name,
java.lang.String value)
|
void |
configure(JDXSLTProcess xsltTask)
Specific configuration for the TRaX liaison. |
void |
configure(org.apache.tools.ant.taskdefs.XSLTProcess xsltTask)
Specific configuration for the TRaX liaison. |
private void |
createTransformer()
Create a new transformer based on the liaison settings |
void |
error(javax.xml.transform.TransformerException e)
|
void |
fatalError(javax.xml.transform.TransformerException e)
|
private javax.xml.transform.TransformerFactory |
getFactory()
return the Transformer factory associated to this liaison. |
private javax.xml.transform.Source |
getSource(java.io.InputStream is,
java.io.File infile)
Get the source instance from the stream and id of the file. |
private javax.xml.transform.Source |
getSource(java.io.InputStream is,
java.lang.String systemid)
|
protected java.lang.String |
getSystemId(java.io.File file)
Deprecated. use org.apache.tools.ant.util.JAXPUtils#getSystemId instead |
private void |
logError(javax.xml.transform.TransformerException e,
java.lang.String type)
|
private void |
readTemplates()
Read in templates from the stylesheet |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set a custom attribute for the JAXP factory implementation. |
void |
setEntityResolver(org.xml.sax.EntityResolver aResolver)
Set the class to resolve entities during the transformation |
void |
setFactory(java.lang.String name)
Set the factory name to use instead of JAXP default lookup. |
void |
setLogger(org.apache.tools.ant.taskdefs.XSLTLogger l)
|
void |
setOutputProperty(java.lang.String name,
java.lang.String value)
Set the output property for the current transformer. |
void |
setStylesheet(java.io.File stylesheet)
|
void |
setStylesheet(java.lang.String systemid)
Set the stylesheet to use for the transformation. |
void |
setURIResolver(javax.xml.transform.URIResolver aResolver)
Set the class to resolve URIs during the transformation |
void |
transform(java.io.File infile,
java.io.File outfile)
|
void |
warning(javax.xml.transform.TransformerException e)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String systemid
private java.lang.String factoryName
private javax.xml.transform.TransformerFactory tfactory
private java.io.File stylesheet
private org.apache.tools.ant.taskdefs.XSLTLogger logger
private org.xml.sax.EntityResolver entityResolver
private javax.xml.transform.Transformer transformer
private javax.xml.transform.Templates templates
private long templatesModTime
private javax.xml.transform.URIResolver uriResolver
private java.util.Vector outputProperties
private java.util.Vector params
private java.util.Vector attributes
Constructor Detail |
---|
public JDTraXLiaison() throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public void setStylesheet(java.lang.String systemid)
JDXSLTLiaison3
setStylesheet
in interface JDXSLTLiaison3
systemid
- the systemid of the stylesheet (a URL).public void setStylesheet(java.io.File stylesheet) throws java.lang.Exception
setStylesheet
in interface org.apache.tools.ant.taskdefs.XSLTLiaison
java.lang.Exception
public void transform(java.io.File infile, java.io.File outfile) throws java.lang.Exception
transform
in interface org.apache.tools.ant.taskdefs.XSLTLiaison
java.lang.Exception
private javax.xml.transform.Source getSource(java.io.InputStream is, java.io.File infile) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
is
- the stream containing the stylesheet data.infile
- the file that will be used for the systemid.
java.lang.Exception
- if there is a problem creating the source.
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
private javax.xml.transform.Source getSource(java.io.InputStream is, java.lang.String systemid) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
private void readTemplates() throws java.io.IOException, javax.xml.transform.TransformerConfigurationException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerConfigurationException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
private void createTransformer() throws java.lang.Exception
java.lang.Exception
- thrown if there is an error during creation.setStylesheet(java.io.File)
,
addParam(java.lang.String, java.lang.String)
,
setOutputProperty(java.lang.String, java.lang.String)
private javax.xml.transform.TransformerFactory getFactory() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
- thrown if there is a problem creating
the factory.setFactory(String)
public void setFactory(java.lang.String name)
name
- the fully qualified class name of the factory to use
or null for the default JAXP look up mechanism.public void setAttribute(java.lang.String name, java.lang.Object value)
name
- the attribute name.value
- the value of the attribute, usually a boolean
string or object.public void setOutputProperty(java.lang.String name, java.lang.String value)
name
- the output property name.value
- the output property value.public void setEntityResolver(org.xml.sax.EntityResolver aResolver)
public void setURIResolver(javax.xml.transform.URIResolver aResolver)
public void addParam(java.lang.String name, java.lang.String value)
addParam
in interface org.apache.tools.ant.taskdefs.XSLTLiaison
public void setLogger(org.apache.tools.ant.taskdefs.XSLTLogger l)
setLogger
in interface org.apache.tools.ant.taskdefs.XSLTLoggerAware
public void error(javax.xml.transform.TransformerException e)
error
in interface javax.xml.transform.ErrorListener
public void fatalError(javax.xml.transform.TransformerException e)
fatalError
in interface javax.xml.transform.ErrorListener
public void warning(javax.xml.transform.TransformerException e)
warning
in interface javax.xml.transform.ErrorListener
private void logError(javax.xml.transform.TransformerException e, java.lang.String type)
protected java.lang.String getSystemId(java.io.File file)
public void configure(org.apache.tools.ant.taskdefs.XSLTProcess xsltTask)
configure
in interface org.apache.tools.ant.taskdefs.XSLTLiaison2
xsltTask
- the XSLTProcess task instance from which this liasion
is to be configured.public void configure(JDXSLTProcess xsltTask)
configure
in interface JDXSLTLiaison3
xsltTask
- the XSLTProcess task instance from which this liasion
is to be configured.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |