com.h3c.util.json

## Class AbstractJsonFactory

- java.lang.Object
- - com.h3c.util.json.AbstractJsonFactory

- All Implemented Interfaces:
    JsonFactory
  Direct Known Subclasses:
    CoreServicesJsonFactory, NetworkServicesJsonFactory, OfJsonFactory

      public abstract class AbstractJsonFactory
      extends Object
      implements JsonFactory

  An abstract JsonFactory. All sub-classes of this class should be singletons.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractJsonFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCodecs(Class<?> pojo, JsonCodec<?> codec)`
    `void` | `clearCodecs()`
    `JsonCodec<?>` | `codec(Class<?> pojo)` Returns a given codec for the given POJO.
    `boolean` | `hasCodec(Class<?> pojo)` Sees if this JsonFactory has a codec for the given POJO class.
    `int` | `hashCode()`
    `void` | `removeCodecs(Class<?> pojo)`
    `InputStream` | `schema()` Returns the JSON schema for this factory.

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

      `clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractJsonFactory

          protected AbstractJsonFactory()

  - ### Method Detail

    - #### addCodecs

          public void addCodecs(Class<?> pojo,
                       JsonCodec<?> codec)

    - #### removeCodecs

          public void removeCodecs(Class<?> pojo)

    - #### clearCodecs

          public void clearCodecs()

    - #### schema

          public InputStream schema()

      Description copied from interface: `JsonFactory`
      Returns the JSON schema for this factory.
      Specified by:
        `schema` in interface `JsonFactory`
      Returns:
        JSON schema for this factory

    - #### codec

          public JsonCodec<?> codec(Class<?> pojo)

      Description copied from interface: `JsonFactory`
      Returns a given codec for the given POJO.
      Specified by:
        `codec` in interface `JsonFactory`
      Parameters:
        `pojo` - POJO for which a JSON codec is requested.
      Returns:
        a JSON codec for the given POJO.

    - #### hasCodec

          public boolean hasCodec(Class<?> pojo)

      Description copied from interface: `JsonFactory`
      Sees if this JsonFactory has a codec for the given POJO class.
      Specified by:
        `hasCodec` in interface `JsonFactory`
      Parameters:
        `pojo` - POJO class to be encoded/decoded
      Returns:
        true if there is a codec, false otherwise

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2014. All Rights Reserved.