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

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


    /**
     * 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


    }
     
    return typeCheckExternal(stable);
      }
      catch (TypeCheckError e) {
    ErrorMsg errorMsg = e.getErrorMsg();
    if (errorMsg == null) {
        final String name = _fname.getLocalPart();
        errorMsg = new ErrorMsg(ErrorMsg.METHOD_NOT_FOUND_ERR, name);
    }
    getParser().reportError(ERROR, errorMsg);
    return _type = Type.Void;
      }
    }
View Full Code Here

        if (_clazz == null) {
                _clazz = ObjectFactory.findProviderClass(
                  _className, ObjectFactory.findClassLoader(), true);

    if (_clazz == null) {
      final ErrorMsg msg =
            new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className);
      getParser().reportError(Constants.ERROR, msg);
    }
        }

        final String methodName = _fname.getLocalPart();
        final Method[] methods = _clazz.getMethods();

        for (int i = 0; i < methods.length; i++) {
    final int mods = methods[i].getModifiers();
    // Is it public and same number of args ?
    if (Modifier.isPublic(mods)
        && methods[i].getName().equals(methodName)
        && methods[i].getParameterTypes().length == nArgs)
    {
      if (result == null) {
        result = new Vector();
            }
      result.addElement(methods[i]);
    }
        }
      }
      catch (ClassNotFoundException e) {
      final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className);
      getParser().reportError(Constants.ERROR, msg);
      }
    }
    return result;
    }
View Full Code Here

          if (_clazz == null) {
            _clazz = ObjectFactory.findProviderClass(
              _className, ObjectFactory.findClassLoader(), true);

            if (_clazz == null) {
              final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className);
              getParser().reportError(Constants.ERROR, msg);
            }         
          }

          final Constructor[] constructors = _clazz.getConstructors();

          for (int i = 0; i < constructors.length; i++) {
              final int mods = constructors[i].getModifiers();
              // Is it public, static and same number of args ?
              if (Modifier.isPublic(mods) &&
                  constructors[i].getParameterTypes().length == nArgs)
              {
                if (result == null) {
                  result = new Vector();
                }
                result.addElement(constructors[i]);
              }
          }
        }
        catch (ClassNotFoundException e) {
          final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className);
          getParser().reportError(Constants.ERROR, msg);
        }
           
        return result;
    }
View Full Code Here

      else if (clazz == Void.TYPE) {
    return "V";
      }
      else {
    final String name = clazz.toString();
    ErrorMsg err = new ErrorMsg(ErrorMsg.UNKNOWN_SIG_TYPE_ERR,name);
    throw new Error(err.toString());
      }
  }
  else {
      return "L" + clazz.getName().replace('.', '/') + ';';
  }
View Full Code Here

      break;
  case MOD:
      il.append(_type.REM());
      break;
  default:
      ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_BINARY_OP_ERR, this);
      getParser().reportError(Constants.ERROR, msg);
  }
    }
View Full Code Here

    public void parseContents(Parser parser) {
        final 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);          
            }               
            _name = parser.getQNameIgnoreDefaultNs(name);
        }
        else {
View Full Code Here

  final Template template = stable.lookupTemplate(_name);
  if (template != null) {
      typeCheckContents(stable);
  }
  else {
      ErrorMsg err = new ErrorMsg(ErrorMsg.TEMPLATE_UNDEF_ERR,_name,this);
      throw new TypeCheckError(err);
  }
  return Type.Void;
    }
View Full Code Here

  final SymbolTable stable = parser.getSymbolTable();

  // Handle the 'name' attribute
  String name = getAttribute("name");
  if (name == EMPTYSTRING) {
      ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
          name, this);
      parser.reportError(WARNING, msg);
      parseChildren(parser);
      _ignore = true;   // Ignore the element if the QName is invalid
      return;
  }

  // Get namespace attribute
  String namespace = getAttribute("namespace");

  // Optimize compilation when name is known at compile time
        _isLiteralName = Util.isLiteral(name);
  if (_isLiteralName) {
            if (!XML11Char.isXML11ValidQName(name)) {
    ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ELEM_NAME_ERR,
              name, this);
    parser.reportError(WARNING, msg);
    parseChildren(parser);
    _ignore = true;   // Ignore the element if the QName is invalid
    return;
      }

      final QName qname = parser.getQNameSafe(name);
      String prefix = qname.getPrefix();
      String local = qname.getLocalPart();
     
      if (prefix == null) {
    prefix = EMPTYSTRING;
      }

      if (!hasAttribute("namespace")) {
    namespace = lookupNamespace(prefix);
    if (namespace == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.NAMESPACE_UNDEF_ERR,
            prefix, this);
        parser.reportError(WARNING, err);
        parseChildren(parser);
        _ignore = true;   // Ignore the element if prefix is undeclared
        return;
    }
    _prefix = prefix;
    _namespace = new AttributeValueTemplate(namespace, parser, this);
      }
      else {
    if (prefix == EMPTYSTRING) {
              if (Util.isLiteral(namespace)) {
      prefix = lookupPrefix(namespace);
      if (prefix == null) {
          prefix = stable.generateNamespacePrefix();
      }
        }

        // Prepend prefix to local name
        final StringBuffer newName = new StringBuffer(prefix);
        if (prefix != EMPTYSTRING) {
      newName.append(':');
        }
        name = newName.append(local).toString();
    }
    _prefix = prefix;
    _namespace = new AttributeValueTemplate(namespace, parser, this);
      }
  }
  else {
      _namespace = (namespace == EMPTYSTRING) ? null :
       new AttributeValueTemplate(namespace, parser, this);
  }

  _name = new AttributeValueTemplate(name, parser, this);

  final String useSets = getAttribute("use-attribute-sets");
  if (useSets.length() > 0) {
            if (!Util.isValidQNames(useSets)) {
                ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, useSets, this);
                parser.reportError(Constants.ERROR, err)
            }
      setFirstElement(new UseAttributeSets(useSets, parser));
  }
View Full Code Here

    /**
     * This method should never be called. An Otherwise object will explicitly
     * translate the "test" expression and and contents of this element.
     */
    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  final ErrorMsg msg = new ErrorMsg(ErrorMsg.STRAY_WHEN_ERR, this);
  getParser().reportError(Constants.ERROR, msg);
    }
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.