Java Code Examples for com.sun.tools.internal.ws.resources.WscompileMessages#WSCOMPILE_NO_SUCH_DIRECTORY
The following examples show how to use
com.sun.tools.internal.ws.resources.WscompileMessages#WSCOMPILE_NO_SUCH_DIRECTORY .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WsgenOptions.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
@Override protected int parseArguments(String[] args, int i) throws BadCommandLineException { int j = super.parseArguments(args, i); if (args[i].equals(SERVICENAME_OPTION)) { serviceName = QName.valueOf(requireArgument(SERVICENAME_OPTION, args, ++i)); if (serviceName.getNamespaceURI() == null || serviceName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_NAMESPACE(args[i])); } if (serviceName.getLocalPart() == null || serviceName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals(PORTNAME_OPTION)) { portName = QName.valueOf(requireArgument(PORTNAME_OPTION, args, ++i)); if (portName.getNamespaceURI() == null || portName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_NAMESPACE(args[i])); } if (portName.getLocalPart() == null || portName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals("-r")) { nonclassDestDir = new File(requireArgument("-r", args, ++i)); if (!nonclassDestDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(nonclassDestDir.getPath())); } return 2; } else if (args[i].startsWith("-wsdl")) { genWsdl = true; //String value = requireArgument("-wsdl", args, ++i).substring(5); String value = args[i].substring(5); int index = value.indexOf(':'); if (index == 0) { value = value.substring(1); index = value.indexOf('/'); if (index == -1) { protocol = value; } else { protocol = value.substring(0, index); } protocolSet = true; } return 1; } else if (args[i].equals("-XwsgenReport")) { // undocumented switch for the test harness wsgenReport = new File(requireArgument("-XwsgenReport", args, ++i)); return 2; } else if (args[i].equals("-Xdonotoverwrite")) { doNotOverWrite = true; return 1; } else if (args[i].equals("-inlineSchemas")) { inlineSchemas = true; return 1; } else if ("-x".equals(args[i])) { externalMetadataFiles.add(requireArgument("-x", args, ++i)); return 1; } return j; }
Example 2
Source File: Options.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** * Parses an option <code>args[i]</code> and return * the number of tokens consumed. * * @return * 0 if the argument is not understood. Returning 0 * will let the caller report an error. * @exception BadCommandLineException * If the callee wants to provide a custom message for an error. */ protected int parseArguments(String[] args, int i) throws BadCommandLineException { if (args[i].equals("-g")) { debug = true; return 1; } else if (args[i].equals("-Xdebug")) { debugMode = true; return 1; } else if (args[i].equals("-Xendorsed")) { // this option is processed much earlier, so just ignore. return 1; } else if (args[i].equals("-verbose")) { verbose = true; return 1; } else if (args[i].equals("-quiet")) { quiet = true; return 1; } else if (args[i].equals("-keep")) { keep = true; return 1; } else if (args[i].equals("-target")) { String token = requireArgument("-target", args, ++i); target = Target.parse(token); if(target == null) throw new BadCommandLineException(WscompileMessages.WSIMPORT_ILLEGAL_TARGET_VERSION(token)); return 2; } else if (args[i].equals("-classpath") || args[i].equals("-cp")) { classpath = requireArgument("-classpath", args, ++i) + File.pathSeparator + System.getProperty("java.class.path"); return 2; } else if (args[i].equals("-d")) { destDir = new File(requireArgument("-d", args, ++i)); if (!destDir.exists()) throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(destDir.getPath())); return 2; } else if (args[i].equals("-s")) { sourceDir = new File(requireArgument("-s", args, ++i)); keep = true; if (!sourceDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(sourceDir.getPath())); } return 2; } else if (args[i].equals("-extension")) { compatibilityMode = EXTENSION; return 1; } else if (args[i].startsWith("-help")) { WeAreDone done = new WeAreDone(); done.initOptions(this); throw done; } else if (args[i].equals("-Xnocompile")) { // -nocompile implies -keep. this is undocumented switch. nocompile = true; keep = true; return 1; } else if (args[i].equals("-encoding")) { encoding = requireArgument("-encoding", args, ++i); try { if (!Charset.isSupported(encoding)) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } } catch (IllegalCharsetNameException icne) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } return 2; } else if (args[i].equals("-disableXmlSecurity")) { disableXmlSecurity(); return 1; } else if (args[i].startsWith("-J")) { if (javacOptions == null) { javacOptions = new ArrayList<String>(); } javacOptions.add(args[i].substring(2)); return 1; } return 0; }
Example 3
Source File: WsgenOptions.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
@Override protected int parseArguments(String[] args, int i) throws BadCommandLineException { int j = super.parseArguments(args, i); if (args[i].equals(SERVICENAME_OPTION)) { serviceName = QName.valueOf(requireArgument(SERVICENAME_OPTION, args, ++i)); if (serviceName.getNamespaceURI() == null || serviceName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_NAMESPACE(args[i])); } if (serviceName.getLocalPart() == null || serviceName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals(PORTNAME_OPTION)) { portName = QName.valueOf(requireArgument(PORTNAME_OPTION, args, ++i)); if (portName.getNamespaceURI() == null || portName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_NAMESPACE(args[i])); } if (portName.getLocalPart() == null || portName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals("-r")) { nonclassDestDir = new File(requireArgument("-r", args, ++i)); if (!nonclassDestDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(nonclassDestDir.getPath())); } return 2; } else if (args[i].startsWith("-wsdl")) { genWsdl = true; //String value = requireArgument("-wsdl", args, ++i).substring(5); String value = args[i].substring(5); int index = value.indexOf(':'); if (index == 0) { value = value.substring(1); index = value.indexOf('/'); if (index == -1) { protocol = value; } else { protocol = value.substring(0, index); } protocolSet = true; } return 1; } else if (args[i].equals("-XwsgenReport")) { // undocumented switch for the test harness wsgenReport = new File(requireArgument("-XwsgenReport", args, ++i)); return 2; } else if (args[i].equals("-Xdonotoverwrite")) { doNotOverWrite = true; return 1; } else if (args[i].equals("-inlineSchemas")) { inlineSchemas = true; return 1; } else if ("-x".equals(args[i])) { externalMetadataFiles.add(requireArgument("-x", args, ++i)); return 1; } return j; }
Example 4
Source File: Options.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * Parses an option <code>args[i]</code> and return * the number of tokens consumed. * * @return * 0 if the argument is not understood. Returning 0 * will let the caller report an error. * @exception BadCommandLineException * If the callee wants to provide a custom message for an error. */ protected int parseArguments(String[] args, int i) throws BadCommandLineException { if (args[i].equals("-g")) { debug = true; return 1; } else if (args[i].equals("-Xdebug")) { debugMode = true; return 1; } else if (args[i].equals("-Xendorsed")) { // this option is processed much earlier, so just ignore. return 1; } else if (args[i].equals("-verbose")) { verbose = true; return 1; } else if (args[i].equals("-quiet")) { quiet = true; return 1; } else if (args[i].equals("-keep")) { keep = true; return 1; } else if (args[i].equals("-target")) { String token = requireArgument("-target", args, ++i); target = Target.parse(token); if(target == null) throw new BadCommandLineException(WscompileMessages.WSIMPORT_ILLEGAL_TARGET_VERSION(token)); return 2; } else if (args[i].equals("-classpath") || args[i].equals("-cp")) { classpath = requireArgument("-classpath", args, ++i) + File.pathSeparator + System.getProperty("java.class.path"); return 2; } else if (args[i].equals("-d")) { destDir = new File(requireArgument("-d", args, ++i)); if (!destDir.exists()) throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(destDir.getPath())); return 2; } else if (args[i].equals("-s")) { sourceDir = new File(requireArgument("-s", args, ++i)); keep = true; if (!sourceDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(sourceDir.getPath())); } return 2; } else if (args[i].equals("-extension")) { compatibilityMode = EXTENSION; return 1; } else if (args[i].startsWith("-help")) { WeAreDone done = new WeAreDone(); done.initOptions(this); throw done; } else if (args[i].equals("-Xnocompile")) { // -nocompile implies -keep. this is undocumented switch. nocompile = true; keep = true; return 1; } else if (args[i].equals("-encoding")) { encoding = requireArgument("-encoding", args, ++i); try { if (!Charset.isSupported(encoding)) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } } catch (IllegalCharsetNameException icne) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } return 2; } else if (args[i].equals("-disableXmlSecurity")) { disableXmlSecurity(); return 1; } else if (args[i].startsWith("-J")) { if (javacOptions == null) { javacOptions = new ArrayList<String>(); } javacOptions.add(args[i].substring(2)); return 1; } return 0; }
Example 5
Source File: WsgenOptions.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
@Override protected int parseArguments(String[] args, int i) throws BadCommandLineException { int j = super.parseArguments(args, i); if (args[i].equals(SERVICENAME_OPTION)) { serviceName = QName.valueOf(requireArgument(SERVICENAME_OPTION, args, ++i)); if (serviceName.getNamespaceURI() == null || serviceName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_NAMESPACE(args[i])); } if (serviceName.getLocalPart() == null || serviceName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals(PORTNAME_OPTION)) { portName = QName.valueOf(requireArgument(PORTNAME_OPTION, args, ++i)); if (portName.getNamespaceURI() == null || portName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_NAMESPACE(args[i])); } if (portName.getLocalPart() == null || portName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals("-r")) { nonclassDestDir = new File(requireArgument("-r", args, ++i)); if (!nonclassDestDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(nonclassDestDir.getPath())); } return 2; } else if (args[i].startsWith("-wsdl")) { genWsdl = true; //String value = requireArgument("-wsdl", args, ++i).substring(5); String value = args[i].substring(5); int index = value.indexOf(':'); if (index == 0) { value = value.substring(1); index = value.indexOf('/'); if (index == -1) { protocol = value; } else { protocol = value.substring(0, index); } protocolSet = true; } return 1; } else if (args[i].equals("-XwsgenReport")) { // undocumented switch for the test harness wsgenReport = new File(requireArgument("-XwsgenReport", args, ++i)); return 2; } else if (args[i].equals("-Xdonotoverwrite")) { doNotOverWrite = true; return 1; } else if (args[i].equals("-inlineSchemas")) { inlineSchemas = true; return 1; } else if ("-x".equals(args[i])) { externalMetadataFiles.add(requireArgument("-x", args, ++i)); return 1; } return j; }
Example 6
Source File: Options.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
/** * Parses an option <code>args[i]</code> and return * the number of tokens consumed. * * @return * 0 if the argument is not understood. Returning 0 * will let the caller report an error. * @exception BadCommandLineException * If the callee wants to provide a custom message for an error. */ protected int parseArguments(String[] args, int i) throws BadCommandLineException { if (args[i].equals("-g")) { debug = true; return 1; } else if (args[i].equals("-Xdebug")) { debugMode = true; return 1; } else if (args[i].equals("-Xendorsed")) { // this option is processed much earlier, so just ignore. return 1; } else if (args[i].equals("-verbose")) { verbose = true; return 1; } else if (args[i].equals("-quiet")) { quiet = true; return 1; } else if (args[i].equals("-keep")) { keep = true; return 1; } else if (args[i].equals("-target")) { String token = requireArgument("-target", args, ++i); target = Target.parse(token); if(target == null) throw new BadCommandLineException(WscompileMessages.WSIMPORT_ILLEGAL_TARGET_VERSION(token)); return 2; } else if (args[i].equals("-classpath") || args[i].equals("-cp")) { classpath = requireArgument("-classpath", args, ++i) + File.pathSeparator + System.getProperty("java.class.path"); return 2; } else if (args[i].equals("-d")) { destDir = new File(requireArgument("-d", args, ++i)); if (!destDir.exists()) throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(destDir.getPath())); return 2; } else if (args[i].equals("-s")) { sourceDir = new File(requireArgument("-s", args, ++i)); keep = true; if (!sourceDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(sourceDir.getPath())); } return 2; } else if (args[i].equals("-extension")) { compatibilityMode = EXTENSION; return 1; } else if (args[i].startsWith("-help")) { WeAreDone done = new WeAreDone(); done.initOptions(this); throw done; } else if (args[i].equals("-Xnocompile")) { // -nocompile implies -keep. this is undocumented switch. nocompile = true; keep = true; return 1; } else if (args[i].equals("-encoding")) { encoding = requireArgument("-encoding", args, ++i); try { if (!Charset.isSupported(encoding)) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } } catch (IllegalCharsetNameException icne) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } return 2; } else if (args[i].equals("-disableXmlSecurity")) { disableXmlSecurity(); return 1; } else if (args[i].startsWith("-J")) { if (javacOptions == null) { javacOptions = new ArrayList<String>(); } javacOptions.add(args[i].substring(2)); return 1; } return 0; }
Example 7
Source File: WsgenOptions.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
@Override protected int parseArguments(String[] args, int i) throws BadCommandLineException { int j = super.parseArguments(args, i); if (args[i].equals(SERVICENAME_OPTION)) { serviceName = QName.valueOf(requireArgument(SERVICENAME_OPTION, args, ++i)); if (serviceName.getNamespaceURI() == null || serviceName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_NAMESPACE(args[i])); } if (serviceName.getLocalPart() == null || serviceName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals(PORTNAME_OPTION)) { portName = QName.valueOf(requireArgument(PORTNAME_OPTION, args, ++i)); if (portName.getNamespaceURI() == null || portName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_NAMESPACE(args[i])); } if (portName.getLocalPart() == null || portName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals("-r")) { nonclassDestDir = new File(requireArgument("-r", args, ++i)); if (!nonclassDestDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(nonclassDestDir.getPath())); } return 2; } else if (args[i].startsWith("-wsdl")) { genWsdl = true; //String value = requireArgument("-wsdl", args, ++i).substring(5); String value = args[i].substring(5); int index = value.indexOf(':'); if (index == 0) { value = value.substring(1); index = value.indexOf('/'); if (index == -1) { protocol = value; } else { protocol = value.substring(0, index); } protocolSet = true; } return 1; } else if (args[i].equals("-XwsgenReport")) { // undocumented switch for the test harness wsgenReport = new File(requireArgument("-XwsgenReport", args, ++i)); return 2; } else if (args[i].equals("-Xdonotoverwrite")) { doNotOverWrite = true; return 1; } else if (args[i].equals("-inlineSchemas")) { inlineSchemas = true; return 1; } else if ("-x".equals(args[i])) { externalMetadataFiles.add(requireArgument("-x", args, ++i)); return 1; } return j; }
Example 8
Source File: Options.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * Parses an option <code>args[i]</code> and return * the number of tokens consumed. * * @return * 0 if the argument is not understood. Returning 0 * will let the caller report an error. * @exception BadCommandLineException * If the callee wants to provide a custom message for an error. */ protected int parseArguments(String[] args, int i) throws BadCommandLineException { if (args[i].equals("-g")) { debug = true; return 1; } else if (args[i].equals("-Xdebug")) { debugMode = true; return 1; } else if (args[i].equals("-Xendorsed")) { // this option is processed much earlier, so just ignore. return 1; } else if (args[i].equals("-verbose")) { verbose = true; return 1; } else if (args[i].equals("-quiet")) { quiet = true; return 1; } else if (args[i].equals("-keep")) { keep = true; return 1; } else if (args[i].equals("-target")) { String token = requireArgument("-target", args, ++i); target = Target.parse(token); if(target == null) throw new BadCommandLineException(WscompileMessages.WSIMPORT_ILLEGAL_TARGET_VERSION(token)); return 2; } else if (args[i].equals("-classpath") || args[i].equals("-cp")) { classpath = requireArgument("-classpath", args, ++i) + File.pathSeparator + System.getProperty("java.class.path"); return 2; } else if (args[i].equals("-d")) { destDir = new File(requireArgument("-d", args, ++i)); if (!destDir.exists()) throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(destDir.getPath())); return 2; } else if (args[i].equals("-s")) { sourceDir = new File(requireArgument("-s", args, ++i)); keep = true; if (!sourceDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(sourceDir.getPath())); } return 2; } else if (args[i].equals("-extension")) { compatibilityMode = EXTENSION; return 1; } else if (args[i].startsWith("-help")) { WeAreDone done = new WeAreDone(); done.initOptions(this); throw done; } else if (args[i].equals("-Xnocompile")) { // -nocompile implies -keep. this is undocumented switch. nocompile = true; keep = true; return 1; } else if (args[i].equals("-encoding")) { encoding = requireArgument("-encoding", args, ++i); try { if (!Charset.isSupported(encoding)) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } } catch (IllegalCharsetNameException icne) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } return 2; } else if (args[i].equals("-disableXmlSecurity")) { disableXmlSecurity(); return 1; } else if (args[i].startsWith("-J")) { if (javacOptions == null) { javacOptions = new ArrayList<String>(); } javacOptions.add(args[i].substring(2)); return 1; } return 0; }
Example 9
Source File: WsgenOptions.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
@Override protected int parseArguments(String[] args, int i) throws BadCommandLineException { int j = super.parseArguments(args, i); if (args[i].equals(SERVICENAME_OPTION)) { serviceName = QName.valueOf(requireArgument(SERVICENAME_OPTION, args, ++i)); if (serviceName.getNamespaceURI() == null || serviceName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_NAMESPACE(args[i])); } if (serviceName.getLocalPart() == null || serviceName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals(PORTNAME_OPTION)) { portName = QName.valueOf(requireArgument(PORTNAME_OPTION, args, ++i)); if (portName.getNamespaceURI() == null || portName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_NAMESPACE(args[i])); } if (portName.getLocalPart() == null || portName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals("-r")) { nonclassDestDir = new File(requireArgument("-r", args, ++i)); if (!nonclassDestDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(nonclassDestDir.getPath())); } return 2; } else if (args[i].startsWith("-wsdl")) { genWsdl = true; //String value = requireArgument("-wsdl", args, ++i).substring(5); String value = args[i].substring(5); int index = value.indexOf(':'); if (index == 0) { value = value.substring(1); index = value.indexOf('/'); if (index == -1) { protocol = value; } else { protocol = value.substring(0, index); } protocolSet = true; } return 1; } else if (args[i].equals("-XwsgenReport")) { // undocumented switch for the test harness wsgenReport = new File(requireArgument("-XwsgenReport", args, ++i)); return 2; } else if (args[i].equals("-Xdonotoverwrite")) { doNotOverWrite = true; return 1; } else if (args[i].equals("-inlineSchemas")) { inlineSchemas = true; return 1; } else if ("-x".equals(args[i])) { externalMetadataFiles.add(requireArgument("-x", args, ++i)); return 1; } return j; }
Example 10
Source File: Options.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * Parses an option {@code args[i]} and return * the number of tokens consumed. * * @return * 0 if the argument is not understood. Returning 0 * will let the caller report an error. * @exception BadCommandLineException * If the callee wants to provide a custom message for an error. */ protected int parseArguments(String[] args, int i) throws BadCommandLineException { if (args[i].equals("-g")) { debug = true; return 1; } else if (args[i].equals("-Xdebug")) { debugMode = true; return 1; } else if (args[i].equals("-Xendorsed")) { // this option is processed much earlier, so just ignore. return 1; } else if (args[i].equals("-verbose")) { verbose = true; return 1; } else if (args[i].equals("-quiet")) { quiet = true; return 1; } else if (args[i].equals("-keep")) { keep = true; return 1; } else if (args[i].equals("-target")) { String token = requireArgument("-target", args, ++i); target = Target.parse(token); if(target == null) throw new BadCommandLineException(WscompileMessages.WSIMPORT_ILLEGAL_TARGET_VERSION(token)); return 2; } else if (args[i].equals("-classpath") || args[i].equals("-cp")) { classpath = requireArgument("-classpath", args, ++i) + File.pathSeparator + System.getProperty("java.class.path"); return 2; } else if (args[i].equals("-d")) { destDir = new File(requireArgument("-d", args, ++i)); if (!destDir.exists()) throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(destDir.getPath())); return 2; } else if (args[i].equals("-s")) { sourceDir = new File(requireArgument("-s", args, ++i)); keep = true; if (!sourceDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(sourceDir.getPath())); } return 2; } else if (args[i].equals("-extension")) { compatibilityMode = EXTENSION; return 1; } else if (args[i].startsWith("-help")) { WeAreDone done = new WeAreDone(); done.initOptions(this); throw done; } else if (args[i].equals("-Xnocompile")) { // -nocompile implies -keep. this is undocumented switch. nocompile = true; keep = true; return 1; } else if (args[i].equals("-encoding")) { encoding = requireArgument("-encoding", args, ++i); try { if (!Charset.isSupported(encoding)) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } } catch (IllegalCharsetNameException icne) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } return 2; } else if (args[i].equals("-disableXmlSecurity")) { disableXmlSecurity(); return 1; } else if (args[i].startsWith("-J")) { if (javacOptions == null) { javacOptions = new ArrayList<String>(); } javacOptions.add(args[i].substring(2)); return 1; } return 0; }
Example 11
Source File: WsgenOptions.java From hottub with GNU General Public License v2.0 | 4 votes |
@Override protected int parseArguments(String[] args, int i) throws BadCommandLineException { int j = super.parseArguments(args, i); if (args[i].equals(SERVICENAME_OPTION)) { serviceName = QName.valueOf(requireArgument(SERVICENAME_OPTION, args, ++i)); if (serviceName.getNamespaceURI() == null || serviceName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_NAMESPACE(args[i])); } if (serviceName.getLocalPart() == null || serviceName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals(PORTNAME_OPTION)) { portName = QName.valueOf(requireArgument(PORTNAME_OPTION, args, ++i)); if (portName.getNamespaceURI() == null || portName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_NAMESPACE(args[i])); } if (portName.getLocalPart() == null || portName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals("-r")) { nonclassDestDir = new File(requireArgument("-r", args, ++i)); if (!nonclassDestDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(nonclassDestDir.getPath())); } return 2; } else if (args[i].startsWith("-wsdl")) { genWsdl = true; //String value = requireArgument("-wsdl", args, ++i).substring(5); String value = args[i].substring(5); int index = value.indexOf(':'); if (index == 0) { value = value.substring(1); index = value.indexOf('/'); if (index == -1) { protocol = value; } else { protocol = value.substring(0, index); } protocolSet = true; } return 1; } else if (args[i].equals("-XwsgenReport")) { // undocumented switch for the test harness wsgenReport = new File(requireArgument("-XwsgenReport", args, ++i)); return 2; } else if (args[i].equals("-Xdonotoverwrite")) { doNotOverWrite = true; return 1; } else if (args[i].equals("-inlineSchemas")) { inlineSchemas = true; return 1; } else if ("-x".equals(args[i])) { externalMetadataFiles.add(requireArgument("-x", args, ++i)); return 1; } return j; }
Example 12
Source File: Options.java From hottub with GNU General Public License v2.0 | 4 votes |
/** * Parses an option <code>args[i]</code> and return * the number of tokens consumed. * * @return * 0 if the argument is not understood. Returning 0 * will let the caller report an error. * @exception BadCommandLineException * If the callee wants to provide a custom message for an error. */ protected int parseArguments(String[] args, int i) throws BadCommandLineException { if (args[i].equals("-g")) { debug = true; return 1; } else if (args[i].equals("-Xdebug")) { debugMode = true; return 1; } else if (args[i].equals("-Xendorsed")) { // this option is processed much earlier, so just ignore. return 1; } else if (args[i].equals("-verbose")) { verbose = true; return 1; } else if (args[i].equals("-quiet")) { quiet = true; return 1; } else if (args[i].equals("-keep")) { keep = true; return 1; } else if (args[i].equals("-target")) { String token = requireArgument("-target", args, ++i); target = Target.parse(token); if(target == null) throw new BadCommandLineException(WscompileMessages.WSIMPORT_ILLEGAL_TARGET_VERSION(token)); return 2; } else if (args[i].equals("-classpath") || args[i].equals("-cp")) { classpath = requireArgument("-classpath", args, ++i) + File.pathSeparator + System.getProperty("java.class.path"); return 2; } else if (args[i].equals("-d")) { destDir = new File(requireArgument("-d", args, ++i)); if (!destDir.exists()) throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(destDir.getPath())); return 2; } else if (args[i].equals("-s")) { sourceDir = new File(requireArgument("-s", args, ++i)); keep = true; if (!sourceDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(sourceDir.getPath())); } return 2; } else if (args[i].equals("-extension")) { compatibilityMode = EXTENSION; return 1; } else if (args[i].startsWith("-help")) { WeAreDone done = new WeAreDone(); done.initOptions(this); throw done; } else if (args[i].equals("-Xnocompile")) { // -nocompile implies -keep. this is undocumented switch. nocompile = true; keep = true; return 1; } else if (args[i].equals("-encoding")) { encoding = requireArgument("-encoding", args, ++i); try { if (!Charset.isSupported(encoding)) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } } catch (IllegalCharsetNameException icne) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } return 2; } else if (args[i].equals("-disableXmlSecurity")) { disableXmlSecurity(); return 1; } else if (args[i].startsWith("-J")) { if (javacOptions == null) { javacOptions = new ArrayList<String>(); } javacOptions.add(args[i].substring(2)); return 1; } return 0; }
Example 13
Source File: WsgenOptions.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
@Override protected int parseArguments(String[] args, int i) throws BadCommandLineException { int j = super.parseArguments(args, i); if (args[i].equals(SERVICENAME_OPTION)) { serviceName = QName.valueOf(requireArgument(SERVICENAME_OPTION, args, ++i)); if (serviceName.getNamespaceURI() == null || serviceName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_NAMESPACE(args[i])); } if (serviceName.getLocalPart() == null || serviceName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals(PORTNAME_OPTION)) { portName = QName.valueOf(requireArgument(PORTNAME_OPTION, args, ++i)); if (portName.getNamespaceURI() == null || portName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_NAMESPACE(args[i])); } if (portName.getLocalPart() == null || portName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals("-r")) { nonclassDestDir = new File(requireArgument("-r", args, ++i)); if (!nonclassDestDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(nonclassDestDir.getPath())); } return 2; } else if (args[i].startsWith("-wsdl")) { genWsdl = true; //String value = requireArgument("-wsdl", args, ++i).substring(5); String value = args[i].substring(5); int index = value.indexOf(':'); if (index == 0) { value = value.substring(1); index = value.indexOf('/'); if (index == -1) { protocol = value; } else { protocol = value.substring(0, index); } protocolSet = true; } return 1; } else if (args[i].equals("-XwsgenReport")) { // undocumented switch for the test harness wsgenReport = new File(requireArgument("-XwsgenReport", args, ++i)); return 2; } else if (args[i].equals("-Xdonotoverwrite")) { doNotOverWrite = true; return 1; } else if (args[i].equals("-inlineSchemas")) { inlineSchemas = true; return 1; } else if ("-x".equals(args[i])) { externalMetadataFiles.add(requireArgument("-x", args, ++i)); return 1; } return j; }
Example 14
Source File: Options.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
/** * Parses an option <code>args[i]</code> and return * the number of tokens consumed. * * @return * 0 if the argument is not understood. Returning 0 * will let the caller report an error. * @exception BadCommandLineException * If the callee wants to provide a custom message for an error. */ protected int parseArguments(String[] args, int i) throws BadCommandLineException { if (args[i].equals("-g")) { debug = true; return 1; } else if (args[i].equals("-Xdebug")) { debugMode = true; return 1; } else if (args[i].equals("-Xendorsed")) { // this option is processed much earlier, so just ignore. return 1; } else if (args[i].equals("-verbose")) { verbose = true; return 1; } else if (args[i].equals("-quiet")) { quiet = true; return 1; } else if (args[i].equals("-keep")) { keep = true; return 1; } else if (args[i].equals("-target")) { String token = requireArgument("-target", args, ++i); target = Target.parse(token); if(target == null) throw new BadCommandLineException(WscompileMessages.WSIMPORT_ILLEGAL_TARGET_VERSION(token)); return 2; } else if (args[i].equals("-classpath") || args[i].equals("-cp")) { classpath = requireArgument("-classpath", args, ++i) + File.pathSeparator + System.getProperty("java.class.path"); return 2; } else if (args[i].equals("-d")) { destDir = new File(requireArgument("-d", args, ++i)); if (!destDir.exists()) throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(destDir.getPath())); return 2; } else if (args[i].equals("-s")) { sourceDir = new File(requireArgument("-s", args, ++i)); keep = true; if (!sourceDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(sourceDir.getPath())); } return 2; } else if (args[i].equals("-extension")) { compatibilityMode = EXTENSION; return 1; } else if (args[i].startsWith("-help")) { WeAreDone done = new WeAreDone(); done.initOptions(this); throw done; } else if (args[i].equals("-Xnocompile")) { // -nocompile implies -keep. this is undocumented switch. nocompile = true; keep = true; return 1; } else if (args[i].equals("-encoding")) { encoding = requireArgument("-encoding", args, ++i); try { if (!Charset.isSupported(encoding)) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } } catch (IllegalCharsetNameException icne) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } return 2; } else if (args[i].equals("-disableXmlSecurity")) { disableXmlSecurity(); return 1; } else if (args[i].startsWith("-J")) { if (javacOptions == null) { javacOptions = new ArrayList<String>(); } javacOptions.add(args[i].substring(2)); return 1; } return 0; }
Example 15
Source File: WsgenOptions.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
@Override protected int parseArguments(String[] args, int i) throws BadCommandLineException { int j = super.parseArguments(args, i); if (args[i].equals(SERVICENAME_OPTION)) { serviceName = QName.valueOf(requireArgument(SERVICENAME_OPTION, args, ++i)); if (serviceName.getNamespaceURI() == null || serviceName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_NAMESPACE(args[i])); } if (serviceName.getLocalPart() == null || serviceName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_SERVICENAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals(PORTNAME_OPTION)) { portName = QName.valueOf(requireArgument(PORTNAME_OPTION, args, ++i)); if (portName.getNamespaceURI() == null || portName.getNamespaceURI().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_NAMESPACE(args[i])); } if (portName.getLocalPart() == null || portName.getLocalPart().length() == 0) { throw new BadCommandLineException(WscompileMessages.WSGEN_PORTNAME_MISSING_LOCALNAME(args[i])); } return 2; } else if (args[i].equals("-r")) { nonclassDestDir = new File(requireArgument("-r", args, ++i)); if (!nonclassDestDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(nonclassDestDir.getPath())); } return 2; } else if (args[i].startsWith("-wsdl")) { genWsdl = true; //String value = requireArgument("-wsdl", args, ++i).substring(5); String value = args[i].substring(5); int index = value.indexOf(':'); if (index == 0) { value = value.substring(1); index = value.indexOf('/'); if (index == -1) { protocol = value; } else { protocol = value.substring(0, index); } protocolSet = true; } return 1; } else if (args[i].equals("-XwsgenReport")) { // undocumented switch for the test harness wsgenReport = new File(requireArgument("-XwsgenReport", args, ++i)); return 2; } else if (args[i].equals("-Xdonotoverwrite")) { doNotOverWrite = true; return 1; } else if (args[i].equals("-inlineSchemas")) { inlineSchemas = true; return 1; } else if ("-x".equals(args[i])) { externalMetadataFiles.add(requireArgument("-x", args, ++i)); return 1; } return j; }
Example 16
Source File: Options.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** * Parses an option <code>args[i]</code> and return * the number of tokens consumed. * * @return * 0 if the argument is not understood. Returning 0 * will let the caller report an error. * @exception BadCommandLineException * If the callee wants to provide a custom message for an error. */ protected int parseArguments(String[] args, int i) throws BadCommandLineException { if (args[i].equals("-g")) { debug = true; return 1; } else if (args[i].equals("-Xdebug")) { debugMode = true; return 1; } else if (args[i].equals("-Xendorsed")) { // this option is processed much earlier, so just ignore. return 1; } else if (args[i].equals("-verbose")) { verbose = true; return 1; } else if (args[i].equals("-quiet")) { quiet = true; return 1; } else if (args[i].equals("-keep")) { keep = true; return 1; } else if (args[i].equals("-target")) { String token = requireArgument("-target", args, ++i); target = Target.parse(token); if(target == null) throw new BadCommandLineException(WscompileMessages.WSIMPORT_ILLEGAL_TARGET_VERSION(token)); return 2; } else if (args[i].equals("-classpath") || args[i].equals("-cp")) { classpath = requireArgument("-classpath", args, ++i) + File.pathSeparator + System.getProperty("java.class.path"); return 2; } else if (args[i].equals("-d")) { destDir = new File(requireArgument("-d", args, ++i)); if (!destDir.exists()) throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(destDir.getPath())); return 2; } else if (args[i].equals("-s")) { sourceDir = new File(requireArgument("-s", args, ++i)); keep = true; if (!sourceDir.exists()) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(sourceDir.getPath())); } return 2; } else if (args[i].equals("-extension")) { compatibilityMode = EXTENSION; return 1; } else if (args[i].startsWith("-help")) { WeAreDone done = new WeAreDone(); done.initOptions(this); throw done; } else if (args[i].equals("-Xnocompile")) { // -nocompile implies -keep. this is undocumented switch. nocompile = true; keep = true; return 1; } else if (args[i].equals("-encoding")) { encoding = requireArgument("-encoding", args, ++i); try { if (!Charset.isSupported(encoding)) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } } catch (IllegalCharsetNameException icne) { throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } return 2; } else if (args[i].equals("-disableXmlSecurity")) { disableXmlSecurity(); return 1; } else if (args[i].startsWith("-J")) { if (javacOptions == null) { javacOptions = new ArrayList<String>(); } javacOptions.add(args[i].substring(2)); return 1; } return 0; }