Package com.sun.org.apache.xalan.internal.xsltc.compiler.util

Examples of com.sun.org.apache.xalan.internal.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() {
                    return new TransletClassLoader(ObjectFactory.findClassLoader());
                }
            });

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

      if (classCount > 1) {
          _auxClasses = new Hashtable();
      }

      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;
    }
    else {
        _auxClasses.put(_class[i].getName(), _class[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


      }
     
      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

    public void setFeature(String name, boolean value)
        throws TransformerConfigurationException {

  // feature name cannot be null
  if (name == null) {
            ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME);
          throw new NullPointerException(err.toString());
  }
  // secure processing?
  else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
      featureSecureProcessing = value;   
      // all done processing feature
      return;
  }
  else
      // unknown feature
            ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name);
            throw new TransformerConfigurationException(err.toString());
        }
    }
View Full Code Here

            StreamResult.FEATURE
        };
   
  // feature name cannot be null
  if (name == null) {
          ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
          throw new NullPointerException(err.toString());
  }

  // Inefficient, but it really does not matter in a function like this
  for (int i = 0; i < features.length; i++) {
      if (name.equals(features[i]))
View Full Code Here

    /**
     * Translate this node into JVM bytecodes.
     */
    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  ErrorMsg msg = new ErrorMsg(ErrorMsg.NOT_IMPLEMENTED_ERR,
            getClass(), this);
  getParser().reportError(FATAL, msg);
    }
View Full Code Here

  // Get the 'name attribute
  String name = getAttribute("name");

        if (name.length() > 0) {
            if (!XML11Char.isXML11ValidQName(name)) {
                ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, name, this);
                parser.reportError(Constants.ERROR, err);          
            }  
      setName(parser.getQNameIgnoreDefaultNs(name));
        }
        else
View Full Code Here

      final InputSource input = new InputSource(stream);
      input.setSystemId(url.toString());
      return compile(input, _className);
  }
  catch (IOException e) {
      _parser.reportError(Constants.FATAL, new ErrorMsg(e));
      return false;
  }
    }
View Full Code Here

      final InputSource input = new InputSource(stream);
      input.setSystemId(url.toString());
      return compile(input, name);
  }
  catch (IOException e) {
      _parser.reportError(Constants.FATAL, new ErrorMsg(e));
      return false;
  }
    }
View Full Code Here

    }
      }
  }
  catch (Exception e) {
      /*if (_debug)*/ e.printStackTrace();
      _parser.reportError(Constants.FATAL, new ErrorMsg(e));
  }
  catch (Error e) {
      if (_debug) e.printStackTrace();
      _parser.reportError(Constants.FATAL, new ErrorMsg(e));
  }
  finally {
      _reader = null; // reset this here to be sure it is not re-used
  }
  return !_parser.errorsFound();
View Full Code Here

  return Type.Void;
    }

    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  final Parser parser = getParser();
  final ErrorMsg err = new ErrorMsg(ErrorMsg.STRAY_OTHERWISE_ERR, this);
  parser.reportError(Constants.ERROR, err);
    }
View Full Code Here

TOP

Related Classes of com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg

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.