org.osjava.jardiff.ant
Class JDTraXLiaison

java.lang.Object
  extended byorg.osjava.jardiff.ant.JDTraXLiaison
All Implemented Interfaces:
ErrorListener, JDXSLTLiaison3, org.apache.tools.ant.taskdefs.XSLTLiaison, org.apache.tools.ant.taskdefs.XSLTLiaison2, org.apache.tools.ant.taskdefs.XSLTLoggerAware

public class JDTraXLiaison
extends Object
implements JDXSLTLiaison3, ErrorListener, org.apache.tools.ant.taskdefs.XSLTLoggerAware

Custom TraX liaison class. This allows loading a stylesheet from a systemid (URL).


Field Summary
 
Fields inherited from interface org.apache.tools.ant.taskdefs.XSLTLiaison
FILE_PROTOCOL_PREFIX
 
Constructor Summary
JDTraXLiaison()
          Create a new JDTraXLiaison.
 
Method Summary
 void addParam(String name, 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.
 void error(TransformerException e)
           
 void fatalError(TransformerException e)
           
protected  String getSystemId(File file)
          Deprecated. use org.apache.tools.ant.util.JAXPUtils#getSystemId instead
 void setAttribute(String name, Object value)
          Set a custom attribute for the JAXP factory implementation.
 void setEntityResolver(EntityResolver aResolver)
          Set the class to resolve entities during the transformation
 void setFactory(String name)
          Set the factory name to use instead of JAXP default lookup.
 void setLogger(org.apache.tools.ant.taskdefs.XSLTLogger l)
           
 void setOutputProperty(String name, String value)
          Set the output property for the current transformer.
 void setStylesheet(File stylesheet)
           
 void setStylesheet(String systemid)
          Set the stylesheet to use for the transformation.
 void setURIResolver(URIResolver aResolver)
          Set the class to resolve URIs during the transformation
 void transform(File infile, File outfile)
           
 void warning(TransformerException e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDTraXLiaison

public JDTraXLiaison()
              throws Exception
Create a new JDTraXLiaison.

Method Detail

setStylesheet

public void setStylesheet(String systemid)
Description copied from interface: JDXSLTLiaison3
Set the stylesheet to use for the transformation.

Specified by:
setStylesheet in interface JDXSLTLiaison3
Parameters:
systemid - the systemid of the stylesheet (a URL).

setStylesheet

public void setStylesheet(File stylesheet)
                   throws Exception
Specified by:
setStylesheet in interface org.apache.tools.ant.taskdefs.XSLTLiaison
Throws:
Exception

transform

public void transform(File infile,
                      File outfile)
               throws Exception
Specified by:
transform in interface org.apache.tools.ant.taskdefs.XSLTLiaison
Throws:
Exception

setFactory

public void setFactory(String name)
Set the factory name to use instead of JAXP default lookup.

Parameters:
name - the fully qualified class name of the factory to use or null for the default JAXP look up mechanism.
Since:
Ant 1.6

setAttribute

public void setAttribute(String name,
                         Object value)
Set a custom attribute for the JAXP factory implementation.

Parameters:
name - the attribute name.
value - the value of the attribute, usually a boolean string or object.
Since:
Ant 1.6

setOutputProperty

public void setOutputProperty(String name,
                              String value)
Set the output property for the current transformer. Note that the stylesheet must be set prior to calling this method.

Parameters:
name - the output property name.
value - the output property value.
Since:
Ant 1.5, Ant 1.5

setEntityResolver

public void setEntityResolver(EntityResolver aResolver)
Set the class to resolve entities during the transformation


setURIResolver

public void setURIResolver(URIResolver aResolver)
Set the class to resolve URIs during the transformation


addParam

public void addParam(String name,
                     String value)
Specified by:
addParam in interface org.apache.tools.ant.taskdefs.XSLTLiaison

setLogger

public void setLogger(org.apache.tools.ant.taskdefs.XSLTLogger l)
Specified by:
setLogger in interface org.apache.tools.ant.taskdefs.XSLTLoggerAware

error

public void error(TransformerException e)
Specified by:
error in interface ErrorListener

fatalError

public void fatalError(TransformerException e)
Specified by:
fatalError in interface ErrorListener

warning

public void warning(TransformerException e)
Specified by:
warning in interface ErrorListener

getSystemId

protected String getSystemId(File file)
Deprecated. use org.apache.tools.ant.util.JAXPUtils#getSystemId instead


configure

public void configure(org.apache.tools.ant.taskdefs.XSLTProcess xsltTask)
Specific configuration for the TRaX liaison.

Specified by:
configure in interface org.apache.tools.ant.taskdefs.XSLTLiaison2
Parameters:
xsltTask - the XSLTProcess task instance from which this liasion is to be configured.

configure

public void configure(JDXSLTProcess xsltTask)
Specific configuration for the TRaX liaison.

Specified by:
configure in interface JDXSLTLiaison3
Parameters:
xsltTask - the XSLTProcess task instance from which this liasion is to be configured.


Copyright © 2005-2006 OSJava. All Rights Reserved.