Package com.ibm.icu.impl

Examples of com.ibm.icu.impl.IllegalIcuArgumentException


     * @stable ICU 2.4
     */
    public static int getPropertyEnum(String propertyAlias) {
        int propEnum = UPropertyAliases.INSTANCE.getPropertyEnum(propertyAlias);
        if (propEnum == UProperty.UNDEFINED) {
            throw new IllegalIcuArgumentException("Invalid name: " + propertyAlias);
        }
        return propEnum;
    }
View Full Code Here


     * @stable ICU 2.4
     */
    public static int getPropertyValueEnum(int property, String valueAlias) {
        int propEnum = UPropertyAliases.INSTANCE.getPropertyValueEnum(property, valueAlias);
        if (propEnum == UProperty.UNDEFINED) {
            throw new IllegalIcuArgumentException("Invalid name: " + valueAlias);
        }
        return propEnum;
    }
View Full Code Here

              pos = parseRule(rule, pos, limit);
            }
          }
        } catch (IllegalArgumentException e) {
          if (errorCount == 30) {
            IllegalIcuArgumentException icuEx = new IllegalIcuArgumentException(
                "\nMore than 30 errors; further messages squelched");
            icuEx.initCause(e);
            errors.add(icuEx);
            break main;
          }
          e.fillInStackTrace();
          errors.add(e);
          ++errorCount;
          pos = ruleEnd(rule, pos, limit) + 1; // +1 advances past ';'
        }
      }
    }
    if (parsingIDs && idBlockResult.length() > 0) {
      if (direction == Transliterator.FORWARD)
        idBlockVector.add(idBlockResult.toString());
      else
        idBlockVector.add(0, idBlockResult.toString());
    } else if (!parsingIDs && curData != null) {
      if (direction == Transliterator.FORWARD)
        dataVector.add(curData);
      else
        dataVector.add(0, curData);
    }

    // Convert the set vector to an array
    for (int i = 0; i < dataVector.size(); i++) {
      Data data = dataVector.get(i);
      data.variables = new Object[variablesVector.size()];
      variablesVector.toArray(data.variables);
      data.variableNames = new HashMap<String, char[]>();
      data.variableNames.putAll(variableNames);
    }
    variablesVector = null;

    // Do more syntax checking and index the rules
    try {
      if (compoundFilter != null) {
        if ((direction == Transliterator.FORWARD && compoundFilterOffset != 1)
            || (direction == Transliterator.REVERSE && compoundFilterOffset != ruleCount)) {
          throw new IllegalIcuArgumentException("Compound filters misplaced");
        }
      }

      for (int i = 0; i < dataVector.size(); i++) {
        Data data = dataVector.get(i);
View Full Code Here

  /**
   * Set the variable range to [start, end] (inclusive).
   */
  private void setVariableRange(final int start, final int end) {
    if (start > end || start < 0 || end > 0xFFFF) {
      throw new IllegalIcuArgumentException("Invalid variable range " + start + ", " + end);
    }

    curData.variablesBase = (char) start; // first private use

    if (dataVector.size() == 0) {
View Full Code Here

  /**
   * Set the maximum backup to 'backup', in response to a pragma statement.
   */
  private void pragmaMaximumBackup(final int backup) {
    //TODO Finish
    throw new IllegalIcuArgumentException("use maximum backup pragma not implemented yet");
  }
View Full Code Here

  /**
   * Begin normalizing all rules using the given mode, in response to a pragma statement.
   */
  private void pragmaNormalizeRules(final Normalizer.Mode mode) {
    //TODO Finish
    throw new IllegalIcuArgumentException("use normalize rules pragma not implemented yet");
  }
View Full Code Here

   * @param start
   *            position of first character of current rule
   */
  static final void syntaxError(final String msg, final String rule, final int start) {
    int end = ruleEnd(rule, start, rule.length());
    throw new IllegalIcuArgumentException(msg + " in \"" + Utility.escape(rule.substring(start, end)) + '"');
  }
View Full Code Here

        if (variableNext >= variableLimit) {
          throw new RuntimeException("Private use variables exhausted");
        }
        buf.append(--variableLimit);
      } else {
        throw new IllegalIcuArgumentException("Undefined variable $" + name);
      }
    } else {
      buf.append(ch);
    }
  }
View Full Code Here

          try {
            m = new StringMatcher(buf.toString(), qstart, qlimit, 0, parser.curData);
          } catch (RuntimeException e) {
            final String precontext = pos < 50 ? rule.substring(0, pos) : "..." + rule.substring(pos - 50, pos);
            final String postContext = limit - pos <= 50 ? rule.substring(pos, limit) : rule.substring(pos, pos + 50) + "...";
            throw (RuntimeException) new IllegalIcuArgumentException("Failure in rule: " + precontext + "$$$" + postContext)
                .initCause(e);
          }
          int min = 0;
          int max = Quantifier.MAX;
          switch (c) {
View Full Code Here

                            pos = parseRule(rule, pos, limit);
                        }
                    }
                } catch (IllegalArgumentException e) {
                    if (errorCount == 30) {
                        IllegalIcuArgumentException icuEx = new IllegalIcuArgumentException("\nMore than 30 errors; further messages squelched");
                        icuEx.initCause(e);
                        errors.add(icuEx);
                        break main;
                    }
                    e.fillInStackTrace();
                    errors.add(e);
                    ++errorCount;
                    pos = ruleEnd(rule, pos, limit) + 1; // +1 advances past ';'
                }
            }
        }
        if (parsingIDs && idBlockResult.length() > 0) {
            if (direction == Transliterator.FORWARD)
                idBlockVector.add(idBlockResult.toString());
            else
                idBlockVector.insertElementAt(idBlockResult.toString(), 0);
        }
        else if (!parsingIDs && curData != null) {
            if (direction == Transliterator.FORWARD)
                dataVector.add(curData);
            else
                dataVector.insertElementAt(curData, 0);
        }

        // Convert the set vector to an array
        for (int i = 0; i < dataVector.size(); i++) {
            Data data = dataVector.get(i);
            data.variables = new Object[variablesVector.size()];
            variablesVector.copyInto(data.variables);
            data.variableNames = new Hashtable<String, char[]>();
            data.variableNames.putAll(variableNames);
        }
        variablesVector = null;

        // Do more syntax checking and index the rules
        try {
            if (compoundFilter != null) {
                if ((direction == Transliterator.FORWARD &&
                     compoundFilterOffset != 1) ||
                    (direction == Transliterator.REVERSE &&
                     compoundFilterOffset != ruleCount)) {
                    throw new IllegalIcuArgumentException("Compound filters misplaced");
                }
            }

            for (int i = 0; i < dataVector.size(); i++) {
                Data data = dataVector.get(i);
View Full Code Here

TOP

Related Classes of com.ibm.icu.impl.IllegalIcuArgumentException

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.