Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||||
PluginMetadata |
|
| 1.8333333333333333;1.833 |
1 | /* |
|
2 | * $Id$ |
|
3 | */ |
|
4 | ||
5 | package org.apache.maven.plugin.tools.model; |
|
6 | ||
7 | //---------------------------------/ |
|
8 | //- Imported classes and packages -/ |
|
9 | //---------------------------------/ |
|
10 | ||
11 | import java.util.Date; |
|
12 | ||
13 | /** |
|
14 | * Root element of a script-based mojo's plugin metadata bindings. |
|
15 | * |
|
16 | * @version $Revision$ $Date$ |
|
17 | */ |
|
18 | 0 | public class PluginMetadata implements java.io.Serializable { |
19 | ||
20 | ||
21 | //--------------------------/ |
|
22 | //- Class/Member Variables -/ |
|
23 | //--------------------------/ |
|
24 | ||
25 | /** |
|
26 | * Field mojos |
|
27 | */ |
|
28 | private java.util.List mojos; |
|
29 | ||
30 | ||
31 | //-----------/ |
|
32 | //- Methods -/ |
|
33 | //-----------/ |
|
34 | ||
35 | /** |
|
36 | * Method addMojo |
|
37 | * |
|
38 | * @param mojo |
|
39 | */ |
|
40 | public void addMojo(Mojo mojo) |
|
41 | { |
|
42 | 0 | if ( !(mojo instanceof Mojo) ) |
43 | { |
|
44 | 0 | throw new ClassCastException( "PluginMetadata.addMojos(mojo) parameter must be instanceof " + Mojo.class.getName() ); |
45 | } |
|
46 | 0 | getMojos().add( mojo ); |
47 | 0 | } //-- void addMojo(Mojo) |
48 | ||
49 | /** |
|
50 | * Method getMojos |
|
51 | */ |
|
52 | public java.util.List getMojos() |
|
53 | { |
|
54 | 0 | if ( this.mojos == null ) |
55 | { |
|
56 | 0 | this.mojos = new java.util.ArrayList(); |
57 | } |
|
58 | ||
59 | 0 | return this.mojos; |
60 | } //-- java.util.List getMojos() |
|
61 | ||
62 | /** |
|
63 | * Method removeMojo |
|
64 | * |
|
65 | * @param mojo |
|
66 | */ |
|
67 | public void removeMojo(Mojo mojo) |
|
68 | { |
|
69 | 0 | if ( !(mojo instanceof Mojo) ) |
70 | { |
|
71 | 0 | throw new ClassCastException( "PluginMetadata.removeMojos(mojo) parameter must be instanceof " + Mojo.class.getName() ); |
72 | } |
|
73 | 0 | getMojos().remove( mojo ); |
74 | 0 | } //-- void removeMojo(Mojo) |
75 | ||
76 | /** |
|
77 | * Set The list of mojos contained in the accompanying script. |
|
78 | * |
|
79 | * @param mojos |
|
80 | */ |
|
81 | public void setMojos(java.util.List mojos) |
|
82 | { |
|
83 | 0 | this.mojos = mojos; |
84 | 0 | } //-- void setMojos(java.util.List) |
85 | ||
86 | ||
87 | 0 | private String modelEncoding = "UTF-8"; |
88 | ||
89 | public void setModelEncoding( String modelEncoding ) |
|
90 | { |
|
91 | 0 | this.modelEncoding = modelEncoding; |
92 | 0 | } |
93 | ||
94 | public String getModelEncoding() |
|
95 | { |
|
96 | 0 | return modelEncoding; |
97 | }} |