Examples of DexteritySyntaxException


Examples of org.dykman.dexter.DexteritySyntaxException

      }
      return out.toString();
    }
    catch (Exception e)
    {
      throw new DexteritySyntaxException(e);
    }
  }
View Full Code Here

Examples of org.dykman.dexter.DexteritySyntaxException

  public void edit(String namespace, String name, String value)
  {
    if (!element.hasAttribute("id"))
    {
      throw new DexteritySyntaxException("ajax target must have an `id' attribute");
    }
    String id = element.getAttribute("id");
   
    String pre = getDexterAttribute(element, "pre");
    String post = getDexterAttribute(element, "post");
    String params = getDexterAttribute(element, "params");
    if(params != null)
    {
      element.setUserData(PARAMS, params,null);
    }

    boolean applyToChildren = false;
    String method;
   
    if(value.startsWith("#"))
    {
      applyToChildren = true;
      value = value.substring(1);
    }
   
    if(value.charAt(0) == '!')
    {
      method="post";
      value = value.substring(1);
    }
    else if(value.charAt(1) == '!')
    {
      switch(value.charAt(0))
      {
        case 'P' :
          method = "put";
        break;
        case 'H' :
          method = "head";
        break;
        case 'D' :
          method = "delete";
        break;
        case 'O' :
          method = "options";
        break;
        default :
            throw new DexteritySyntaxException("illegal method specifier");
      }
      value = value.substring(2);
    }
    else
    {
View Full Code Here

Examples of org.dykman.dexter.DexteritySyntaxException

    }
    String dexterity = DexterityConstants.BASE_NAMESPACE;
   
    String[] args = splitArgs(value);
    if(args.length < 1) {
      throw new DexteritySyntaxException("too few arguments in " + name + " attribute");
    }

    if(args[0].startsWith("!")) {
      // make a strict and insert it previously
      args[0] = args[0].substring(1);
View Full Code Here

Examples of org.dykman.dexter.DexteritySyntaxException

  public void beforeNode()
  {
    id = element.getAttribute("id");
    if (id == null)
    {
      throw new DexteritySyntaxException("a subdoc element must have an 'id' attribute");
    }

    String altDoc = null;
    if(value.indexOf(':') > -1)
    {
View Full Code Here

Examples of org.dykman.dexter.dexterity.DexteritySyntaxException

    String result = name;
    if(name.indexOf(':') != -1)
    {
      String[] b = name.split("[:]");
      if(dexterNamespaces.contains(b[0]))
        throw new DexteritySyntaxException(
            "unrecognized attribute specified in dexter namespace: `"
            + name + "'");
    }
    return result;
  }
View Full Code Here

Examples of org.dykman.dexter.dexterity.DexteritySyntaxException

 
 
  public static PathEval parseSingle(String s) {
    List<PathEval> list = parse(s);
    if(list.size() != 1) {
      throw new DexteritySyntaxException("" + list.size() + " elements found in parseSingle");
    }
    return list.get(0);
  }
View Full Code Here

Examples of org.dykman.dexter.dexterity.DexteritySyntaxException

    }
    Tokenizer tok = new Tokenizer(s);
    while(tok.hasNext()) {
      String t = tok.nextToken();
      if(t.equals("{")) {
        if(!tok.hasNext()) throw new DexteritySyntaxException("untermiated xpath phrase");
        t = tok.nextToken();
        if(t.equals("}")) {
          list.add(new PathEval(".",XPATH));
        } else {
          if(t.length() == 0) t = ".";
          list.add(new PathEval(t,XPATH));
          if(!"}".equals(tok.nextToken()))
            throw new DexteritySyntaxException("failed to close expression phrase");
        }
      }
      else  if(t.equals("{{")) {
        if(!tok.hasNext()) throw new DexteritySyntaxException("untermiated lookup phrase");
        t = tok.nextToken();
        if(t.equals("}}")) {
          list.add(new PathEval(".",LOOKUP));
        } else {
          if(t.length() == 0) t = ".";
          list.add(new PathEval(t,LOOKUP));
          if(!"}}".equals(tok.nextToken()))
            throw new DexteritySyntaxException("failed to close lookup phrase");
        }
      }
      else {
        list.add(new PathEval(t,LITERAL));
      }
View Full Code Here

Examples of org.dykman.dexter.dexterity.DexteritySyntaxException

    String result = name;
    if(name.indexOf(':') != -1)
    {
      String[] b = name.split("[:]");
      if(dexterNamespaces.contains(b[0]))
        throw new DexteritySyntaxException(
            "unrecognized attribute specified in dexter namespace: `"
            + name + "'");
    }
    return result;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.