KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > maven > settings > RuntimeInfo


1 package org.apache.maven.settings;
2
3 import java.io.File JavaDoc;
4 import java.util.HashMap JavaDoc;
5 import java.util.Map JavaDoc;
6
7 /*
8  * Copyright 2001-2005 The Apache Software Foundation.
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */

22
23 public class RuntimeInfo
24 {
25
26     private File JavaDoc file;
27     
28     // using Boolean for 3VL (null for not-set, otherwise override with value)
29
private Boolean JavaDoc pluginUpdateForced;
30     
31     // using Boolean for 3VL (null, true-to-all, false-to-all)
32
private Boolean JavaDoc applyToAllPluginUpdates;
33     
34 // private boolean pluginRegistryActive = true;
35

36     // using Boolean for 3VL (null for not-set, otherwise override with value)
37
// private Boolean checkLatest;
38

39     private Map JavaDoc activeProfileToSourceLevel = new HashMap JavaDoc();
40     
41     private String JavaDoc localRepositorySourceLevel = TrackableBase.USER_LEVEL;
42     
43     private Map JavaDoc pluginGroupIdSourceLevels = new HashMap JavaDoc();
44     
45     private final Settings settings;
46
47     public RuntimeInfo( Settings settings )
48     {
49         this.settings = settings;
50     }
51     
52     public void setFile( File JavaDoc file )
53     {
54         this.file = file;
55     }
56     
57     public File JavaDoc getFile()
58     {
59         return file;
60     }
61     
62     public void setPluginUpdateOverride( Boolean JavaDoc pluginUpdateForced )
63     {
64         this.pluginUpdateForced = pluginUpdateForced;
65     }
66     
67     public Boolean JavaDoc getPluginUpdateOverride()
68     {
69         return pluginUpdateForced;
70     }
71
72     public Boolean JavaDoc getApplyToAllPluginUpdates()
73     {
74         return applyToAllPluginUpdates;
75     }
76
77     public void setApplyToAllPluginUpdates( Boolean JavaDoc applyToAll )
78     {
79         this.applyToAllPluginUpdates = applyToAll;
80     }
81     
82     public void setActiveProfileSourceLevel( String JavaDoc activeProfile, String JavaDoc sourceLevel )
83     {
84         activeProfileToSourceLevel.put( activeProfile, sourceLevel );
85     }
86     
87     public String JavaDoc getSourceLevelForActiveProfile( String JavaDoc activeProfile )
88     {
89         String JavaDoc sourceLevel = (String JavaDoc) activeProfileToSourceLevel.get( activeProfile );
90         
91         if ( sourceLevel != null )
92         {
93             return sourceLevel;
94         }
95         else
96         {
97             return settings.getSourceLevel();
98         }
99     }
100     
101     public void setPluginGroupIdSourceLevel( String JavaDoc pluginGroupId, String JavaDoc sourceLevel )
102     {
103         pluginGroupIdSourceLevels.put( pluginGroupId, sourceLevel );
104     }
105     
106     public String JavaDoc getSourceLevelForPluginGroupId( String JavaDoc pluginGroupId )
107     {
108         String JavaDoc sourceLevel = (String JavaDoc) pluginGroupIdSourceLevels.get( pluginGroupId );
109         
110         if ( sourceLevel != null )
111         {
112             return sourceLevel;
113         }
114         else
115         {
116             return settings.getSourceLevel();
117         }
118     }
119     
120     public void setLocalRepositorySourceLevel( String JavaDoc localRepoSourceLevel )
121     {
122         this.localRepositorySourceLevel = localRepoSourceLevel;
123     }
124     
125     public String JavaDoc getLocalRepositorySourceLevel()
126     {
127         return localRepositorySourceLevel;
128     }
129     
130 }
131
Popular Tags