net.sf.maventaglib
Class TaglibPlugin

java.lang.Object
  extended by net.sf.maventaglib.TaglibPlugin
Direct Known Subclasses:
TaglibConvertPlugin, TaglibTaglibdocPlugin, TaglibTagreferencePlugin, TaglibValidatePlugin

public abstract class TaglibPlugin
extends java.lang.Object

Base class for the maven taglib plugin.

Version:
$Id: TaglibPlugin.java,v 1.13 2005/08/23 12:29:52 fgiust Exp $
Author:
Fabrizio Giustina

Field Summary
protected  org.apache.commons.logging.Log log
          logger.
protected  java.lang.String outputDir
          output dir for converted tlds.
protected  java.lang.String srcDir
          tld directory path.
protected  java.lang.String tldOut
          converted tld file name.
protected  java.lang.String tldSrc
          tld directory path.
 
Constructor Summary
TaglibPlugin()
          Instantiate a new Plugin and set up transformer factory.
 
Method Summary
protected  void applyXslt(java.io.File inputFile, java.lang.String stylesheet, java.io.File outputFile)
          Transform a file using the given xsl stylesheet.
protected  void applyXslt(javax.xml.transform.Source src, java.lang.String stylesheet, java.io.File outputFile)
          Apply an xsl stylesheet to a java.xml.tranform.Source.
protected  void echo(java.lang.String message)
          echo a message (using System.out).
abstract  void execute()
          Executes the plugin goal.
protected  javax.xml.parsers.DocumentBuilder getDocumentBuilder()
          Returns a DocumentBuilder instance.
protected  org.xml.sax.XMLReader getReader()
          Returns a XMLReader instance.
 void setOutputDir(java.lang.String dir)
           
 void setSrcDir(java.lang.String path)
           
 void setTldOut(java.lang.String file)
           
 void setTldSrc(java.lang.String file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log
logger.


srcDir

protected java.lang.String srcDir
tld directory path.


tldSrc

protected java.lang.String tldSrc
tld directory path.


outputDir

protected java.lang.String outputDir
output dir for converted tlds.


tldOut

protected java.lang.String tldOut
converted tld file name.

Constructor Detail

TaglibPlugin

public TaglibPlugin()
Instantiate a new Plugin and set up transformer factory.

Method Detail

setOutputDir

public void setOutputDir(java.lang.String dir)
Parameters:
dir - The outputDir to set.

setTldOut

public void setTldOut(java.lang.String file)
Parameters:
file - The tldOut to set.

setTldSrc

public void setTldSrc(java.lang.String file)
Parameters:
file - The tldSrc to set.

setSrcDir

public void setSrcDir(java.lang.String path)
Parameters:
path - The full path for the tld directory.

execute

public abstract void execute()
                      throws java.lang.Exception
Executes the plugin goal.

Throws:
java.lang.Exception - any specific exception thrown by a plugin implementation.

applyXslt

protected void applyXslt(java.io.File inputFile,
                         java.lang.String stylesheet,
                         java.io.File outputFile)
                  throws java.lang.Exception
Transform a file using the given xsl stylesheet.

Parameters:
inputFile - input file
stylesheet - xslt used for transformation
outputFile - output file
Throws:
java.lang.Exception - xml parsing/transforming exceptions

applyXslt

protected void applyXslt(javax.xml.transform.Source src,
                         java.lang.String stylesheet,
                         java.io.File outputFile)
                  throws java.lang.Exception
Apply an xsl stylesheet to a java.xml.tranform.Source.

Parameters:
src - Source
stylesheet - xslt used for transformation
outputFile - output file
Throws:
java.lang.Exception - xml parsing/transforming exceptions

getReader

protected org.xml.sax.XMLReader getReader()
                                   throws org.xml.sax.SAXException,
                                          javax.xml.parsers.ParserConfigurationException
Returns a XMLReader instance.

Returns:
XMLReader instance
Throws:
org.xml.sax.SAXException - for errors on building the sax parser
javax.xml.parsers.ParserConfigurationException - if a SAX parser is not configured

getDocumentBuilder

protected javax.xml.parsers.DocumentBuilder getDocumentBuilder()
                                                        throws javax.xml.parsers.ParserConfigurationException,
                                                               javax.xml.parsers.FactoryConfigurationError
Returns a DocumentBuilder instance.

Returns:
DocumentBuilder instance
Throws:
javax.xml.parsers.FactoryConfigurationError - if the parser is not configured
javax.xml.parsers.ParserConfigurationException - if the parser is not configured

echo

protected void echo(java.lang.String message)
echo a message (using System.out).

Parameters:
message - output text.


Copyright © 2003-2005 Fabrizio Giustina. All Rights Reserved.