View Javadoc

1   package org.codehaus.modello.plugin.java.metadata;
2   
3   /*
4    * Copyright (c) 2004, Codehaus.org
5    *
6    * Permission is hereby granted, free of charge, to any person obtaining a copy of
7    * this software and associated documentation files (the "Software"), to deal in
8    * the Software without restriction, including without limitation the rights to
9    * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10   * of the Software, and to permit persons to whom the Software is furnished to do
11   * so, subject to the following conditions:
12   *
13   * The above copyright notice and this permission notice shall be included in all
14   * copies or substantial portions of the Software.
15   *
16   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22   * SOFTWARE.
23   */
24  
25  import java.util.ArrayList;
26  import java.util.List;
27  
28  import org.codehaus.modello.metadata.ClassMetadata;
29  
30  /**
31   * @author <a href="mailto:evenisse@codehaus.org">Emmanuel Venisse</a>
32   */
33  public class JavaClassMetadata
34      implements ClassMetadata
35  {
36      public static final String ID = JavaClassMetadata.class.getName();
37  
38      public static final String CLONE_NONE = "none";
39      public static final String CLONE_SHALLOW = "shallow";
40      public static final String CLONE_DEEP = "deep";
41  
42      public static final List<String> CLONE_MODES;
43  
44      static
45      {
46          CLONE_MODES = new ArrayList<String>();
47          CLONE_MODES.add( CLONE_NONE );
48          CLONE_MODES.add( CLONE_SHALLOW );
49          CLONE_MODES.add( CLONE_DEEP );
50      }
51  
52      private boolean abstractMode;
53  
54      private boolean enabled;
55  
56      private String cloneMode;
57  
58      private String cloneHook;
59  
60      /**
61       * @since 1.8
62       */
63      private boolean generateToString = false;
64  
65      /**
66       * @since 1.8
67       */
68      private boolean generateBuilder = false;
69  
70      /**
71       * @since 1.8
72       */
73      private boolean generateStaticCreators = false;
74  
75      public void setAbstract( boolean abstractMode )
76      {
77          this.abstractMode = abstractMode;
78      }
79  
80      public boolean isAbstract()
81      {
82          return abstractMode;
83      }
84  
85      public boolean isEnabled()
86      {
87          return enabled;
88      }
89  
90      public void setEnabled( boolean generate )
91      {
92          this.enabled = generate;
93      }
94  
95      public String getCloneMode()
96      {
97          return cloneMode;
98      }
99  
100     public void setCloneMode( String cloneMode )
101     {
102         this.cloneMode = cloneMode;
103     }
104 
105     public String getCloneHook()
106     {
107         return cloneHook;
108     }
109 
110     public void setCloneHook( String cloneHook )
111     {
112         this.cloneHook = cloneHook;
113     }
114 
115     public boolean isGenerateToString()
116     {
117         return generateToString;
118     }
119 
120     public void setGenerateToString( boolean generateToString )
121     {
122         this.generateToString = generateToString;
123     }
124 
125     public boolean isGenerateBuilder()
126     {
127         return generateBuilder;
128     }
129 
130     public void setGenerateBuilder( boolean generateBuilder )
131     {
132         this.generateBuilder = generateBuilder;
133     }
134 
135     public boolean isGenerateStaticCreators()
136     {
137         return generateStaticCreators;
138     }
139 
140     public void setGenerateStaticCreators( boolean generateStaticCreators )
141     {
142         this.generateStaticCreators = generateStaticCreators;
143     }
144 
145 }