Package anvil.core

Examples of anvil.core.AnyMap


  }


  public Any eval()
  {
    return new AnyMap(_left.eval(), _right.eval());
  }
View Full Code Here


{

  private ModificationItem buildItem(Any item)
  {
    if (item.isMap()) {
      AnyMap map = item.toMap();
      int modop = map.getLeft().toInt();
      Any right = map.getRight();
      if (right instanceof AnyAttribute) {
        Attribute attr = (Attribute)right.toObject();
        return new ModificationItem(modop, attr);
      }
    } else {
View Full Code Here

    SearchControls controls = new SearchControls();
    int n = parameters.length;
    for(int i=0; i<n; i++) {
      Any property = parameters[i];
      if (property.isMap()) {
        AnyMap map = property.toMap();
        String key = map.getLeft().toString();
        if (key.equalsIgnoreCase("scope")) {
          controls.setSearchScope(map.getRight().toInt());
        } else if (key.equalsIgnoreCase("countlimit")) {
          controls.setCountLimit(map.getRight().toInt());
        } else if (key.equalsIgnoreCase("timelimit")) {
          controls.setTimeLimit(map.getRight().toInt());
        } else if (key.equalsIgnoreCase("attributes")) {
          Any right = map.getRight();
          if (right.isNull()) {
            controls.setReturningAttributes(null);
          } else {
            String[] attributes = AnyUtils.toStringArray(right);
            controls.setReturningAttributes(attributes);
          }
        } else if (key.equalsIgnoreCase("returnobject")) {
          controls.setReturningObjFlag(map.getRight().toBoolean());
        } else if (key.equalsIgnoreCase("dereflinks")) {
          controls.setDerefLinkFlag(map.getRight().toBoolean());
        } else {
          throw context.BadParameter("Invalid attribute: '"+key+"'");
        }
       
      } else if (property.isString()) {
View Full Code Here

      }
    }
    for(; i<n; i++) {
      Any value = values[i];
      if (value.isMap()) {
        AnyMap map = value.toMap();
        attrs.put(map.getLeft().toString(), map.getRight().toObject());
      } else if (value instanceof AnyAttribute) {
        attrs.put((Attribute)value.toObject());
      }
    }
    return new AnyAttributes(attrs);
View Full Code Here

  public Any setReference(anvil.script.Context context, Any value)
  {
    if (value instanceof AnyAttribute) {
      _attributes.put((Attribute)value.toObject());
    } else if (value.isMap()) {
      AnyMap map = value.toMap();
      _attributes.put(map.getLeft().toString(), map.getRight().toObject());
    } else {
      throw context.BadParameter("Attribute or map expected");
    }
    return value;
  }
View Full Code Here

TOP

Related Classes of anvil.core.AnyMap

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.