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.wsdl.util;
020:
021: import org.apache.axis2.util.CommandLineOption;
022: import org.apache.axis2.util.CommandLineOptionConstants;
023: import org.apache.axis2.util.OptionsValidator;
024: import org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension;
025:
026: public class WSDL2JavaOptionsValidator implements
027: CommandLineOptionConstants, OptionsValidator {
028:
029: public boolean isInvalid(CommandLineOption option) {
030:
031: boolean invalid;
032: String optionType = option.getOptionType();
033:
034: if (optionType
035: .startsWith(WSDL2JavaConstants.EXTRA_OPTIONTYPE_PREFIX)) {
036: invalid = false;
037: } else {
038: invalid = !(WSDL2JavaConstants.All_PORTS_OPTION
039: .equalsIgnoreCase(optionType)
040: || WSDL2JavaConstants.All_PORTS_OPTION_LONG
041: .equalsIgnoreCase(optionType)
042: || WSDL2JavaConstants.BACKWORD_COMPATIBILITY_OPTION
043: .equalsIgnoreCase(optionType)
044: || WSDL2JavaConstants.BACKWORD_COMPATIBILITY_OPTION_LONG
045: .equalsIgnoreCase(optionType)
046: || WSDL2JavaConstants.CODEGEN_ASYNC_ONLY_OPTION
047: .equalsIgnoreCase(optionType)
048: || WSDL2JavaConstants.CODEGEN_ASYNC_ONLY_OPTION_LONG
049: .equalsIgnoreCase(optionType)
050: || WSDL2JavaConstants.CODEGEN_SYNC_ONLY_OPTION
051: .equalsIgnoreCase(optionType)
052: || WSDL2JavaConstants.CODEGEN_SYNC_ONLY_OPTION_LONG
053: .equalsIgnoreCase(optionType)
054: || WSDL2JavaConstants.DATA_BINDING_TYPE_OPTION
055: .equalsIgnoreCase(optionType)
056: || WSDL2JavaConstants.DATA_BINDING_TYPE_OPTION_LONG
057: .equalsIgnoreCase(optionType)
058: || WSDL2JavaConstants.EXTERNAL_MAPPING_OPTION
059: .equalsIgnoreCase(optionType)
060: || WSDL2JavaConstants.EXTERNAL_MAPPING_OPTION_LONG
061: .equalsIgnoreCase(optionType)
062: || WSDL2JavaConstants.FLATTEN_FILES_OPTION
063: .equalsIgnoreCase(optionType)
064: || WSDL2JavaConstants.FLATTEN_FILES_OPTION_LONG
065: .equalsIgnoreCase(optionType)
066: || WSDL2JavaConstants.GENERATE_ALL_OPTION
067: .equalsIgnoreCase(optionType)
068: || WSDL2JavaConstants.GENERATE_ALL_OPTION_LONG
069: .equalsIgnoreCase(optionType)
070: || WSDL2JavaConstants.GENERATE_SERVICE_DESCRIPTION_OPTION
071: .equalsIgnoreCase(optionType)
072: || WSDL2JavaConstants.GENERATE_SERVICE_DESCRIPTION_OPTION_LONG
073: .equalsIgnoreCase(optionType)
074: || WSDL2JavaConstants.GENERATE_TEST_CASE_OPTION
075: .equalsIgnoreCase(optionType)
076: || WSDL2JavaConstants.GENERATE_TEST_CASE_OPTION_LONG
077: .equalsIgnoreCase(optionType)
078: || WSDL2JavaConstants.NAME_SPACE_TO_PACKAGE_OPTION
079: .equalsIgnoreCase(optionType)
080: || WSDL2JavaConstants.NAME_SPACE_TO_PACKAGE_OPTION_LONG
081: .equalsIgnoreCase(optionType)
082: || WSDL2JavaConstants.NO_BUILD_XML_OPTION_LONG
083: .equalsIgnoreCase(optionType)
084: || WSDL2JavaConstants.NO_MESSAGE_RECEIVER_OPTION_LONG
085: .equalsIgnoreCase(optionType)
086: || WSDL2JavaConstants.NO_WSDLS_OPTION_LONG
087: .equalsIgnoreCase(optionType)
088: || WSDL2JavaConstants.OUTPUT_LOCATION_OPTION
089: .equalsIgnoreCase(optionType)
090: || WSDL2JavaConstants.OUTPUT_LOCATION_OPTION_LONG
091: .equalsIgnoreCase(optionType)
092: || WSDL2JavaConstants.OVERRIDE_OPTION
093: .equalsIgnoreCase(optionType)
094: || WSDL2JavaConstants.OVERRIDE_OPTION_LONG
095: .equalsIgnoreCase(optionType)
096: || WSDL2JavaConstants.PACKAGE_OPTION
097: .equalsIgnoreCase(optionType)
098: || WSDL2JavaConstants.PACKAGE_OPTION_LONG
099: .equalsIgnoreCase(optionType)
100: || WSDL2JavaConstants.PORT_NAME_OPTION
101: .equalsIgnoreCase(optionType)
102: || WSDL2JavaConstants.PORT_NAME_OPTION_LONG
103: .equalsIgnoreCase(optionType)
104: || WSDL2JavaConstants.REPOSITORY_PATH_OPTION
105: .equalsIgnoreCase(optionType)
106: || WSDL2JavaConstants.REPOSITORY_PATH_OPTION_LONG
107: .equalsIgnoreCase(optionType)
108: || WSDL2JavaConstants.RESOURCE_FOLDER_OPTION
109: .equalsIgnoreCase(optionType)
110: || WSDL2JavaConstants.RESOURCE_FOLDER_OPTION_LONG
111: .equalsIgnoreCase(optionType)
112: || WSDL2JavaConstants.SERVER_SIDE_CODE_OPTION
113: .equalsIgnoreCase(optionType)
114: || WSDL2JavaConstants.SERVER_SIDE_CODE_OPTION_LONG
115: .equalsIgnoreCase(optionType)
116: || WSDL2JavaConstants.SERVER_SIDE_INTERFACE_OPTION
117: .equalsIgnoreCase(optionType)
118: || WSDL2JavaConstants.SERVER_SIDE_INTERFACE_OPTION_LONG
119: .equalsIgnoreCase(optionType)
120: || WSDL2JavaConstants.SERVICE_NAME_OPTION
121: .equalsIgnoreCase(optionType)
122: || WSDL2JavaConstants.SERVICE_NAME_OPTION_LONG
123: .equalsIgnoreCase(optionType)
124: || WSDL2JavaConstants.SOURCE_FOLDER_NAME_OPTION
125: .equalsIgnoreCase(optionType)
126: || WSDL2JavaConstants.SOURCE_FOLDER_NAME_OPTION_LONG
127: .equalsIgnoreCase(optionType)
128: || WSDL2JavaConstants.STUB_LANGUAGE_OPTION
129: .equalsIgnoreCase(optionType)
130: || WSDL2JavaConstants.STUB_LANGUAGE_OPTION_LONG
131: .equalsIgnoreCase(optionType)
132: || WSDL2JavaConstants.SUPPRESS_PREFIXES_OPTION
133: .equalsIgnoreCase(optionType)
134: || WSDL2JavaConstants.SUPPRESS_PREFIXES_OPTION_LONG
135: .equalsIgnoreCase(optionType)
136: || WSDL2JavaConstants.UNPACK_CLASSES_OPTION
137: .equalsIgnoreCase(optionType)
138: || WSDL2JavaConstants.UNPACK_CLASSES_OPTION_LONG
139: .equalsIgnoreCase(optionType)
140: || WSDL2JavaConstants.UNWRAP_PARAMETERS
141: .equalsIgnoreCase(optionType)
142: || WSDL2JavaConstants.UNWRAP_PARAMETERS_LONG
143: .equalsIgnoreCase(optionType)
144: || WSDL2JavaConstants.WSDL_LOCATION_URI_OPTION
145: .equalsIgnoreCase(optionType)
146: || WSDL2JavaConstants.WSDL_VERSION_OPTION
147: .equalsIgnoreCase(optionType)
148: || WSDL2JavaConstants.WSDL_VERSION_OPTION_LONG
149: .equalsIgnoreCase(optionType)
150: || XMLBeansExtension.XSDCONFIG_OPTION
151: .equalsIgnoreCase(optionType) || XMLBeansExtension.XSDCONFIG_OPTION_LONG
152: .equalsIgnoreCase(optionType));
153:
154: }
155:
156: return invalid;
157: }
158:
159: }
|