1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.internal.impl;
20
21 import java.util.Optional;
22 import org.apache.maven.api.MojoExecution;
23 import org.apache.maven.api.model.Plugin;
24 import org.apache.maven.api.xml.Dom;
25 import org.codehaus.plexus.util.xml.Xpp3Dom;
26
27 public class DefaultMojoExecution implements MojoExecution {
28 private final org.apache.maven.plugin.MojoExecution delegate;
29
30 public DefaultMojoExecution(org.apache.maven.plugin.MojoExecution delegate) {
31 this.delegate = delegate;
32 }
33
34 public org.apache.maven.plugin.MojoExecution getDelegate() {
35 return delegate;
36 }
37
38 @Override
39 public Plugin getPlugin() {
40 return delegate.getPlugin().getDelegate();
41 }
42
43 @Override
44 public String getExecutionId() {
45 return delegate.getExecutionId();
46 }
47
48 @Override
49 public String getGoal() {
50 return delegate.getGoal();
51 }
52
53 @Override
54 public Optional<Dom> getConfiguration() {
55 return Optional.of(delegate.getConfiguration()).map(Xpp3Dom::getDom);
56 }
57
58 @Override
59 public String toString() {
60 return delegate.toString();
61 }
62 }