Package anvil.java.util

Examples of anvil.java.util.BindingEnumeration


    case Any.IS_ARRAY:
      return value;
     
    default:
      array = new Array();
      BindingEnumeration e = value.enumeration();
      while(e.hasMoreElements()) {
        array.append(Any.create(e.nextKey()), Any.create(e.nextElement()));
      }
      return array;
    }
  }
View Full Code Here


    buffer.append('@');
    buffer.append(classtype.getPathinfo());
    buffer.append(' ');
    buffer.append('{');
    boolean isFirst = true;
    BindingEnumeration e = getAllMembers();
    while(e.hasMoreElements()) {
      if (isFirst) {
        isFirst = false;
      } else {
        buffer.append(',');
        buffer.append(' ');
      }
      buffer.append(e.nextKey().toString());
      buffer.append('=');
      buffer.append(e.nextElement().toString());
    }
    buffer.append('}');
    return buffer.toString();
  }
View Full Code Here

  public Any m_skip(Any amount)
  {
    if (amount != null) {
      int n = amount.toInt();
      if (n >= 0) {
        BindingEnumeration e = _enumeration;
        while(n-- > 0 && e.hasMoreElements()) {
          e.nextElement();
        }
      }
    } else {
      _enumeration.nextElement();
    }
View Full Code Here

  private static String[] toStringArray(Array list)
  {
    int n = list.size();
    String[] array = new String[n];
    int i = 0;
    BindingEnumeration e = list.keysAndElements();
    while(e.hasMoreElements()) {
      array[i++] = e.nextKey().toString() + "=" + e.nextElement().toString();
    }
    return array;
  }
View Full Code Here

    /* methodindices */
    code = _m_symbols.getCode();
    if (_symbols.size() > 0) {
      int register = pool.addMethodRef(pool.addClass("anvil/core/Register"),
        "register", "(Ljava/lang/String;)I");
      BindingEnumeration e = _symbols.keysAndElements();
      while(e.hasMoreElements()) {
        int index = ((Integer)e.nextKey()).intValue();
        String name = (String)e.nextElement();
        Field field = clazz.createField("r_"+name, "I", ACC_PUBLIC|ACC_STATIC|ACC_FINAL);
        code.astring(name);
        code.invokestatic(register);
        code.putstatic(field);
      }
    }
    code.vreturn();
   
    /* reflectionfields */
    if (_reflections.size() > 0) {
      BindingEnumeration e = _reflections.keysAndElements();
      while(e.hasMoreElements()) {
        int index = ((Integer)e.nextElement()).intValue();
        clazz.createField("java$"+index, "Lanvil/core/reflect/Reflection;", ACC_PUBLIC|ACC_STATIC);
      }
    }   
   
   
    popClass();

    try {
      clazz.write(_smith);
      return true;
    } catch (IOException e) {
      e.printStackTrace();
      return false;
    }
  }
View Full Code Here

  {
    StringBuffer tag = new StringBuffer(100);
    tag.append('<');
    tag.append(name);
    if (attrs != null && attrs.isArray()) {
      BindingEnumeration e = ((Array)attrs).keysAndElements();
      while(e.hasMoreElements()) {
        tag.append(' ');
        tag.append(e.nextKey());
        Any value = Any.create(e.nextElement());
        if (!(value.isNull() || value.isUndefined())) {
          tag.append('=');
          tag.append('"');
          tag.append(value);
          tag.append('"');
View Full Code Here

  /// @param properties Array of properties
  public static final Any connect(Context context, String type, Any properties)
  {
    java.util.Properties props = new java.util.Properties();
    if (properties.isArray()) {
      BindingEnumeration e = properties.enumeration();
      while(e.hasMoreElements()) {
        props.setProperty(e.nextKey().toString(), e.nextElement().toString());
      }
    }
    try {
      javax.naming.Context ctx;
      if (type.equalsIgnoreCase("ldap")) {
View Full Code Here

  /* foreach */
 
  public final Any foreach(Any list, Any block)
  {
    Any rv = Any.UNDEFINED;
    BindingEnumeration e = list.enumeration();
    Any[] args = new Any[2];
    while(e.hasMoreElements()) {
      args[1] = Any.create(e.nextKey());
      args[0] = Any.create(e.nextElement());
      rv = block.execute(this, args);
    }
    return rv;
  }
View Full Code Here

    context.checkAccess(CAN_WRITE);
    context.checkAccess(AnyCitizen.CAN_WRITE);
    try {
      Citizen citizen = null;
      if (mappings != null) {
        BindingEnumeration be = mappings.enumeration();
        String[][] params = new String[mappings.sizeOf()][2];
        for (int i=0; be.hasMoreElements(); i++) {
          params[i][0] = be.nextKey().toString();
          params[i][1] = be.nextElement().toString();
        }
        citizen = _realm.createCitizen(name, credentials, params);
      } else {
        citizen = _realm.createCitizen(name, credentials);
      }
View Full Code Here

TOP

Related Classes of anvil.java.util.BindingEnumeration

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.