Source Code Cross Referenced for CompilerOptions.java in  » Web-Services-AXIS2 » adb » org » apache » axis2 » schema » 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 » Web Services AXIS2 » adb » org.apache.axis2.schema 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one
003:         * or more contributor license agreements. See the NOTICE file
004:         * distributed with this work for additional information
005:         * regarding copyright ownership. The ASF licenses this file
006:         * to you under the Apache License, Version 2.0 (the
007:         * "License"); you may not use this file except in compliance
008:         * with the License. You may obtain a copy of the License at
009:         *
010:         * http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing,
013:         * software distributed under the License is distributed on an
014:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015:         * KIND, either express or implied. See the License for the
016:         * specific language governing permissions and limitations
017:         * under the License.
018:         */
019:        package org.apache.axis2.schema;
020:
021:        import org.apache.axis2.schema.i18n.SchemaCompilerMessages;
022:
023:        import java.io.File;
024:        import java.util.regex.Matcher;
025:        import java.util.regex.Pattern;
026:        import java.util.Map;
027:        import java.util.HashMap;
028:
029:        /**
030:         * This is a bean class that captures all the compiler options.
031:         * Right now the compiler options consist of the following
032:         * 1. output file location - A folder with necessary rights for the
033:         * schema compiler to write the files
034:         * 2.package name
035:         * 3.namespace to package map
036:         * 4.boolean flag marking whether to wrap or unwrap
037:         * 4.boolean flag marking whether to write classes or not
038:         */
039:        public class CompilerOptions {
040:
041:            /**
042:             * Generated output file
043:             */
044:            private File outputLocation;
045:            private String packageName = null;
046:            private boolean generateAll = false;
047:
048:            private boolean offStrictValidation = false;
049:
050:            /**
051:             * Package for the mapper
052:             */
053:            private String mapperClassPackage = null;
054:
055:            public String getMapperClassPackage() {
056:                return mapperClassPackage;
057:            }
058:
059:            public void setMapperClassPackage(String mapperClassPackage) {
060:                this .mapperClassPackage = mapperClassPackage;
061:            }
062:
063:            /**
064:             * get whether the mapper class package
065:             * name is present
066:             */
067:            public boolean isMapperClassPackagePresent() {
068:                return (mapperClassPackage != null && !""
069:                        .equals(mapperClassPackage));
070:            }
071:
072:            /**
073:             * The flag keeping whether seperate helpers
074:             * need to be generated or not
075:             */
076:            private boolean helperMode = false;
077:
078:            public boolean isHelperMode() {
079:                return helperMode;
080:            }
081:
082:            public void setHelperMode(boolean helperMode) {
083:                this .helperMode = helperMode;
084:            }
085:
086:            /**
087:             * Keep track of the namespace and packages mapping
088:             */
089:            private Map ns2PackageMap = new HashMap();
090:
091:            public Map getNs2PackageMap() {
092:                return ns2PackageMap;
093:            }
094:
095:            public void setNs2PackageMap(Map ns2PackageMap) {
096:                this .ns2PackageMap = ns2PackageMap;
097:            }
098:
099:            /**
100:             * This flag tells the databinder to either write the output or
101:             * not. if this is set to true it will write the output at once.
102:             * if not the outputter will populate the 
103:             */
104:            private boolean writeOutput = false;
105:
106:            /**
107:             * This flag determines whether the generated classes are wrapped or not
108:             * if the wrapper flag is true, then only a single file will be generated
109:             */
110:            private boolean wrapClasses = false;
111:
112:            public boolean isWriteOutput() {
113:                return writeOutput;
114:            }
115:
116:            public void setWriteOutput(boolean writeOutput) {
117:                this .writeOutput = writeOutput;
118:            }
119:
120:            public boolean isWrapClasses() {
121:                return wrapClasses;
122:            }
123:
124:            public void setWrapClasses(boolean wrapClasses) {
125:                this .wrapClasses = wrapClasses;
126:            }
127:
128:            public String getPackageName() {
129:                return packageName;
130:            }
131:
132:            public CompilerOptions setPackageName(String packageName) {
133:                // Validate the package name.
134:                if (packageName != null && testValue(packageName)) {
135:                    this .packageName = packageName;
136:                } else {
137:                    throw new RuntimeException(SchemaCompilerMessages
138:                            .getMessage("schema.unsupportedvalue"));
139:                }
140:                return this ;
141:            }
142:
143:            public File getOutputLocation() {
144:                return outputLocation;
145:            }
146:
147:            public CompilerOptions setOutputLocation(File outputLocation) {
148:                this .outputLocation = outputLocation;
149:                return this ;
150:            }
151:
152:            private boolean testValue(String wordToMatch) {
153:                Pattern pat = Pattern.compile("^(\\w+\\.)+$");
154:                Matcher m = pat.matcher(wordToMatch);
155:                return m.matches();
156:            }
157:
158:            public boolean isGenerateAll() {
159:                return generateAll;
160:            }
161:
162:            public void setGenerateAll(boolean generateAll) {
163:                this .generateAll = generateAll;
164:            }
165:
166:            /**
167:             * This flag determines whether the generated classes are expected to be
168:             * backword compatible with Axis 1.x
169:             */
170:            private boolean backwordCompatibilityMode = false;
171:
172:            public boolean isBackwordCompatibilityMode() {
173:                return backwordCompatibilityMode;
174:            }
175:
176:            public void setBackwordCompatibilityMode(
177:                    boolean backwordCompatibilityMode) {
178:                this .backwordCompatibilityMode = backwordCompatibilityMode;
179:            }
180:
181:            /**
182:             * Should we suppress namespace prefixes
183:             */
184:            private boolean suppressPrefixesMode = false;
185:
186:            public boolean isSuppressPrefixesMode() {
187:                return suppressPrefixesMode;
188:            }
189:
190:            public void setSuppressPrefixesMode(boolean suppressPrefixesMode) {
191:                this .suppressPrefixesMode = suppressPrefixesMode;
192:            }
193:
194:            public boolean isOffStrictValidation() {
195:                return offStrictValidation;
196:            }
197:
198:            public void setOffStrictValidation(boolean offStrictValidation) {
199:                this.offStrictValidation = offStrictValidation;
200:            }
201:
202:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.