Example usage for com.google.gwt.user.client.rpc SerializationStreamReader readBoolean

List of usage examples for com.google.gwt.user.client.rpc SerializationStreamReader readBoolean

Introduction

In this page you can find the example usage for com.google.gwt.user.client.rpc SerializationStreamReader readBoolean.

Prototype

boolean readBoolean() throws SerializationException;

Source Link

Usage

From source file:ListBasedPersistentSet_CustomFieldSerializer.java

License:Apache License

@SuppressWarnings("unchecked")
public static void deserialize(SerializationStreamReader streamReader, ListBasedPersistentSet<?> instance)
        throws SerializationException {
    ArrayList<?> list = new ArrayList<Object>();
    ArrayList_CustomFieldSerializer.deserialize(streamReader, list);
    instance.setList((ArrayList) list);

    instance.setDirty(streamReader.readBoolean());
}

From source file:com.cimpoint.mes.common.entities.EFormField_CustomFieldSerializer.java

License:Open Source License

@SuppressWarnings("unchecked")
public static void deserialize(SerializationStreamReader streamReader, EFormField instance) {
    try {// ww  w.  j  a va2 s  . co  m
        Long id = streamReader.readLong();
        if (id == 0L)
            id = null;
        instance.setId(id);
        instance.setName(streamReader.readString());
        instance.setLabel(streamReader.readString());
        instance.setForm((EForm) streamReader.readObject());
        instance.setColumnSpan(streamReader.readInt());
        instance.setStartNewRow(streamReader.readBoolean());
        instance.setEndCurrentRow(streamReader.readBoolean());
        instance.setFieldType(Constants.Form.FieldType.valueOf(streamReader.readString()));
        instance.setFormFieldProperties((Set<EFormFieldProperty>) streamReader.readObject());
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}

From source file:com.cimpoint.mes.common.entities.EStepStatus_CustomFieldSerializer.java

License:Open Source License

@SuppressWarnings("unchecked")
public static void deserialize(SerializationStreamReader streamReader, EStepStatus instance) {
    try {// w  ww  . j a v a2  s  .  c o m
        try {
            instance.setId(streamReader.readLong());
        } catch (Exception ex) {
            Long id = new Long(0);
            instance.setId(id);
        }

        instance.setName(streamReader.readString());
        instance.setStarting(streamReader.readBoolean());
        instance.setEnding(streamReader.readBoolean());
        instance.setNextDefaultStatusName(streamReader.readString());
        instance.setSteps((Set<EStep>) streamReader.readObject());
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}

From source file:com.erinors.hpb.shared.impl.PersistentList_CustomFieldSerializer.java

License:Apache License

public static void deserialize(SerializationStreamReader streamReader, PersistentList<?> instance)
        throws SerializationException {
    ArrayList_CustomFieldSerializer.deserialize(streamReader, instance);
    instance.setDirty(streamReader.readBoolean());
}

From source file:com.erinors.hpb.shared.impl.PersistentMap_CustomFieldSerializer.java

License:Apache License

public static void deserialize(SerializationStreamReader streamReader, PersistentMap<?, ?> instance)
        throws SerializationException {
    HashMap_CustomFieldSerializer.deserialize(streamReader, instance);
    instance.setDirty(streamReader.readBoolean());
}

From source file:com.erinors.hpb.shared.impl.PersistentSet_CustomFieldSerializer.java

License:Apache License

public static void deserialize(SerializationStreamReader streamReader, PersistentSet<?> instance)
        throws SerializationException {
    HashSet_CustomFieldSerializer.deserialize(streamReader, instance);
    instance.setDirty(streamReader.readBoolean());
}

From source file:com.google.appengine.api.datastore.Entity_CustomFieldSerializer.java

License:Apache License

/**
 * @param streamReader// w w w  .ja va2  s .c om
 * @return entity
 * @throws SerializationException
 */
public static Entity instantiate(SerializationStreamReader streamReader) throws SerializationException {

    // Key
    Entity entity = new Entity((Key) streamReader.readObject());

    // Count
    int propertiesCount = streamReader.readInt();

    for (int n = 0; n < propertiesCount; n++) {
        // Name
        String propertyName = streamReader.readString();

        // Kind
        TYPES typeKind = TYPES.values()[streamReader.readInt()];

        // Value
        Object value = null;
        switch (typeKind) {
        case BOOLEAN:
            value = streamReader.readBoolean();
            break;
        case BYTE:
            value = streamReader.readByte();
            break;
        case CHAR:
            value = streamReader.readChar();
            break;
        case DOUBLE:
            value = streamReader.readDouble();
            break;
        case FLOAT:
            value = streamReader.readFloat();
            break;
        case INT:
            value = streamReader.readInt();
            break;
        case LONG:
            value = streamReader.readLong();
            break;
        case OBJECT:
            value = streamReader.readObject();
            break;
        case SHORT:
            value = streamReader.readShort();
            break;
        case STRING:
            value = streamReader.readString();
            break;
        case DATE:
            value = new Date(streamReader.readLong());
            break;
        case BLOB:
            value = Blob_CustomFieldSerializer.instantiate(streamReader);
            break;
        case SHORTBLOB:
            value = ShortBlob_CustomFieldSerializer.instantiate(streamReader);
            break;
        case USER:
            value = User_CustomFieldSerializer.instantiate(streamReader);
            break;
        case CATEGORY:
            value = Category_CustomFieldSerializer.instantiate(streamReader);
            break;
        case EMAIL:
            value = Email_CustomFieldSerializer.instantiate(streamReader);
            break;
        case GEOPT:
            value = GeoPt_CustomFieldSerializer.instantiate(streamReader);
            break;
        case LINK:
            value = Link_CustomFieldSerializer.instantiate(streamReader);
            break;
        case PHONENUMBER:
            value = PhoneNumber_CustomFieldSerializer.instantiate(streamReader);
            break;
        case POSTALADDRESS:
            value = PostalAddress_CustomFieldSerializer.instantiate(streamReader);
            break;
        case RATING:
            value = Rating_CustomFieldSerializer.instantiate(streamReader);
            break;
        }

        // Unindexed
        if (streamReader.readBoolean()) {
            entity.setUnindexedProperty(propertyName, value);
        } else {
            entity.setProperty(propertyName, value);
        }
    }
    return entity;
}

From source file:com.google.common.collect.Range_CustomFieldSerializer.java

License:Apache License

public static Range<?> instantiate(SerializationStreamReader reader) throws SerializationException {

    Cut lowerBound;//from www. j  a  v a2 s .com
    boolean hasLowerBound = reader.readBoolean();
    if (hasLowerBound) {
        boolean lowerIsClosed = reader.readBoolean();
        Comparable lower = (Comparable) reader.readObject();

        lowerBound = lowerIsClosed ? Cut.belowValue(lower) : Cut.aboveValue(lower);
    } else {
        lowerBound = Cut.belowAll();
    }

    Cut upperBound;
    boolean hasUpperBound = reader.readBoolean();
    if (hasUpperBound) {
        boolean upperIsClosed = reader.readBoolean();
        Comparable upper = (Comparable) reader.readObject();

        upperBound = upperIsClosed ? Cut.aboveValue(upper) : Cut.belowValue(upper);
    } else {
        upperBound = Cut.aboveAll();
    }

    return Range.create(lowerBound, upperBound);
}

From source file:org.jason.mapmaker.shared.model.MTFCC_CustomFieldSerializer.java

License:Apache License

public static void deserialize(SerializationStreamReader reader, MTFCC instance) throws SerializationException {

    instance.setId(reader.readLong());//from  w  ww  .  j ava2s. c  o m
    instance.setMtfccCode(reader.readString());
    instance.setFeatureClass(reader.readString());
    instance.setSuperClass(reader.readString());
    instance.setPoint(reader.readBoolean());
    instance.setLinear(reader.readBoolean());
    instance.setAreal(reader.readBoolean());
    instance.setFeatureClassDescription(reader.readString());
    instance.setLocationList((List) reader.readObject());
}