Example usage for com.fasterxml.jackson.datatype.hppc HppcModule HppcModule

List of usage examples for com.fasterxml.jackson.datatype.hppc HppcModule HppcModule

Introduction

In this page you can find the example usage for com.fasterxml.jackson.datatype.hppc HppcModule HppcModule.

Prototype

public HppcModule() 

Source Link

Usage

From source file:org.dice_research.topicmodeling.lang.DictionaryDictCC.java

@Override
public void saveAsObjectFile() {
    if (localDictionaryChanged) {
        FileOutputStream fout = null;
        try {/*from w w w  .j a v a2 s  .  c  o  m*/
            String filename = DICTIONARY_FILE_NAME;
            if (System.getProperty(SYSTEM_PROPERTY_NAME_FILE_APPENDIX) != null) {
                filename = filename.replace("$APPENDIX$",
                        System.getProperty(SYSTEM_PROPERTY_NAME_FILE_APPENDIX));
            } else {
                filename = filename.replace("$APPENDIX$", "");
            }
            fout = new FileOutputStream(filename);
            ObjectMapper mapper = new ObjectMapper();
            mapper.registerModule(new HppcModule());
            mapper.writeValue(fout, dictionary);
            localDictionaryChanged = false;
        } catch (IOException e) {
            LOGGER.error("Error while writing the serialized dictionary to file.", e);
        } finally {
            try {
                fout.close();
            } catch (Exception e) {
            }
        }
    }
}