Java Code Examples for org.nd4j.shade.jackson.databind.ObjectMapper#addMixIn()

The following examples show how to use org.nd4j.shade.jackson.databind.ObjectMapper#addMixIn() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LegacyJsonFormat.java    From deeplearning4j with Apache License 2.0 6 votes vote down vote up
/**
 * Get a mapper (minus general config) suitable for loading old format JSON - 1.0.0-alpha and before
 * @return Object mapper
 */
public static ObjectMapper legacyMapper(){
    ObjectMapper om = new ObjectMapper();
    om.addMixIn(Schema.class, SchemaMixin.class);
    om.addMixIn(ColumnMetaData.class, ColumnMetaDataMixin.class);
    om.addMixIn(Transform.class, TransformMixin.class);
    om.addMixIn(Condition.class, ConditionMixin.class);
    om.addMixIn(Writable.class, WritableMixin.class);
    om.addMixIn(Filter.class, FilterMixin.class);
    om.addMixIn(SequenceComparator.class, SequenceComparatorMixin.class);
    om.addMixIn(SequenceSplit.class, SequenceSplitMixin.class);
    om.addMixIn(WindowFunction.class, WindowFunctionMixin.class);
    om.addMixIn(CalculateSortedRank.class, CalculateSortedRankMixin.class);
    om.addMixIn(WritableComparator.class, WritableComparatorMixin.class);
    om.addMixIn(ColumnAnalysis.class, ColumnAnalysisMixin.class);
    om.addMixIn(IStringReducer.class, IStringReducerMixin.class);
    return om;
}
 
Example 2
Source File: LegacyJsonFormat.java    From deeplearning4j with Apache License 2.0 5 votes vote down vote up
/**
 * Get a mapper (minus general config) suitable for loading old format JSON - 1.0.0-alpha and before
 * @return Object mapper
 */
public static ObjectMapper getMapper100alpha(){
    //After 1.0.0-alpha, we switched from wrapper object to @class for subtype information
    ObjectMapper om = new ObjectMapper();

    om.addMixIn(InputPreProcessor.class, InputPreProcessorMixin.class);
    om.addMixIn(GraphVertex.class, GraphVertexMixin.class);
    om.addMixIn(Layer.class, LayerMixin.class);
    om.addMixIn(ReconstructionDistribution.class, ReconstructionDistributionMixin.class);
    om.addMixIn(IActivation.class, IActivationMixin.class);
    om.addMixIn(ILossFunction.class, ILossFunctionMixin.class);

    return om;
}