Package com.esotericsoftware.kryo.factories

Examples of com.esotericsoftware.kryo.factories.ReflectionSerializerFactory


  /** Sets the serializer to use when no {@link #addDefaultSerializer(Class, Class) default serializers} match an object's type.
   * Default is {@link FieldSerializer}.
   * @see #newDefaultSerializer(Class) */
  public void setDefaultSerializer (Class<? extends Serializer> serializer) {
    if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
    defaultSerializer = new ReflectionSerializerFactory(serializer);
  }
View Full Code Here


   * Note that the order default serializers are added is important for a class that may match multiple types. The above default
   * serializers always have a lower priority than subsequent default serializers that are added. */
  public void addDefaultSerializer (Class type, Class<? extends Serializer> serializerClass) {
    if (type == null) throw new IllegalArgumentException("type cannot be null.");
    if (serializerClass == null) throw new IllegalArgumentException("serializerClass cannot be null.");
    DefaultSerializerEntry entry = new DefaultSerializerEntry(type, new ReflectionSerializerFactory(serializerClass));
    defaultSerializers.add(defaultSerializers.size() - lowPriorityDefaultSerializerCount, entry);
  }
View Full Code Here

  /** Sets the serializer to use when no {@link #addDefaultSerializer(Class, Class) default serializers} match an object's type.
   * Default is {@link FieldSerializer}.
   * @see #newDefaultSerializer(Class) */
  public void setDefaultSerializer (Class<? extends Serializer> serializer) {
    if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
    defaultSerializer = new ReflectionSerializerFactory(serializer);
  }
View Full Code Here

   * Note that the order default serializers are added is important for a class that may match multiple types. The above default
   * serializers always have a lower priority than subsequent default serializers that are added. */
  public void addDefaultSerializer (Class type, Class<? extends Serializer> serializerClass) {
    if (type == null) throw new IllegalArgumentException("type cannot be null.");
    if (serializerClass == null) throw new IllegalArgumentException("serializerClass cannot be null.");
    DefaultSerializerEntry entry = new DefaultSerializerEntry(type, new ReflectionSerializerFactory(serializerClass));
    defaultSerializers.add(defaultSerializers.size() - lowPriorityDefaultSerializerCount, entry);
  }
View Full Code Here

  /** Sets the serailzer to use when no {@link #addDefaultSerializer(Class, Class) default serializers} match an object's type.
   * Default is {@link FieldSerializer}.
   * @see #newDefaultSerializer(Class) */
  public void setDefaultSerializer (Class<? extends Serializer> serializer) {
    if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
    defaultSerializer = new ReflectionSerializerFactory(serializer);
  }
View Full Code Here

   * Note that the order default serializers are added is important for a class that may match multiple types. The above default
   * serializers always have a lower priority than subsequent default serializers that are added. */
  public void addDefaultSerializer (Class type, Class<? extends Serializer> serializerClass) {
    if (type == null) throw new IllegalArgumentException("type cannot be null.");
    if (serializerClass == null) throw new IllegalArgumentException("serializerClass cannot be null.");
    DefaultSerializerEntry entry = new DefaultSerializerEntry(type, new ReflectionSerializerFactory(serializerClass));
    defaultSerializers.add(defaultSerializers.size() - lowPriorityDefaultSerializerCount, entry);
  }
View Full Code Here

  /** Sets the serializer to use when no {@link #addDefaultSerializer(Class, Class) default serializers} match an object's type.
   * Default is {@link FieldSerializer}.
   * @see #newDefaultSerializer(Class) */
  public void setDefaultSerializer (Class<? extends Serializer> serializer) {
    if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
    defaultSerializer = new ReflectionSerializerFactory(serializer);
  }
View Full Code Here

   * Note that the order default serializers are added is important for a class that may match multiple types. The above default
   * serializers always have a lower priority than subsequent default serializers that are added. */
  public void addDefaultSerializer (Class type, Class<? extends Serializer> serializerClass) {
    if (type == null) throw new IllegalArgumentException("type cannot be null.");
    if (serializerClass == null) throw new IllegalArgumentException("serializerClass cannot be null.");
    DefaultSerializerEntry entry = new DefaultSerializerEntry(type, new ReflectionSerializerFactory(serializerClass));
    defaultSerializers.add(defaultSerializers.size() - lowPriorityDefaultSerializerCount, entry);
  }
View Full Code Here

  /** Sets the serializer to use when no {@link #addDefaultSerializer(Class, Class) default serializers} match an object's type.
   * Default is {@link FieldSerializer}.
   * @see #newDefaultSerializer(Class) */
  public void setDefaultSerializer (Class<? extends Serializer> serializer) {
    if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
    defaultSerializer = new ReflectionSerializerFactory(serializer);
  }
View Full Code Here

   * Note that the order default serializers are added is important for a class that may match multiple types. The above default
   * serializers always have a lower priority than subsequent default serializers that are added. */
  public void addDefaultSerializer (Class type, Class<? extends Serializer> serializerClass) {
    if (type == null) throw new IllegalArgumentException("type cannot be null.");
    if (serializerClass == null) throw new IllegalArgumentException("serializerClass cannot be null.");
    DefaultSerializerEntry entry = new DefaultSerializerEntry(type, new ReflectionSerializerFactory(serializerClass));
    defaultSerializers.add(defaultSerializers.size() - lowPriorityDefaultSerializerCount, entry);
  }
View Full Code Here

TOP

Related Classes of com.esotericsoftware.kryo.factories.ReflectionSerializerFactory

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.