org.apache.maven.plugins.scm.release
Class AbstractPomTransformer

java.lang.Object
  extended byorg.apache.maven.plugins.scm.release.AbstractPomTransformer
All Implemented Interfaces:
PomTransformer
Direct Known Subclasses:
SnapshotResolver, SnapshotVersionTransformer, VersionTransformer

public abstract class AbstractPomTransformer
extends Object
implements PomTransformer

This is the base class for any tool that attempts to transform fields in the POM. Currently we are using the XML form of the POM and using Jaxen but eventually we will be able to perform the same transformations on POM beans. Jaxen needs to be modified and some serious cleanup needs to go on in Maven internally, but this will serve as a start. An attempt is made to make this tool GUI friendly.

Version:
$Id: AbstractPomTransformer.java 521198 2007-03-22 10:39:43Z ltheussl $
Author:
Jason van Zyl

Constructor Summary
AbstractPomTransformer()
           
 
Method Summary
 void createTransformations()
           
 org.dom4j.Document getDocument()
           
 File getOutputFile()
           
 File getProject()
           
 int getSelectedNodeCount()
           
 List getSelectedNodes()
           
 List getTransformations()
           
 Map getVariables()
           
 void selectNodes()
          Update the snapshot version identifiers with actual timestamp versions and write out the POM in its updated form.
abstract  String selectNodesXPathExpression()
           
 void setDocument(org.dom4j.Document document)
           
 void setOutputFile(File outputFile)
           
 void setProject(File project)
           
 void setSelectedNodes(List selectedNodes)
           
 void setVariables(Map variables)
           
abstract  void transformNode(org.dom4j.Node node)
           
 void transformNodes()
          This is the automated way of transforming the nodes if there is no user interaction involved.
 void write()
           
 void write(String encoding)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.plugins.scm.release.PomTransformer
getTransformedNode
 

Constructor Detail

AbstractPomTransformer

public AbstractPomTransformer()
Method Detail

getVariables

public Map getVariables()
Returns:

setVariables

public void setVariables(Map variables)
Parameters:
variables -

setProject

public void setProject(File project)
Parameters:
project -

getProject

public File getProject()
Returns:

getDocument

public org.dom4j.Document getDocument()
Returns:

setDocument

public void setDocument(org.dom4j.Document document)
Parameters:
document -

getOutputFile

public File getOutputFile()
Returns:

setOutputFile

public void setOutputFile(File outputFile)
Parameters:
outputFile -

getSelectedNodes

public List getSelectedNodes()
Returns:

setSelectedNodes

public void setSelectedNodes(List selectedNodes)
Parameters:
selectedNodes -

getSelectedNodeCount

public int getSelectedNodeCount()
Returns:

getTransformations

public List getTransformations()
Returns:

createTransformations

public void createTransformations()

transformNodes

public void transformNodes()
                    throws Exception
This is the automated way of transforming the nodes if there is no user interaction involved.

Throws:
Exception - If an error occurs while transforming the nodes.

selectNodesXPathExpression

public abstract String selectNodesXPathExpression()
Returns:

transformNode

public abstract void transformNode(org.dom4j.Node node)
                            throws Exception
Specified by:
transformNode in interface PomTransformer
Parameters:
node -
Throws:
Exception

selectNodes

public void selectNodes()
                 throws Exception
Update the snapshot version identifiers with actual timestamp versions and write out the POM in its updated form.

Throws:
Exception

write

public void write()
           throws Exception
Throws:
Exception

write

public void write(String encoding)
           throws Exception
Throws:
Exception


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.