Package org.zkoss.util

Examples of org.zkoss.util.IllegalSyntaxException


   */
  public static final Element getRequiredElement(Element e, String elemnm)
  throws IllegalSyntaxException {
    final Element sub = e.getElement(elemnm);
    if (sub == null)
      throw new IllegalSyntaxException(
        MCommon.XML_ELEMENT_REQUIRED, new Object[] {elemnm, e.getLocator()});
    return sub;
  }
View Full Code Here


   */
  public static final String getRequiredElementValue(Element e, String elemnm)
  throws IllegalSyntaxException {
    final Element sub = e.getElement(elemnm);
    if (sub == null)
      throw new IllegalSyntaxException(
        MCommon.XML_ELEMENT_REQUIRED, new Object[] {elemnm, e.getLocator()});
    return sub.getText(true);
  }
View Full Code Here

   */
  public static final String getRequiredAttributeValue(Element e, String attrnm)
  throws IllegalSyntaxException {
    final Attribute attr = e.getAttributeItem(attrnm);
    if (attr == null)
      throw new IllegalSyntaxException(
        MCommon.XML_ATTRIBUTE_REQUIRED, new Object[] {attrnm, e.getLocator()});
    return attr.getValue();
  }
View Full Code Here

    int len = signature.length();
    int j = Strings.skipWhitespaces(signature, 0);
    int k = Strings.anyOf(signature, "( \t\n\r", j);
    k = Strings.skipWhitespaces(signature, k);
    if (k >= len)
      throw new IllegalSyntaxException(signature);
   
    String returnType = null;
    char cc = signature.charAt(k);
    if (cc != '(') { 
      //skip the return type
      returnType = signature.substring(j, k).trim();
      //
      j = k;
      k = signature.indexOf('(', j + 1);
      if (k < 0)
        throw new IllegalSyntaxException(signature)
    }
    String method = signature.substring(j, k).trim();
   
    Collection argTypes = new LinkedList();
    Collection argNames = new LinkedList();
    do {
      j = Strings.skipWhitespaces(signature, k + 1);
      if (signature.charAt(j) == ')') break;
      k = Strings.anyOf(signature, ",) \t\n\r", j);
      k = Strings.skipWhitespaces(signature, k);
      if (k >= len)
        throw new IllegalSyntaxException(signature);
      argTypes.add(signature.substring(j, k).trim());

      cc = signature.charAt(k);
      if (cc != ',' && cc != ')') { //parameter name found
        k = Strings.anyOf(signature, ",) \t\n\r", j = k);
        k = Strings.skipWhitespaces(signature, k);
        argNames.add(signature.substring(j, k).trim());

        k = Strings.anyOf(signature, ",)", k);
        if (k >= len)
          throw new IllegalSyntaxException(signature);
      } else {
        argNames.add(""); //no name specified
      }
    } while (signature.charAt(k) == ',');
View Full Code Here

    //1. handle quoted
    final char cc = src.charAt(from);
    if (quotAsToken && (cc == '\'' || cc == '"')) {
      final Result res = substring(src, from + 1, cc, escBackslash);
      if (res.separator != cc)
        throw new IllegalSyntaxException(MCommon.QUOTE_UNMATCHED, src);

      res.next = skipWhitespaces(src, res.next + 1);
      if (res.next < len && isSeparator(src.charAt(res.next), separators))
        ++res.next;
      return res;
View Full Code Here

TOP

Related Classes of org.zkoss.util.IllegalSyntaxException

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.