Package com.ibm.icu.impl

Examples of com.ibm.icu.impl.IllegalIcuArgumentException


                            pos = parseRule(rule, pos, limit);
                        }
                    }
                } catch (IllegalArgumentException e) {
                    if (errorCount == 30) {
                        errors.add(new IllegalIcuArgumentException("\nMore than 30 errors; further messages squelched")
//#if defined(FOUNDATION10) || defined(J2SE13)
//#else
                            .initCause(e)
//#endif
                            );
                        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++) {
            RuleBasedTransliterator.Data data = (RuleBasedTransliterator.Data)dataVector.get(i);
            data.variables = new Object[variablesVector.size()];
            variablesVector.copyInto(data.variables);
            data.variableNames = new Hashtable();
            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++) {
                RuleBasedTransliterator.Data data = (RuleBasedTransliterator.Data)dataVector.get(i);
View Full Code Here


    /**
     * Set the variable range to [start, end] (inclusive).
     */
    private void setVariableRange(int start, 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(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(Normalizer.Mode mode) {
        //TODO Finish
        throw new IllegalIcuArgumentException("use normalize rules pragma not implemented yet");
    }
View Full Code Here

     * @param rule pattern string
     * @param start position of first character of current rule
     */
    static final void syntaxError(String msg, String rule, 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((char) --variableLimit);
            } else {
                throw new IllegalIcuArgumentException("Undefined variable $"
                                                   + name);
            }
        } else {
            buf.append(ch);
        }
View Full Code Here

                                              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)
//#if defined(FOUNDATION10) || defined(J2SE13)
//#else
                                .initCause(e)
//#endif
View Full Code Here

    static class IllegalIcuArgumentExceptionHandler extends ExceptionHandler
    {
        public Object[] getTestObjects()
        {
            IllegalIcuArgumentException[] exceptions = {
                new IllegalIcuArgumentException("Bad argument FOO")
            };
            return exceptions;
        }
View Full Code Here

   * @stable ICU 2.4
   */
  public static int getPropertyEnum(final CharSequence 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(final int property, final CharSequence valueAlias) {
    int propEnum = UPropertyAliases.INSTANCE.getPropertyValueEnum(property, valueAlias);
    if (propEnum == UProperty.UNDEFINED) {
      throw new IllegalIcuArgumentException("Invalid name: " + valueAlias);
    }
    return propEnum;
  }
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.