Source Code Cross Referenced for ResolveOptions.java in  » Code-Analyzer » apache-ivy » org » apache » ivy » core » resolve » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Code Analyzer » apache ivy » org.apache.ivy.core.resolve 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         *
017:         */
018:        package org.apache.ivy.core.resolve;
019:
020:        import java.util.Date;
021:
022:        import org.apache.ivy.core.LogOptions;
023:        import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
024:        import org.apache.ivy.core.module.id.ModuleId;
025:        import org.apache.ivy.util.ConfigurationUtils;
026:        import org.apache.ivy.util.filter.Filter;
027:        import org.apache.ivy.util.filter.FilterHelper;
028:
029:        /**
030:         * A set of options used during resolve related tasks
031:         * 
032:         * @see ResolveEngine
033:         */
034:        public class ResolveOptions extends LogOptions {
035:
036:            /**
037:             * an array of configuration names to resolve - must not be null nor empty
038:             */
039:            private String[] confs = new String[] { "*" };
040:
041:            /**
042:             * the revision of the module for which dependencies should be resolved. This revision is
043:             * considered as the resolved revision of the module, unless it is null. If it is null, then a
044:             * default revision is given if necessary (no revision found in ivy file)
045:             */
046:            private String revision = null;
047:
048:            /**
049:             * the date for which the dependencies should be resolved. All obtained artifacts should have a
050:             * publication date which is before or equal to the given date. The date can be null, in which
051:             * case all artifacts will be considered
052:             */
053:            private Date date = null;
054:
055:            /**
056:             * True if validation of module descriptors should done, false otherwise
057:             */
058:            private boolean validate = true;
059:
060:            /**
061:             * True if only the cache should be used for resolve, false if a real resolve with dependency
062:             * resolvers should be done
063:             */
064:            private boolean useCacheOnly = false;
065:
066:            /**
067:             * True if the dependencies should be resolved transitively, false if only direct dependencies
068:             * should be resolved
069:             */
070:            private boolean transitive = true;
071:
072:            /**
073:             * True if the resolve should also download artifacts, false if only dependency resolution with
074:             * module descriptors should be done
075:             */
076:            private boolean download = true;
077:
078:            /**
079:             * True if a report of the resolve process should be output at the end of the process, false
080:             * otherwise
081:             */
082:            private boolean outputReport = true;
083:
084:            /**
085:             * A filter to use to avoid downloading all artifacts.
086:             */
087:            private Filter artifactFilter = FilterHelper.NO_FILTER;
088:
089:            /**
090:             * The id used to store the resolve information.
091:             */
092:            private String resolveId;
093:
094:            private boolean refresh;
095:
096:            public ResolveOptions() {
097:            }
098:
099:            public ResolveOptions(ResolveOptions options) {
100:                super (options);
101:                confs = options.confs;
102:                revision = options.revision;
103:                date = options.date;
104:                validate = options.validate;
105:                refresh = options.refresh;
106:                useCacheOnly = options.useCacheOnly;
107:                transitive = options.transitive;
108:                download = options.download;
109:                outputReport = options.outputReport;
110:                artifactFilter = options.artifactFilter;
111:                resolveId = options.resolveId;
112:            }
113:
114:            public Filter getArtifactFilter() {
115:                return artifactFilter;
116:            }
117:
118:            public ResolveOptions setArtifactFilter(Filter artifactFilter) {
119:                this .artifactFilter = artifactFilter;
120:                return this ;
121:            }
122:
123:            /**
124:             * Indicates if the configurations use a special configuration 
125:             * * , *(private) or *(public).
126:             * When special configurations are used, you must have the module
127:             * descriptor in order to get the list of configurations.
128:             * @see #getConfs()
129:             * @see #getConfs(ModuleDescriptor)
130:             */
131:            public boolean useSpecialConfs() {
132:                for (int i = 0; confs != null && i < confs.length; i++) {
133:                    if (confs[0].startsWith("*")) {
134:                        return true;
135:                    }
136:                }
137:                return false;
138:            }
139:
140:            /**
141:             * @pre can only be called if useSpecialConfs()==false.  When it is true, 
142:             * you have to provide a module desciptor so that configurations can be resolved.
143:             * @see #getConfs(ModuleDescriptor)
144:             */
145:            public String[] getConfs() {
146:                if (useSpecialConfs()) {
147:                    throw new AssertionError("ResolveOptions.getConfs() "
148:                            + "can not be used for options used special confs.");
149:                }
150:                return confs;
151:            }
152:
153:            /** 
154:             * Get the aksed confs.  Special confs (like *) use the moduleDescriptor to find the values * 
155:             * @param md Used to get the exact values for special confs. 
156:             * */
157:            public String[] getConfs(ModuleDescriptor md) {
158:                //TODO add isInline, in that case, replace * by *(public).
159:                return ConfigurationUtils.replaceWildcards(confs, md);
160:            }
161:
162:            public ResolveOptions setConfs(String[] confs) {
163:                this .confs = confs;
164:                return this ;
165:            }
166:
167:            public Date getDate() {
168:                return date;
169:            }
170:
171:            public ResolveOptions setDate(Date date) {
172:                this .date = date;
173:                return this ;
174:            }
175:
176:            public boolean isDownload() {
177:                return download;
178:            }
179:
180:            public ResolveOptions setDownload(boolean download) {
181:                this .download = download;
182:                return this ;
183:            }
184:
185:            public boolean isOutputReport() {
186:                return outputReport;
187:            }
188:
189:            public ResolveOptions setOutputReport(boolean outputReport) {
190:                this .outputReport = outputReport;
191:                return this ;
192:            }
193:
194:            public boolean isTransitive() {
195:                return transitive;
196:            }
197:
198:            public ResolveOptions setTransitive(boolean transitive) {
199:                this .transitive = transitive;
200:                return this ;
201:            }
202:
203:            public boolean isUseCacheOnly() {
204:                return useCacheOnly;
205:            }
206:
207:            public ResolveOptions setUseCacheOnly(boolean useCacheOnly) {
208:                this .useCacheOnly = useCacheOnly;
209:                return this ;
210:            }
211:
212:            public boolean isValidate() {
213:                return validate;
214:            }
215:
216:            public ResolveOptions setValidate(boolean validate) {
217:                this .validate = validate;
218:                return this ;
219:            }
220:
221:            public String getRevision() {
222:                return revision;
223:            }
224:
225:            public ResolveOptions setRevision(String revision) {
226:                this .revision = revision;
227:                return this ;
228:            }
229:
230:            public String getResolveId() {
231:                return resolveId;
232:            }
233:
234:            public ResolveOptions setResolveId(String resolveId) {
235:                this .resolveId = resolveId;
236:                return this ;
237:            }
238:
239:            public ResolveOptions setRefresh(boolean refresh) {
240:                this .refresh = refresh;
241:                return this ;
242:            }
243:
244:            public boolean isRefresh() {
245:                return refresh;
246:            }
247:
248:            public static String getDefaultResolveId(ModuleDescriptor md) {
249:                ModuleId module = md.getModuleRevisionId().getModuleId();
250:                return getDefaultResolveId(module);
251:            }
252:
253:            public static String getDefaultResolveId(ModuleId moduleId) {
254:                return moduleId.getOrganisation() + "-" + moduleId.getName();
255:            }
256:
257:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.