Package com.caucho.quercus.marshal

Examples of com.caucho.quercus.marshal.Marshal


    int size = getSize();

    T[] array = T[].class.cast(Array.newInstance(elementType, size));

    MarshalFactory factory = env.getModuleContext().getMarshalFactory();
    Marshal elementMarshal = factory.create(elementType);

    int i = 0;

    for (Entry ptr = getHead(); ptr != null; ptr = ptr.getNext()) {
      Array.set(array, i++, elementMarshal.marshal(env,
                                                   ptr.getValue(),
                                                   elementType));
    }

    return array;
View Full Code Here


      init();
   
    Value []values = new Value[args.length];

    for (int i = 0; i < args.length; i++) {
      Marshal arg = null;

      if (i < _marshalArgs.length)
        arg = _marshalArgs[i];
      else if (_isRestReference) {
        values[i] = args[i].evalRef(env);
        continue;
      }
      else {
        values[i] = args[i].eval(env);
        continue;
      }

      if (arg == null)
        values[i] = args[i].eval(env).copy();
      else if (arg.isReference())
        values[i] = args[i].evalRef(env);
      else {
        // php/0d04
        values[i] = args[i].eval(env);
      }
View Full Code Here

    int cost = 0;
    int i = 0;
   
    for (; i < _marshalArgs.length; i++) {
      Marshal marshal = _marshalArgs[i];

      if (i < args.length && args[i] != null) {
        Value arg = args[i].toValue();

        int argCost = marshal.getMarshalingCost(arg);
        if (log.isLoggable(Level.FINEST)) {
            log.finest("Marshaling cost from " + arg.getClass() + " with " + marshal + " is " + argCost);
        }
        cost = Math.max(argCost + cost, cost);
      }
View Full Code Here

    int cost = 0;
    int i = 0;
   
    for (; i < _marshalArgs.length; i++) {
      Marshal marshal = _marshalArgs[i];
     
      if (i < args.length && args[i] != null) {
        Expr arg = args[i];

        int argCost = marshal.getMarshalingCost(arg);

        cost = Math.max(argCost + cost, cost);
      }
    }
View Full Code Here

    int size = getSize();

    Object array = Array.newInstance(elementType, size);

    MarshalFactory factory = env.getModuleContext().getMarshalFactory();
    Marshal elementMarshal = factory.create(elementType);

    int i = 0;

    for (Map.Entry<Value, Value> entry : entrySet()) {
      Array.set(array, i++, elementMarshal.marshal(env,
                                                   entry.getValue(),
                                                   elementType));
    }

    return array;
View Full Code Here

    // XXX: needs to go into constructor
    Class componentClass = getType().getComponentType();

    MarshalFactory factory = getModuleContext().getMarshalFactory();
    Marshal componentClassMarshal = factory.create(componentClass);

    int length = Array.getLength(obj);
     
    for (int i = 0; i < length; i++) {
      Object component = Array.get(obj, i);
     
      arrayValueImpl.put(componentClassMarshal.unmarshal(env, component));
    }

    return arrayValueImpl;
  }
View Full Code Here

        continue;
      else if (field.isAnnotationPresent(Hide.class))
        continue;

      MarshalFactory factory = moduleContext.getMarshalFactory();
      Marshal marshal = factory.create(field.getType(), false);
     
      _fieldMap.put(new ConstStringValue(field.getName()),
        new FieldMarshalPair(field, marshal));
    }
View Full Code Here

    int size = getSize();

    Object array = Array.newInstance(elementType, size);

    MarshalFactory factory = env.getModuleContext().getMarshalFactory();
    Marshal elementMarshal = factory.create(elementType);

    int i = 0;

    for (Entry ptr = getHead(); ptr != null; ptr = ptr.getNext()) {
      Array.set(array, i++, elementMarshal.marshal(env,
                                                   ptr.getValue(),
                                                   elementType));
    }

    return array;
View Full Code Here

      init();

    Value []values = new Value[args.length];

    for (int i = 0; i < args.length; i++) {
      Marshal arg = null;

      if (i < _marshalArgs.length)
        arg = _marshalArgs[i];
      else if (_isRestReference) {
        values[i] = args[i].evalVar(env);
        continue;
      }
      else {
        values[i] = args[i].eval(env);
        continue;
      }

      if (arg == null)
        values[i] = args[i].eval(env).copy();
      else if (arg.isReference())
        values[i] = args[i].evalRef(env);
      else {
        // php/0d04
        values[i] = args[i].eval(env);
      }
View Full Code Here

    int cost = 0;
    int i = 0;

    for (; i < _marshalArgs.length; i++) {
      Marshal marshal = _marshalArgs[i];

      if (i < args.length && args[i] != null) {
        Value arg = args[i].toValue();

        int argCost = marshal.getMarshalingCost(arg);

        cost = Math.max(argCost + cost, cost);
      }
    }
View Full Code Here

TOP

Related Classes of com.caucho.quercus.marshal.Marshal

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.