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