GenericModelSerializer (Apache OpenNLP :: Core :: Runtime 3.0.0-M4 API)
Description: declaration: package: opennlp.tools.util.model, class: GenericModelSerializer

Package opennlp.tools.util.model

# Class GenericModelSerializer

java.lang.Object
opennlp.tools.util.model.GenericModelSerializer

All Implemented Interfaces:
  `opennlp.tools.util.model.ArtifactSerializer<opennlp.tools.ml.model.AbstractModel>`

public class GenericModelSerializer extends Object implements opennlp.tools.util.model.ArtifactSerializer<opennlp.tools.ml.model.AbstractModel>
An `ArtifactSerializer` implementation for `models`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GenericModelSerializer()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `opennlp.tools.ml.model.AbstractModel`
  `create(InputStream in)`
  `static void`
  `register(Map<String,opennlp.tools.util.model.ArtifactSerializer<?>> factories)`
  Registers a new `GenericModelSerializer` in the given `factories` mapping.
  `void`
  `serialize(opennlp.tools.ml.model.AbstractModel artifact, OutputStream out)`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### GenericModelSerializer

    public GenericModelSerializer()

- ## Method Details

  - ### create

    public opennlp.tools.ml.model.AbstractModel create(InputStream in) throws IOException
    Specified by:
      `create` in interface `opennlp.tools.util.model.ArtifactSerializer<opennlp.tools.ml.model.AbstractModel>`
    Throws:
      `IOException`

  - ### serialize

    public void serialize(opennlp.tools.ml.model.AbstractModel artifact, OutputStream out) throws IOException
    Specified by:
      `serialize` in interface `opennlp.tools.util.model.ArtifactSerializer<opennlp.tools.ml.model.AbstractModel>`
    Throws:
      `IOException`

  - ### register

    public static void register(Map<String,opennlp.tools.util.model.ArtifactSerializer<?>> factories)
    Registers a new `GenericModelSerializer` in the given `factories` mapping.
    Parameters:
      `factories` - A `Map` holding `ArtifactSerializer` for re-use.