001    /*
002     =================== DO NOT EDIT THIS FILE ====================
003     Generated by Modello 1.4.1 on 2012-01-20 18:09:18,
004     any modifications will be overwritten.
005     ==============================================================
006     */
007    
008    package org.apache.maven.model;
009    
010    /**
011     * The conditions within the build runtime environment which will
012     * trigger the
013     *         automatic inclusion of the build profile.
014     * 
015     * @version $Revision$ $Date$
016     */
017    @SuppressWarnings( "all" )
018    public class Activation
019        implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
020    {
021    
022          //--------------------------/
023         //- Class/Member Variables -/
024        //--------------------------/
025    
026        /**
027         * If set to true, this profile will be active unless another
028         * profile in this
029         *             pom is activated using the command line -P
030         * option or by one of that profile's
031         *             activators.
032         */
033        private boolean activeByDefault = false;
034    
035        /**
036         * 
037         *             
038         *             Specifies that this profile will be activated
039         * when a matching JDK is detected.
040         *             For example, <code>1.4</code> only activates on
041         * JDKs versioned 1.4,
042         *             while <code>!1.4</code> matches any JDK that is
043         * not version 1.4.
044         *             
045         *           
046         */
047        private String jdk;
048    
049        /**
050         * Specifies that this profile will be activated when matching
051         * operating system
052         *             attributes are detected.
053         */
054        private ActivationOS os;
055    
056        /**
057         * Specifies that this profile will be activated when this
058         * system property is
059         *             specified.
060         */
061        private ActivationProperty property;
062    
063        /**
064         * Specifies that this profile will be activated based on
065         * existence of a file.
066         */
067        private ActivationFile file;
068    
069        /**
070         * Field locations.
071         */
072        private java.util.Map<Object, InputLocation> locations;
073    
074    
075          //-----------/
076         //- Methods -/
077        //-----------/
078    
079        /**
080         * Method clone.
081         * 
082         * @return Activation
083         */
084        public Activation clone()
085        {
086            try
087            {
088                Activation copy = (Activation) super.clone();
089    
090                if ( this.os != null )
091                {
092                    copy.os = (ActivationOS) this.os.clone();
093                }
094    
095                if ( this.property != null )
096                {
097                    copy.property = (ActivationProperty) this.property.clone();
098                }
099    
100                if ( this.file != null )
101                {
102                    copy.file = (ActivationFile) this.file.clone();
103                }
104    
105                if ( copy.locations != null )
106                {
107                    copy.locations = new java.util.LinkedHashMap( copy.locations );
108                }
109    
110                return copy;
111            }
112            catch ( java.lang.Exception ex )
113            {
114                throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
115                    + " does not support clone()" ).initCause( ex );
116            }
117        } //-- Activation clone()
118    
119        /**
120         * Get specifies that this profile will be activated based on
121         * existence of a file.
122         * 
123         * @return ActivationFile
124         */
125        public ActivationFile getFile()
126        {
127            return this.file;
128        } //-- ActivationFile getFile()
129    
130        /**
131         * Get specifies that this profile will be activated when a
132         * matching JDK is detected.
133         *             For example, <code>1.4</code> only activates on
134         * JDKs versioned 1.4,
135         *             while <code>!1.4</code> matches any JDK that is
136         * not version 1.4.
137         * 
138         * @return String
139         */
140        public String getJdk()
141        {
142            return this.jdk;
143        } //-- String getJdk()
144    
145        /**
146         * 
147         * 
148         * @param key
149         * @return InputLocation
150         */
151        public InputLocation getLocation( Object key )
152        {
153            return ( locations != null ) ? locations.get( key ) : null;
154        } //-- InputLocation getLocation( Object )
155    
156        /**
157         * Get specifies that this profile will be activated when
158         * matching operating system
159         *             attributes are detected.
160         * 
161         * @return ActivationOS
162         */
163        public ActivationOS getOs()
164        {
165            return this.os;
166        } //-- ActivationOS getOs()
167    
168        /**
169         * Get specifies that this profile will be activated when this
170         * system property is
171         *             specified.
172         * 
173         * @return ActivationProperty
174         */
175        public ActivationProperty getProperty()
176        {
177            return this.property;
178        } //-- ActivationProperty getProperty()
179    
180        /**
181         * Get if set to true, this profile will be active unless
182         * another profile in this
183         *             pom is activated using the command line -P
184         * option or by one of that profile's
185         *             activators.
186         * 
187         * @return boolean
188         */
189        public boolean isActiveByDefault()
190        {
191            return this.activeByDefault;
192        } //-- boolean isActiveByDefault()
193    
194        /**
195         * Set if set to true, this profile will be active unless
196         * another profile in this
197         *             pom is activated using the command line -P
198         * option or by one of that profile's
199         *             activators.
200         * 
201         * @param activeByDefault
202         */
203        public void setActiveByDefault( boolean activeByDefault )
204        {
205            this.activeByDefault = activeByDefault;
206        } //-- void setActiveByDefault( boolean )
207    
208        /**
209         * Set specifies that this profile will be activated based on
210         * existence of a file.
211         * 
212         * @param file
213         */
214        public void setFile( ActivationFile file )
215        {
216            this.file = file;
217        } //-- void setFile( ActivationFile )
218    
219        /**
220         * Set specifies that this profile will be activated when a
221         * matching JDK is detected.
222         *             For example, <code>1.4</code> only activates on
223         * JDKs versioned 1.4,
224         *             while <code>!1.4</code> matches any JDK that is
225         * not version 1.4.
226         * 
227         * @param jdk
228         */
229        public void setJdk( String jdk )
230        {
231            this.jdk = jdk;
232        } //-- void setJdk( String )
233    
234        /**
235         * 
236         * 
237         * @param key
238         * @param location
239         */
240        public void setLocation( Object key, InputLocation location )
241        {
242            if ( location != null )
243            {
244                if ( this.locations == null )
245                {
246                    this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
247                }
248                this.locations.put( key, location );
249            }
250        } //-- void setLocation( Object, InputLocation )
251    
252        /**
253         * Set specifies that this profile will be activated when
254         * matching operating system
255         *             attributes are detected.
256         * 
257         * @param os
258         */
259        public void setOs( ActivationOS os )
260        {
261            this.os = os;
262        } //-- void setOs( ActivationOS )
263    
264        /**
265         * Set specifies that this profile will be activated when this
266         * system property is
267         *             specified.
268         * 
269         * @param property
270         */
271        public void setProperty( ActivationProperty property )
272        {
273            this.property = property;
274        } //-- void setProperty( ActivationProperty )
275    
276    }