Java 类com.google.gwt.user.client.rpc.SerializationException 实例源码

项目:guava-mock    文件:RegularImmutableSortedSet_CustomFieldSerializer.java   
public static RegularImmutableSortedSet<Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  /*
   * Nothing we can do, but we're already assuming the serialized form is
   * correctly typed, anyway.
   */
  @SuppressWarnings("unchecked")
  Comparator<Object> comparator = (Comparator<Object>) reader.readObject();

  List<Object> elements = new ArrayList<Object>();
  Collection_CustomFieldSerializerBase.deserialize(reader, elements);
  /*
   * For this custom field serializer to be invoked, the set must have been
   * RegularImmutableSortedSet before it's serialized. Since
   * RegularImmutableSortedSet always have one or more elements,
   * ImmutableSortedSet.copyOf always return a RegularImmutableSortedSet back.
   */
  return (RegularImmutableSortedSet<Object>) ImmutableSortedSet.copyOf(comparator, elements);
}
项目:guava-mock    文件:Range_CustomFieldSerializer.java   
public static void serialize(SerializationStreamWriter writer, Range<?> instance)
    throws SerializationException {

  if (instance.hasLowerBound()) {
    writer.writeBoolean(true);
    writer.writeBoolean(instance.lowerBoundType() == BoundType.CLOSED);
    writer.writeObject(instance.lowerEndpoint());
  } else {
    writer.writeBoolean(false);
  }

  if (instance.hasUpperBound()) {
    writer.writeBoolean(true);
    writer.writeBoolean(instance.upperBoundType() == BoundType.CLOSED);
    writer.writeObject(instance.upperEndpoint());
  } else {
    writer.writeBoolean(false);
  }
}
项目:EasyML    文件:ModuleBuilder.java   
/**
 * Generate dataset module based on path and id
 *
 * @param path
 *          dataset path
 * @param id
 *          dataset uuid
 * @return Dataset
 * @throws Exception
 */
