Android Open Source - ExpertAndroid Field Transporter

From Project

Back to project page ExpertAndroid.


The source code is released under:

MIT License

If you think the Android project ExpertAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package converters;
/*from   ww  w.  j av a  2  s .  c o  m*/
import java.util.HashMap;
import java.util.Map;

import android.os.Parcel;

import com.parse.ParseObject;

public class FieldTransporter 
implements IFieldTransport
  ParseObject po;
  Parcel p;
  int d = IFieldTransport.DIRECTION_FORWARD;
  Map<String,IFieldTransport> transporterMap;
  public FieldTransporter(ParseObject inpo, Parcel inp, int direction)
    po = inpo;
    p = inp;
    d = direction;
    //Register the folks
  public void register()
    transporterMap = new HashMap<String,IFieldTransport>();
    //register integers
        new IntegerFieldTransport(po,p,d));
        new StringFieldTransport(po,p,d));
  private IFieldTransport getTransportFor(String fieldType)
    IFieldTransport ift = transporterMap.get(fieldType);
    if (ift == null)
      throw new RuntimeException("Problem with locating the type");
    return ift;
  public void transfer(ValueField f) 
    IFieldTransport ift = getTransportFor(f.type);

Java Source Code List