net.sf.saxon.Query.badUsage()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(336)

本文整理了Java中net.sf.saxon.Query.badUsage方法的一些代码示例,展示了Query.badUsage的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.badUsage方法的具体详情如下:
包路径:net.sf.saxon.Query
类名称:Query
方法名:badUsage

Query.badUsage介绍

[英]Report incorrect usage of the command line, with a list of the options and arguments that are available
[中]报告命令行的错误使用,并列出可用的选项和参数

代码示例

代码示例来源:origin: net.sourceforge.saxon/saxon

  1. badUsage(command, "-backup option must be -backup:on or -backup:off");
  2. if (value == null) {
  3. if (args.length < i + 2) {
  4. badUsage(command, "No resolver after -cr");
  5. } else if (option.equals("dtd")) {
  6. if (!("on".equals(value) || "off".equals(value))) {
  7. badUsage(command, "-dtd option must be -dtd:on or -dtd:off");
  8. } else if (option.equals("expand")) {
  9. if (!("on".equals(value) || "off".equals(value))) {
  10. badUsage(command, "-expand option must be 'on' or 'off'");
  11. } else if (option.equals("ext")) {
  12. if (!("on".equals(value) || "off".equals(value))) {
  13. badUsage(command, "-ext option must be -ext:on or -ext:off");
  14. } else if (option.equals("l")) {
  15. if (!(value == null || "on".equals(value) || "off".equals(value))) {
  16. badUsage(command, "-l option must be -l:on or -l:off");
  17. if (value == null) {
  18. if (args.length < i + 2) {
  19. badUsage(command, "No resolver after -cr");
  20. if (value == null) {
  21. if (args.length < i + 2) {
  22. badUsage(command, "No output file name after -o");

代码示例来源:origin: org.opengis.cite.saxon/saxon9

  1. if (value == null) {
  2. if (args.length < i + 2) {
  3. badUsage(command, "No resolver after -cr");
  4. } else if (option.equals("dtd")) {
  5. if (!("on".equals(value) || "off".equals(value))) {
  6. badUsage(command, "-dtd option must be -dtd:on or -dtd:off");
  7. } else if (option.equals("expand")) {
  8. if (!("on".equals(value) || "off".equals(value))) {
  9. badUsage(command, "-expand option must be 'on' or 'off'");
  10. } else if (option.equals("ext")) {
  11. if (!("on".equals(value) || "off".equals(value))) {
  12. badUsage(command, "-ext option must be -ext:on or -ext:off");
  13. } else if (option.equals("l")) {
  14. if (!(value == null || "on".equals(value) || "off".equals(value))) {
  15. badUsage(command, "-l option must be -l:on or -l:off");
  16. if (value == null) {
  17. if (args.length < i + 2) {
  18. badUsage(command, "No resolver after -cr");
  19. if (value == null) {
  20. if (args.length < i + 2) {
  21. badUsage(command, "No output file name after -o");
  22. if (schemaAware) {

代码示例来源:origin: net.sf.saxon/Saxon-HE

  1. private void makeXQueryTraceListener(CommandLineOptions options) {
  2. XQueryTraceListener listener = new XQueryTraceListener();
  3. String value = options.getOptionValue("Tout");
  4. if (value != null) {
  5. try {
  6. listener.setOutputDestination(new StandardLogger(new PrintStream(value)));
  7. } catch (FileNotFoundException e) {
  8. badUsage("Cannot write to " + value);
  9. }
  10. }
  11. value = options.getOptionValue("Tlevel");
  12. if (value != null) {
  13. switch (value) {
  14. case "none":
  15. listener.setLevelOfDetail(0);
  16. break;
  17. case "low":
  18. listener.setLevelOfDetail(1);
  19. break;
  20. case "normal":
  21. listener.setLevelOfDetail(2);
  22. break;
  23. case "high":
  24. listener.setLevelOfDetail(3);
  25. break;
  26. }
  27. }
  28. config.setTraceListener(listener);
  29. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

  1. private void makeXQueryTraceListener(CommandLineOptions options) {
  2. XQueryTraceListener listener = new XQueryTraceListener();
  3. String value = options.getOptionValue("Tout");
  4. if (value != null) {
  5. try {
  6. listener.setOutputDestination(new StandardLogger(new PrintStream(value)));
  7. } catch (FileNotFoundException e) {
  8. badUsage("Cannot write to " + value);
  9. }
  10. }
  11. value = options.getOptionValue("Tlevel");
  12. if (value != null) {
  13. switch (value) {
  14. case "none":
  15. listener.setLevelOfDetail(0);
  16. break;
  17. case "low":
  18. listener.setLevelOfDetail(1);
  19. break;
  20. case "normal":
  21. listener.setLevelOfDetail(2);
  22. break;
  23. case "high":
  24. listener.setLevelOfDetail(3);
  25. break;
  26. }
  27. }
  28. config.setTraceListener(listener);
  29. }

代码示例来源:origin: net.sf.saxon/Saxon-HE

  1. closeTraceDestination = true;
  2. } catch (FileNotFoundException e) {
  3. badUsage("Trace output file " + value + " cannot be created");
  4. new StandardLogger(new File(value)));
  5. } catch (FileNotFoundException e) {
  6. badUsage("Trace output file " + value + " cannot be created");
  7. badUsage("");
  8. badUsage("No query file name");
  9. badUsage("Unrecognized option: " + positional.get(currentPositionalOption));

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

  1. closeTraceDestination = true;
  2. } catch (FileNotFoundException e) {
  3. badUsage("Trace output file " + value + " cannot be created");
  4. new StandardLogger(new File(value)));
  5. } catch (FileNotFoundException e) {
  6. badUsage("Trace output file " + value + " cannot be created");
  7. badUsage("");
  8. badUsage("No query file name");
  9. badUsage("Unrecognized option: " + positional.get(currentPositionalOption));

代码示例来源:origin: org.opengis.cite.saxon/saxon9

  1. Object mr = config.getInstance(moduleURIResolverClass, null);
  2. if (!(mr instanceof ModuleURIResolver)) {
  3. badUsage(command, moduleURIResolverClass + " is not a ModuleURIResolver");

代码示例来源:origin: net.sourceforge.saxon/saxon

  1. Object mr = config.getInstance(moduleURIResolverClass, null);
  2. if (!(mr instanceof ModuleURIResolver)) {
  3. badUsage(command, moduleURIResolverClass + " is not a ModuleURIResolver");

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

  1. Object mr = config.getInstance(moduleURIResolverClass, null);
  2. if (!(mr instanceof ModuleURIResolver)) {
  3. badUsage(moduleURIResolverClass + " is not a ModuleURIResolver");

代码示例来源:origin: net.sf.saxon/Saxon-HE

  1. Object mr = config.getInstance(moduleURIResolverClass, null);
  2. if (!(mr instanceof ModuleURIResolver)) {
  3. badUsage(moduleURIResolverClass + " is not a ModuleURIResolver");

相关文章