public static Dataset buildDataset(String path, String id) throws Exception {
    if (HDFSIO.exist(path)) {
        Dataset dataset = new Dataset();
        List list;
        try {
            Dataset temp = SecureDao.getObject(dataset, " and id = '" + id + "'");
            if ( temp != null ) {
                dataset = temp;
            } else {
                dataset.setId(id);
                dataset.setName("id" + id);
                dataset.setPath(path);
            }
        } catch (Exception e) {
            e.printStackTrace();
            throw new SerializationException(e);
        }
        return dataset;
    } else {
        System.out.println("DataSet is return null");
        return null;
    }
}
项目:googles-monorepo-demo    文件:LinkedListMultimap_CustomFieldSerializer.java   
public static LinkedListMultimap<Object, Object> instantiate(SerializationStreamReader in)
    throws SerializationException {
  LinkedListMultimap<Object, Object> multimap = LinkedListMultimap.create();
  int size = in.readInt();
  for (int i = 0; i < size; i++) {
    Object key = in.readObject();
    Object value = in.readObject();
    multimap.put(key, value);
  }
  return multimap;
}
项目:guava-mock    文件:ImmutableTable_CustomFieldSerializerBase.java   
public static ImmutableTable<Object, Object, Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  ImmutableTable.Builder<Object, Object, Object> builder = ImmutableTable.builder();
  int rowCount = reader.readInt();
  for (int i = 0; i < rowCount; i++) {
    Object rowKey = reader.readObject();
    int colCount = reader.readInt();
    for (int j = 0; j < colCount; j++) {
      builder.put(rowKey, reader.readObject(), reader.readObject());
    }
  }
  return builder.build();
}
项目:guava-mock    文件:ImmutableTable_CustomFieldSerializerBase.java   
public static void serialize(
    SerializationStreamWriter writer, ImmutableTable<Object, Object, Object> table)
    throws SerializationException {
  writer.writeInt(table.rowKeySet().size());
  for (Object rowKey : table.rowKeySet()) {
    writer.writeObject(rowKey);
    Map_CustomFieldSerializerBase.serialize(writer, table.row(rowKey));
  }
}
项目:guava-mock    文件:ImmutableSortedMap_CustomFieldSerializerBase.java   
static ImmutableSortedMap<Object, Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  /*
   * Nothing we can do, but we're already assuming the serialized form is
   * correctly typed, anyway.
   */
  @SuppressWarnings("unchecked")
  Comparator<Object> comparator = (Comparator<Object>) reader.readObject();

  SortedMap<Object, Object> entries = new TreeMap<Object, Object>(comparator);
  Map_CustomFieldSerializerBase.deserialize(reader, entries);

  return ImmutableSortedMap.orderedBy(comparator).putAll(entries).build();
}
项目:guava-mock    文件:Multimap_CustomFieldSerializerBase.java   
@CanIgnoreReturnValue
public static Multimap<Object, Object> populate(
    SerializationStreamReader reader, Multimap<Object, Object> multimap)
    throws SerializationException {
  int keyCount = reader.readInt();
  for (int i = 0; i < keyCount; ++i) {
    Object key = reader.readObject();
    int valueCount = reader.readInt();
    for (int j = 0; j < valueCount; ++j) {
      Object value = reader.readObject();
      multimap.put(key, value);
    }
  }
  return multimap;
}
项目:guava-mock    文件:Multimap_CustomFieldSerializerBase.java   
public static void serialize(SerializationStreamWriter writer, Multimap<?, ?> instance)
    throws SerializationException {
  writer.writeInt(instance.asMap().size());
  for (Map.Entry<?, ? extends Collection<?>> entry : instance.asMap().entrySet()) {
    writer.writeObject(entry.getKey());
    writer.writeInt(entry.getValue().size());
    for (Object value : entry.getValue()) {
      writer.writeObject(value);
    }
  }
}
项目:guava-mock    文件:Multiset_CustomFieldSerializerBase.java   
static Multiset<Object> populate(SerializationStreamReader reader, Multiset<Object> multiset)
    throws SerializationException {
  int distinctElements = reader.readInt();
  for (int i = 0; i < distinctElements; i++) {
    Object element = reader.readObject();
    int count = reader.readInt();
    multiset.add(element, count);
  }
  return multiset;
}
项目:guava-mock    文件:Multiset_CustomFieldSerializerBase.java   
static void serialize(SerializationStreamWriter writer, Multiset<?> instance)
    throws SerializationException {
  int entryCount = instance.entrySet().size();
  writer.writeInt(entryCount);
  for (Multiset.Entry<?> entry : instance.entrySet()) {
    writer.writeObject(entry.getElement());
    writer.writeInt(entry.getCount());
  }
}
项目:guava-mock    文件:TreeMultimap_CustomFieldSerializer.java   
@SuppressWarnings("unchecked")
public static TreeMultimap<Object, Object> instantiate(SerializationStreamReader in)
    throws SerializationException {
  Comparator<Object> keyComparator = (Comparator<Object>) in.readObject();
  Comparator<Object> valueComparator = (Comparator<Object>) in.readObject();

  return (TreeMultimap<Object, Object>)
      Multimap_CustomFieldSerializerBase.populate(
          in, TreeMultimap.create(keyComparator, valueComparator));
}
项目:googles-monorepo-demo    文件:RegularImmutableAsList_CustomFieldSerializer.java   
public static RegularImmutableAsList<Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  ArrayList<Object> elements = new ArrayList<Object>();
  Collection_CustomFieldSerializerBase.deserialize(reader, elements);
  ImmutableList<Object> delegate = ImmutableList.copyOf(elements);
  return new RegularImmutableAsList<Object>(delegate, delegate);
}
项目:guava-mock    文件:LinkedListMultimap_CustomFieldSerializer.java   
public static LinkedListMultimap<Object, Object> instantiate(SerializationStreamReader in)
    throws SerializationException {
  LinkedListMultimap<Object, Object> multimap = LinkedListMultimap.create();
  int size = in.readInt();
  for (int i = 0; i < size; i++) {
    Object key = in.readObject();
    Object value = in.readObject();
    multimap.put(key, value);
  }
  return multimap;
}
项目:googles-monorepo-demo    文件:Table_CustomFieldSerializerBase.java   
static <T extends StandardTable<Object, Object, Object>> T populate(
    SerializationStreamReader reader, T table) throws SerializationException {
  Map<?, ?> hashMap = (Map<?, ?>) reader.readObject();
  for (Entry<?, ?> row : hashMap.entrySet()) {
    table.row(row.getKey()).putAll((Map<?, ?>) row.getValue());
  }
  return table;
}
项目:guava-mock    文件:Table_CustomFieldSerializerBase.java   
static <T extends StandardTable<Object, Object, Object>> T populate(
    SerializationStreamReader reader, T table) throws SerializationException {
  Map<?, ?> hashMap = (Map<?, ?>) reader.readObject();
  for (Entry<?, ?> row : hashMap.entrySet()) {
    table.row(row.getKey()).putAll((Map<?, ?>) row.getValue());
  }
  return table;
}
项目:googles-monorepo-demo    文件:RegularImmutableSortedSet_CustomFieldSerializer.java   
public static void serialize(
    SerializationStreamWriter writer, RegularImmutableSortedSet<?> instance)
    throws SerializationException {
  writer.writeObject(instance.comparator());

  Collection_CustomFieldSerializerBase.serialize(writer, instance);
}
项目:guava-mock    文件:RegularImmutableSortedSet_CustomFieldSerializer.java   
public static void serialize(
    SerializationStreamWriter writer, RegularImmutableSortedSet<?> instance)
    throws SerializationException {
  writer.writeObject(instance.comparator());

  Collection_CustomFieldSerializerBase.serialize(writer, instance);
}
项目:guava-mock    文件:RegularImmutableSet_CustomFieldSerializer.java   
public static RegularImmutableSet<Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  List<Object> elements = Lists.newArrayList();
  Collection_CustomFieldSerializerBase.deserialize(reader, elements);
  /*
   * For this custom field serializer to be invoked, the set must have been
   * RegularImmutableSet before it's serialized.  Since RegularImmutableSet
   * always have two or more elements, ImmutableSet.copyOf always return
   * a RegularImmutableSet back.
   */
  return (RegularImmutableSet<Object>) ImmutableSet.copyOf(elements);
}
项目:googles-monorepo-demo    文件:ImmutableEnumSet_CustomFieldSerializer.java   
public static <E extends Enum<E>> ImmutableEnumSet<?> instantiate(
    SerializationStreamReader reader) throws SerializationException {
  List<E> deserialized = Lists.newArrayList();
  Collection_CustomFieldSerializerBase.deserialize(reader, deserialized);
  /*
   * It is safe to cast to ImmutableEnumSet because in order for it to be
   * serialized as an ImmutableEnumSet, it must be non-empty to start
   * with.
   */
  return (ImmutableEnumSet<?>) Sets.immutableEnumSet(deserialized);
}
项目:guava-mock    文件:Range_CustomFieldSerializer.java   
public static Range<?> instantiate(SerializationStreamReader reader)
    throws SerializationException {

  Cut lowerBound;
  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);
}
项目:googles-monorepo-demo    文件:ImmutableSortedMap_CustomFieldSerializerBase.java   
static ImmutableSortedMap<Object, Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  /*
   * Nothing we can do, but we're already assuming the serialized form is
   * correctly typed, anyway.
   */
  @SuppressWarnings("unchecked")
  Comparator<Object> comparator = (Comparator<Object>) reader.readObject();

  SortedMap<Object, Object> entries = new TreeMap<Object, Object>(comparator);
  Map_CustomFieldSerializerBase.deserialize(reader, entries);

  return ImmutableSortedMap.orderedBy(comparator).putAll(entries).build();
}
项目:guava-mock    文件:RegularImmutableBiMap_CustomFieldSerializer.java   
public static RegularImmutableBiMap<Object, Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  Map<Object, Object> entries = new LinkedHashMap<Object, Object>();
  Map_CustomFieldSerializerBase.deserialize(reader, entries);
  /*
   * For this custom field serializer to be invoked, the map must have been
   * RegularImmutableBiMap before it's serialized. Since RegularImmutableBiMap
   * always have one or more elements, ImmutableBiMap.copyOf always return a
   * RegularImmutableBiMap back.
   */
  return (RegularImmutableBiMap<Object, Object>) ImmutableBiMap.copyOf(entries);
}
项目:googles-monorepo-demo    文件:Range_CustomFieldSerializer.java   
public static Range<?> instantiate(SerializationStreamReader reader)
    throws SerializationException {

  Cut lowerBound;
  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);
}
项目:guava-mock    文件:RegularImmutableAsList_CustomFieldSerializer.java   
public static RegularImmutableAsList<Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  ArrayList<Object> elements = new ArrayList<Object>();
  Collection_CustomFieldSerializerBase.deserialize(reader, elements);
  ImmutableList<Object> delegate = ImmutableList.copyOf(elements);
  return new RegularImmutableAsList<Object>(delegate, delegate);
}
项目:googles-monorepo-demo    文件:Multiset_CustomFieldSerializerBase.java   
static Multiset<Object> populate(SerializationStreamReader reader, Multiset<Object> multiset)
    throws SerializationException {
  int distinctElements = reader.readInt();
  for (int i = 0; i < distinctElements; i++) {
    Object element = reader.readObject();
    int count = reader.readInt();
    multiset.add(element, count);
  }
  return multiset;
}
项目:guava-mock    文件:RegularImmutableList_CustomFieldSerializer.java   
public static RegularImmutableList<Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  List<Object> elements = new ArrayList<Object>();
  Collection_CustomFieldSerializerBase.deserialize(reader, elements);
  /*
   * For this custom field serializer to be invoked, the list must have been
   * RegularImmutableList before it's serialized.  Since RegularImmutableList
   * always have one or more elements, ImmutableList.copyOf always return
   * a RegularImmutableList back.
   */
  return (RegularImmutableList<Object>) ImmutableList.copyOf(elements);
}
项目:googles-monorepo-demo    文件:RegularImmutableMultiset_CustomFieldSerializer.java   
public static RegularImmutableMultiset<Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  List<Object> elements = Lists.newArrayList();
  Collection_CustomFieldSerializerBase.deserialize(reader, elements);
  /*
   * For this custom field serializer to be invoked, the set must have been
   * RegularImmutableMultiset before it's serialized. Since
   * RegularImmutableMultiset always have one or more elements,
   * ImmutableMultiset.copyOf always return a RegularImmutableMultiset back.
   */
  return (RegularImmutableMultiset<Object>) ImmutableMultiset.copyOf(elements);
}
项目:googles-monorepo-demo    文件:RegularImmutableSet_CustomFieldSerializer.java   
public static RegularImmutableSet<Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  List<Object> elements = Lists.newArrayList();
  Collection_CustomFieldSerializerBase.deserialize(reader, elements);
  /*
   * For this custom field serializer to be invoked, the set must have been
   * RegularImmutableSet before it's serialized.  Since RegularImmutableSet
   * always have two or more elements, ImmutableSet.copyOf always return
   * a RegularImmutableSet back.
   */
  return (RegularImmutableSet<Object>) ImmutableSet.copyOf(elements);
}
项目:googles-monorepo-demo    文件:RegularImmutableMap_CustomFieldSerializer.java   
public static RegularImmutableMap<Object, Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  Map<Object, Object> entries = new LinkedHashMap<Object, Object>();
  Map_CustomFieldSerializerBase.deserialize(reader, entries);
  /*
   * For this custom field serializer to be invoked, the map must have been
   * RegularImmutableMap before it's serialized.  Since RegularImmutableMap
   * always have two or more elements, ImmutableMap.copyOf always return
   * a RegularImmutableMap back.
   */
  return (RegularImmutableMap<Object, Object>) ImmutableMap.copyOf(entries);
}
项目:googles-monorepo-demo    文件:SingletonImmutableTable_CustomFieldSerializer.java   
public static SingletonImmutableTable<Object, Object, Object> instantiate(
    SerializationStreamReader reader) throws SerializationException {
  Object rowKey = reader.readObject();
  Object columnKey = reader.readObject();
  Object value = reader.readObject();
  return new SingletonImmutableTable<Object, Object, Object>(rowKey, columnKey, value);
}
项目:googles-monorepo-demo    文件:Multiset_CustomFieldSerializerBase.java   
static void serialize(SerializationStreamWriter writer, Multiset<?> instance)
    throws SerializationException {
  int entryCount = instance.entrySet().size();
  writer.writeInt(entryCount);
  for (Multiset.Entry<?> entry : instance.entrySet()) {
    writer.writeObject(entry.getElement());
    writer.writeInt(entry.getCount());
  }
}
项目:guava-mock    文件:PairwiseEquivalence_CustomFieldSerializer.java   
public static PairwiseEquivalence<?> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  return create((Equivalence<?>) reader.readObject());
}
项目:guava-mock    文件:PairwiseEquivalence_CustomFieldSerializer.java   
public static void serialize(SerializationStreamWriter writer, PairwiseEquivalence<?> instance)
    throws SerializationException {
  writer.writeObject(instance.elementEquivalence);
}
项目:guava-mock    文件:Present_CustomFieldSerializer.java   
public static Present<Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  return (Present<Object>) Optional.of(reader.readObject());
}
项目:googles-monorepo-demo    文件:ArrayListMultimap_CustomFieldSerializer.java   
public static ArrayListMultimap<Object, Object> instantiate(SerializationStreamReader in)
    throws SerializationException {
  return (ArrayListMultimap<Object, Object>)
      Multimap_CustomFieldSerializerBase.populate(in, ArrayListMultimap.create());
}
项目:googles-monorepo-demo    文件:ByFunctionOrdering_CustomFieldSerializer.java   
@SuppressWarnings("unchecked") // deserialization is unsafe
public static ByFunctionOrdering<Object, Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  return new ByFunctionOrdering<Object, Object>(
      (Function<Object, Object>) reader.readObject(), (Ordering<Object>) reader.readObject());
}
项目:guava-mock    文件:HashMultiset_CustomFieldSerializer.java   
public static void serialize(SerializationStreamWriter writer, HashMultiset<?> instance)
    throws SerializationException {
  Multiset_CustomFieldSerializerBase.serialize(writer, instance);
}
项目:googles-monorepo-demo    文件:SingletonImmutableSet_CustomFieldSerializer.java   
public static SingletonImmutableSet<Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  Object element = reader.readObject();
  return new SingletonImmutableSet<Object>(element);
}
项目:googles-monorepo-demo    文件:UnsignedLong_CustomFieldSerializer.java   
public static UnsignedLong instantiate(SerializationStreamReader reader)
    throws SerializationException {
  return UnsignedLong.fromLongBits(reader.readLong());
}