Examples of StdInstantiatorStrategy


Examples of org.objenesis.strategy.StdInstantiatorStrategy

  }

  @SuppressWarnings("synthetic-access")
  public void testInstantiatorStrategy () {
    kryo.register(HasArgumentConstructor.class);
    kryo.setInstantiatorStrategy(new StdInstantiatorStrategy());
    HasArgumentConstructor test = new HasArgumentConstructor("cow");
    roundTrip(4, 4, test);

    kryo.register(HasPrivateConstructor.class);
    test = new HasPrivateConstructor();
View Full Code Here

Examples of org.objenesis.strategy.StdInstantiatorStrategy

  /** This test uses StdInstantiatorStrategy and should bypass invocation of no-arg constructor, even if it is provided. **/
  @SuppressWarnings("synthetic-access")
  public void testStdInstantiatorStrategy () {
    kryo.register(HasArgumentConstructor.class);
    kryo.setInstantiatorStrategy(new StdInstantiatorStrategy());
    HasArgumentConstructor test = new HasPrivateConstructor();
    HasPrivateConstructor.invocations = 0;

    kryo.register(HasPrivateConstructor.class);
    roundTrip(4, 4, test);
View Full Code Here

Examples of org.objenesis.strategy.StdInstantiatorStrategy

   /**
    * Default constructor using the {@link org.objenesis.strategy.StdInstantiatorStrategy}
    */
   public ObjenesisStd() {
      super(new StdInstantiatorStrategy());
   }
View Full Code Here

Examples of org.objenesis.strategy.StdInstantiatorStrategy

    * caching {@link org.objenesis.instantiator.ObjectInstantiator}s
    *
    * @param useCache If {@link org.objenesis.instantiator.ObjectInstantiator}s should be cached
    */
   public ObjenesisStd(boolean useCache) {
      super(new StdInstantiatorStrategy(), useCache);
   }
View Full Code Here

Examples of org.objenesis.strategy.StdInstantiatorStrategy

   /**
    * Default constructor using the {@link org.objenesis.strategy.StdInstantiatorStrategy}
    */
   public ObjenesisStd() {
      super(new StdInstantiatorStrategy());
   }
View Full Code Here

Examples of org.objenesis.strategy.StdInstantiatorStrategy

    * caching {@link org.objenesis.instantiator.ObjectInstantiator}s
    *
    * @param useCache If {@link org.objenesis.instantiator.ObjectInstantiator}s should be cached
    */
   public ObjenesisStd(boolean useCache) {
      super(new StdInstantiatorStrategy(), useCache);
   }
View Full Code Here

Examples of org.objenesis.strategy.StdInstantiatorStrategy

        };
        // The default strategy is needed so that HashMap is created via the constructor,
        // the StdInstantiatorStrategy (fallback) is needed for classes without default
        // constructor (e.g. DelegatingHandler).
        final DefaultInstantiatorStrategy instantiatorStrategy = new DefaultInstantiatorStrategy();
        instantiatorStrategy.setFallbackInstantiatorStrategy(new StdInstantiatorStrategy());
        kryo.setInstantiatorStrategy(instantiatorStrategy);
        kryo.register( CGLibProxySerializer.CGLibProxyMarker.class, new CGLibProxySerializer() );
        kryo.register( Arrays.asList( "" ).getClass(), new ArraysAsListSerializer() );
        return kryo;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.