001    /*
002     =================== DO NOT EDIT THIS FILE ====================
003     Generated by Modello 1.4.1 on 2013-02-24 03:31:03,
004     any modifications will be overwritten.
005     ==============================================================
006     */
007    
008    package org.apache.maven.settings;
009    
010    /**
011     * 
012     *         common base class that contains code to track the source
013     * for
014     *         this instance (USER|GLOBAL)
015     *       .
016     * 
017     * @version $Revision$ $Date$
018     */
019    @SuppressWarnings( "all" )
020    public class TrackableBase
021        implements java.io.Serializable, java.lang.Cloneable
022    {
023    
024          //-----------/
025         //- Methods -/
026        //-----------/
027    
028        /**
029         * Method clone.
030         * 
031         * @return TrackableBase
032         */
033        public TrackableBase clone()
034        {
035            try
036            {
037                TrackableBase copy = (TrackableBase) super.clone();
038    
039                return copy;
040            }
041            catch ( java.lang.Exception ex )
042            {
043                throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
044                    + " does not support clone()" ).initCause( ex );
045            }
046        } //-- TrackableBase clone()
047    
048        
049                
050        public static final String USER_LEVEL = "user-level";
051        public static final String GLOBAL_LEVEL = "global-level";
052    
053        private String sourceLevel = USER_LEVEL;
054        private boolean sourceLevelSet = false;
055    
056        public void setSourceLevel( String sourceLevel )
057        {
058            if ( sourceLevelSet )
059            {
060                throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
061            }
062            else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
063            {
064                throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
065            }
066            else
067            {
068                this.sourceLevel = sourceLevel;
069                this.sourceLevelSet = true;
070            }
071        }
072    
073        public String getSourceLevel()
074        {
075            return sourceLevel;
076        }
077                
078              
079    }