GenericModelSerializer (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.util.model

## Class GenericModelSerializer

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

- All Implemented Interfaces:
    ArtifactSerializer<AbstractModel>

      public class GenericModelSerializer
      extends Object
      implements ArtifactSerializer<AbstractModel>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GenericModelSerializer()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AbstractModel` | `create(InputStream in)` Creates the artifact from the provided `InputStream`.
    `static void` | `register(Map<String,ArtifactSerializer> factories)`
    `void` | `serialize(AbstractModel artifact, OutputStream out)` Serializes the artifact to the provided `OutputStream`.

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

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

- - ### Constructor Detail

    - #### GenericModelSerializer

          public GenericModelSerializer()

  - ### Method Detail

    - #### create

          public AbstractModel create(InputStream in)
                               throws IOException

      Description copied from interface: `ArtifactSerializer`
      Creates the artifact from the provided `InputStream`. The `InputStream` remains open.
      Specified by:
        `create` in interface `ArtifactSerializer<AbstractModel>`
      Returns:
        the artifact
      Throws:
        `IOException`

    - #### serialize

          public void serialize(AbstractModel artifact,
                                OutputStream out)
                         throws IOException

      Description copied from interface: `ArtifactSerializer`
      Serializes the artifact to the provided `OutputStream`. The `OutputStream` remains open.
      Specified by:
        `serialize` in interface `ArtifactSerializer<AbstractModel>`
      Throws:
        `IOException`

    - #### register

          public static void register(Map<String,ArtifactSerializer> factories)

Copyright © 2026 The Apache Software Foundation. All rights reserved.