Examples of ErrorMsg


Examples of org.apache.xalan.xsltc.compiler.util.ErrorMsg

    }

    // or try to get just a systemId string from Result object
    String systemId = result.getSystemId();
    if (systemId == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_RESULT_ERR);
                    throw new TransformerException(err.toString());
    }

    // System Id may be in one of several forms, (1) a uri
    // that starts with 'file:', (2) uri that starts with 'http:'
    // or (3) just a filename on the local system.
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ErrorMsg

    }
    else if (_sourceSystemId != null) {
        input = new InputSource(_sourceSystemId);
    }
    else {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR);
        throw new TransformerException(err.toString());
    }

    // Parse the input and build the internal DOM
    reader.parse(input);
    dom.setDocumentURI(_sourceSystemId);
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ErrorMsg

     */
    private void defineTransletClasses()
  throws TransformerConfigurationException {

  if (_bytecodes == null) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.NO_TRANSLET_CLASS_ERR);
      throw new TransformerConfigurationException(err.toString());
  }

  TransletClassLoader loader =
      (TransletClassLoader) AccessController.doPrivileged(
    new PrivilegedAction() {
      public Object run() {
          /*
           * Get the loader from the current thread instead of
           * the class. This is important for translets that load
           * external Java classes and run in multi-threaded envs.
           */
          return new TransletClassLoader(
        Thread.currentThread().getContextClassLoader());
      }
        }
    );

  try {
      final int classCount = _bytecodes.length;
      _class = new Class[classCount];

      for (int i = 0; i < classCount; i++) {
    _class[i] = loader.defineClass(_bytecodes[i]);
    final Class superClass = _class[i].getSuperclass();

    // Check if this is the main class
    if (superClass.getName().equals(ABSTRACT_TRANSLET)) {
        _transletIndex = i;
    }
      }

      if (_transletIndex < 0) {
    ErrorMsg err= new ErrorMsg(ErrorMsg.NO_MAIN_TRANSLET_ERR, _name);
    throw new TransformerConfigurationException(err.toString());
      }
  }
  catch (ClassFormatError e) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name);
      throw new TransformerConfigurationException(err.toString());
  }
  catch (LinkageError e) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name);
      throw new TransformerConfigurationException(err.toString());
  }
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ErrorMsg

    }
      }
      return translet;
  }
  catch (InstantiationException e) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name);
      throw new TransformerConfigurationException(err.toString());
  }
  catch (IllegalAccessException e) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name);
      throw new TransformerConfigurationException(err.toString());
  }
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ErrorMsg

             e.getMessage());
      if (_allowExit) System.exit(-1);
  }
  catch (FileNotFoundException e) {
      if (_debug) e.printStackTrace();
      ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_NOT_FOUND_ERR, _fileName);
      System.err.println(ErrorMsg.getTransletErrorMessage()+
             err.toString());
      if (_allowExit) System.exit(-1);
  }
  catch (MalformedURLException e) {
      if (_debug) e.printStackTrace();
      ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName);
      System.err.println(ErrorMsg.getTransletErrorMessage()+
             err.toString());
      if (_allowExit) System.exit(-1);
  }
  catch (ClassNotFoundException e) {
      if (_debug) e.printStackTrace();
      ErrorMsg err= new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR,_className);
      System.err.println(ErrorMsg.getTransletErrorMessage()+
             err.toString());
      if (_allowExit) System.exit(-1);
  }
        catch (UnknownHostException e) {
      if (_debug) e.printStackTrace();
      ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName);
      System.err.println(ErrorMsg.getTransletErrorMessage()+
             err.toString());
      if (_allowExit) System.exit(-1);
        }
  catch (SAXException e) {
      Exception ex = e.getException();
      if (_debug) {
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ErrorMsg

      if (_allowExit) System.exit(-1);
  }
    }

    public static void printUsage() {
  System.err.println(new ErrorMsg(ErrorMsg.TRANSFORM_USAGE_STR));
  if (_allowExit) System.exit(-1);
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ErrorMsg

    public static void printUsage() {
        StringBuffer vers = new StringBuffer("XSLTC version " +
      VERSION_MAJOR + "." + VERSION_MINOR +
      ((VERSION_DELTA > 0) ? ("."+VERSION_DELTA) : ("")));
  System.err.println(vers + "\n" +
    new ErrorMsg(ErrorMsg.COMPILE_USAGE_STR));
  if (_allowExit) System.exit(-1);
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ErrorMsg

      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 {
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ErrorMsg

      theCurrentOption = (Option)theOptionsIterator.next();
      char c = theCurrentOption.getArgLetter();
      boolean shouldHaveArg = theOptionMatcher.hasArg(c);
      String arg = theCurrentOption.getArgument();
      if(!theOptionMatcher.match(c)) {
                ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR,
                                            new Character(c));
    throw (new IllegalArgumentException(msg.toString()));
      }
      else if(shouldHaveArg && (arg == null)) {
                ErrorMsg msg = new ErrorMsg(ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR,
                                            new Character(c));
    throw (new MissingOptArgException(msg.toString()));
      }
      retval = c;
  }
  return retval;
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.compiler.util.ErrorMsg

     */
    public void setErrorListener(ErrorListener listener)
  throws IllegalArgumentException
    {
  if (listener == null) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.ERROR_LISTENER_NULL_ERR,
          "TransformerFactory");
            throw new IllegalArgumentException(err.toString());
  }
  _errorListener = listener;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.