1 package org.apache.maven.plugins.scm.release;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 import org.dom4j.Node;
22
23 /**
24 *
25 *
26 * @author <a href="mailto:jason@zenplex.com">Jason van Zyl</a>
27 *
28 * @version $Id: Transformation.java 521198 2007-03-22 10:39:43Z ltheussl $
29 */
30 public class Transformation
31 {
32 /** Pom Transformer associated with this transformation. */
33 private PomTransformer pomTransformer;
34
35 /** Node to transform. */
36 private Node node;
37
38 public Transformation( PomTransformer pomTransformer )
39 {
40 this.pomTransformer = pomTransformer;
41 }
42
43
44
45
46
47 /**
48 *
49 * @return
50 */
51 public Node getNode()
52 {
53 return node;
54 }
55
56 /**
57 *
58 * @param node
59 */
60 public void setNode( Node node )
61 {
62 this.node = node;
63 }
64
65 /**
66 *
67 * @throws Exception
68 */
69 public void transform()
70 throws Exception
71 {
72 pomTransformer.transformNode( node );
73 }
74
75 /**
76 *
77 * @return
78 * @throws Exception
79 */
80 public String getBeforeTransformation()
81 throws Exception
82 {
83 return getNode().asXML();
84 }
85
86 /**
87 *
88 * @return
89 * @throws Exception
90 */
91 public String getAfterTransformation()
92 throws Exception
93 {
94 return pomTransformer.getTransformedNode( getNode() ).asXML();
95 }
96 }