Package org.apache.xalan.xsltc.cmdline.getopt

Examples of org.apache.xalan.xsltc.cmdline.getopt.GetOpt


    try {
      if (args.length == 0) {
        throw new Exception("no arguments specified.");
      }

      GetOpt getopt = new GetOpt(args, "i:s:h");
      while ( (c = getopt.getNextOption()) != -1) {
        switch (c) {
          case 'i':
            this.inputFile = getopt.getOptionArg();
            File f = new File(this.inputFile);
            if (!f.exists())
              usage("input file missing: " + this.inputFile);
            break;
          case 's':
            this.schemaFile = getopt.getOptionArg();
            File s = new File(this.schemaFile);
            break;
          case 'h':
            usage(null);
            break;
View Full Code Here


    public static void main(String[] args) {
  try {
      boolean inputIsURL = false;
      boolean useStdIn = false;
      boolean classNameSet = false;
      final GetOpt getopt = new GetOpt(args, "o:d:j:p:uxhsinv");
      if (args.length < 1) printUsage();

      final XSLTC xsltc = new XSLTC();
      xsltc.init();

      int c;
      while ((c = getopt.getNextOption()) != -1) {
    switch(c) {
    case 'i':
        useStdIn = true;
        break;
    case 'o':
        xsltc.setClassName(getopt.getOptionArg());
        classNameSet = true;
        break;
    case 'd':
        xsltc.setDestDirectory(getopt.getOptionArg());
        break;
    case 'p':
        xsltc.setPackageName(getopt.getOptionArg());
        break;
    case 'j'
        xsltc.setJarFileName(getopt.getOptionArg());
        break;
    case 'x':
        xsltc.setDebug(true);
        break;
    case 'u':
        inputIsURL = true;
        break;
    case 'n':
        xsltc.setTemplateInlining(true)// used to be 'false'
        break;
    case 'v':
        // fall through to case h
    case 'h':
    default:
        printUsage();
        break;
    }
      }

      boolean compileOK;

      if (useStdIn) {
    if (!classNameSet) {
        System.err.println(new ErrorMsg(ErrorMsg.COMPILE_STDIN_ERR));
    }
    compileOK = xsltc.compile(System.in, xsltc.getClassName());
      }
      else {
    // Generate a vector containg URLs for all stylesheets specified
    final String[] stylesheetNames = getopt.getCmdArgs();
    final Vector   stylesheetVector = new Vector();
    for (int i = 0; i < stylesheetNames.length; i++) {
        final String name = stylesheetNames[i];
        URL url;
        if (inputIsURL)
View Full Code Here

    public static void main(String[] args) {
  try {
      boolean inputIsURL = false;
      boolean useStdIn = false;
      boolean classNameSet = false;
      final GetOpt getopt = new GetOpt(args, "o:d:j:p:uxhsinv");
      if (args.length < 1) printUsage();

      final XSLTC xsltc = new XSLTC();
      xsltc.init();

      int c;
      while ((c = getopt.getNextOption()) != -1) {
    switch(c) {
    case 'i':
        useStdIn = true;
        break;
    case 'o':
        xsltc.setClassName(getopt.getOptionArg());
        classNameSet = true;
        break;
    case 'd':
        xsltc.setDestDirectory(getopt.getOptionArg());
        break;
    case 'p':
        xsltc.setPackageName(getopt.getOptionArg());
        break;
    case 'j'
        xsltc.setJarFileName(getopt.getOptionArg());
        break;
    case 'x':
        xsltc.setDebug(true);
        break;
    case 'u':
        inputIsURL = true;
        break;
    case 'n':
        xsltc.setTemplateInlining(true)// used to be 'false'
        break;
    case 'v':
        // fall through to case h
    case 'h':
    default:
        printUsage();
        break;
    }
      }

      boolean compileOK;

      if (useStdIn) {
    if (!classNameSet) {
        System.err.println(new ErrorMsg(ErrorMsg.COMPILE_STDIN_ERR));
    }
    compileOK = xsltc.compile(System.in, xsltc.getClassName());
      }
      else {
    // Generate a vector containg URLs for all stylesheets specified
    final String[] stylesheetNames = getopt.getCmdArgs();
    final Vector   stylesheetVector = new Vector();
    for (int i = 0; i < stylesheetNames.length; i++) {
        final String name = stylesheetNames[i];
        URL url;
        if (inputIsURL)
View Full Code Here

    public static void main(String[] args) {
  try {
      boolean inputIsURL = false;
      boolean useStdIn = false;
      boolean classNameSet = false;
      final GetOpt getopt = new GetOpt(args, "o:d:j:p:uxhsinv");
      if (args.length < 1) printUsage();

      final XSLTC xsltc = new XSLTC();
      xsltc.init();

      int c;
      while ((c = getopt.getNextOption()) != -1) {
    switch(c) {
    case 'i':
        useStdIn = true;
        break;
    case 'o':
        xsltc.setClassName(getopt.getOptionArg());
        classNameSet = true;
        break;
    case 'd':
        xsltc.setDestDirectory(getopt.getOptionArg());
        break;
    case 'p':
        xsltc.setPackageName(getopt.getOptionArg());
        break;
    case 'j'
        xsltc.setJarFileName(getopt.getOptionArg());
        break;
    case 'x':
        xsltc.setDebug(true);
        break;
    case 'u':
        inputIsURL = true;
        break;
    case 'n':
        xsltc.setTemplateInlining(true)// used to be 'false'
        break;
    case 'v':
        // fall through to case h
    case 'h':
    default:
        printUsage();
        break;
    }
      }

      boolean compileOK;

      if (useStdIn) {
    if (!classNameSet) {
        System.err.println(new ErrorMsg(ErrorMsg.COMPILE_STDIN_ERR));
    }
    compileOK = xsltc.compile(System.in, xsltc.getClassName());
      }
      else {
    // Generate a vector containg URLs for all stylesheets specified
    final String[] stylesheetNames = getopt.getCmdArgs();
    final Vector   stylesheetVector = new Vector();
    for (int i = 0; i < stylesheetNames.length; i++) {
        final String name = stylesheetNames[i];
        URL url;
        if (inputIsURL)
View Full Code Here

    public static void main(String[] args) {
  try {
      boolean inputIsURL = false;
      boolean useStdIn = false;
      boolean classNameSet = false;
      final GetOpt getopt = new GetOpt(args, "o:d:j:p:uxhsinv");
      if (args.length < 1) printUsage();

      final XSLTC xsltc = new XSLTC();
      xsltc.init();

      int c;
      while ((c = getopt.getNextOption()) != -1) {
    switch(c) {
    case 'i':
        useStdIn = true;
        break;
    case 'o':
        xsltc.setClassName(getopt.getOptionArg());
        classNameSet = true;
        break;
    case 'd':
        xsltc.setDestDirectory(getopt.getOptionArg());
        break;
    case 'p':
        xsltc.setPackageName(getopt.getOptionArg());
        break;
    case 'j'
        xsltc.setJarFileName(getopt.getOptionArg());
        break;
    case 'x':
        xsltc.setDebug(true);
        break;
    case 'u':
        inputIsURL = true;
        break;
    case 's':
        _allowExit = false;
        break;
    case 'n':
        xsltc.setTemplateInlining(true)// used to be 'false'
        break;
    case 'v':
        // fall through to case h
    case 'h':
    default:
        printUsage();
        break;
    }
      }

      boolean compileOK;

      if (useStdIn) {
    if (!classNameSet) {
        System.err.println(new ErrorMsg(ErrorMsg.COMPILE_STDIN_ERR));
        if (_allowExit) System.exit(-1);
    }
    compileOK = xsltc.compile(System.in, xsltc.getClassName());
      }
      else {
    // Generate a vector containg URLs for all stylesheets specified
    final String[] stylesheetNames = getopt.getCmdArgs();
    final Vector   stylesheetVector = new Vector();
    for (int i = 0; i < stylesheetNames.length; i++) {
        final String name = stylesheetNames[i];
        URL url;
        if (inputIsURL)
View Full Code Here

    public static void main(String[] args) {
  try {
      boolean inputIsURL = false;
      boolean useStdIn = false;
      boolean classNameSet = false;
      final GetOpt getopt = new GetOpt(args, "o:d:j:p:uxhsinv");
      if (args.length < 1) printUsage();

      final XSLTC xsltc = new XSLTC();
      xsltc.init();

      int c;
      while ((c = getopt.getNextOption()) != -1) {
    switch(c) {
    case 'i':
        useStdIn = true;
        break;
    case 'o':
        xsltc.setClassName(getopt.getOptionArg());
        classNameSet = true;
        break;
    case 'd':
        xsltc.setDestDirectory(getopt.getOptionArg());
        break;
    case 'p':
        xsltc.setPackageName(getopt.getOptionArg());
        break;
    case 'j'
        xsltc.setJarFileName(getopt.getOptionArg());
        break;
    case 'x':
        xsltc.setDebug(true);
        break;
    case 'u':
        inputIsURL = true;
        break;
    case 's':
        _allowExit = false;
        break;
    case 'n':
        xsltc.setTemplateInlining(true)// used to be 'false'
        break;
    case 'v':
        // fall through to case h
    case 'h':
    default:
        printUsage();
        break;
    }
      }

      boolean compileOK;

      if (useStdIn) {
    if (!classNameSet) {
        System.err.println(new ErrorMsg(ErrorMsg.COMPILE_STDIN_ERR));
        if (_allowExit) System.exit(-1);
    }
    compileOK = xsltc.compile(System.in, xsltc.getClassName());
      }
      else {
    // Generate a vector containg URLs for all stylesheets specified
    final String[] stylesheetNames = getopt.getCmdArgs();
    final Vector   stylesheetVector = new Vector();
    for (int i = 0; i < stylesheetNames.length; i++) {
        final String name = stylesheetNames[i];
        URL url;
        if (inputIsURL)
View Full Code Here

TOP

Related Classes of org.apache.xalan.xsltc.cmdline.getopt.GetOpt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.