本文整理汇总了Java中org.objenesis.strategy.SerializingInstantiatorStrategy类的典型用法代码示例。如果您正苦于以下问题:Java SerializingInstantiatorStrategy类的具体用法?Java SerializingInstantiatorStrategy怎么用?Java SerializingInstantiatorStrategy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SerializingInstantiatorStrategy类属于org.objenesis.strategy包,在下文中一共展示了SerializingInstantiatorStrategy类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserializeFrom
import org.objenesis.strategy.SerializingInstantiatorStrategy; //导入依赖的package包/类
@Override
public Object deserializeFrom(final String filename)
throws SerializationException {
LOGGER.info("Deserializing object from " + filename);
try {
final Kryo kryo = new Kryo();
final Input input = new Input(new FileInputStream(filename));
kryo.setInstantiatorStrategy(new SerializingInstantiatorStrategy());
final Object obj = kryo.readClassAndObject(input);
input.close();
return obj;
} catch (final FileNotFoundException e) {
throw new ISerializationStrategy.SerializationException(e);
}
}
示例2: getKryoObject
import org.objenesis.strategy.SerializingInstantiatorStrategy; //导入依赖的package包/类
private Kryo getKryoObject() {
Kryo kryo = new Kryo();
kryo.setInstantiatorStrategy(new SerializingInstantiatorStrategy());
kryo.register(KMeansDetectionModel.class);
kryo.register(AthenaMLFeatureConfiguration.class);
kryo.register(DetectionModel.class);
kryo.register(FeatureConstraint.class);
kryo.register(AthenaFeatureField.class);
kryo.register(AthenaIndexField.class);
kryo.register(AthenaField.class);
kryo.register(FeatureConstraintOperator.class);
kryo.register(FeatureConstraintOperatorType.class);
kryo.register(FeatureConstraintType.class);
kryo.register(AthenaMLFeatureConfiguration.class);
kryo.register(Marking.class);
kryo.register(FeatureDatabaseMgmtManager.class);
kryo.register(Indexing.class);
kryo.register(ClusterModelSummary.class);
kryo.register(KMeansDetectionAlgorithm.class);
kryo.register(KmeansModelSummary.class);
kryo.register(Accumulator.class);
kryo.register(ClusterModelSummary.UniqueFlowAccumulatorParam.class);
kryo.register(ClusterModelSummary.LongAccumulatorParam.class);
kryo.register(ClassificationMarkingElement.class);
kryo.register(TargetAthenaValue.class);
return kryo;
}
示例3: ObjenesisSerializer
import org.objenesis.strategy.SerializingInstantiatorStrategy; //导入依赖的package包/类
/**
* Default constructor using the {@link org.objenesis.strategy.SerializingInstantiatorStrategy}
*/
public ObjenesisSerializer() {
super(new SerializingInstantiatorStrategy());
}