io.vertx.reactivex.json.schema

## Class SchemaRouter

- java.lang.Object
- - io.vertx.reactivex.json.schema.SchemaRouter

-     public class SchemaRouter
      extends Object

  Represents a pool where parsed schemas are addressed and cached.

  It also contains a cache of including on top or inner level some json schemas that could eventually parsed later.

  You should not share this object between different threads

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<SchemaRouter>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SchemaRouter(Object delegate)`
    `SchemaRouter(SchemaRouter delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SchemaRouter` | `addJson(String uri, JsonObject object)` Add one or more json documents including schemas on top or inner levels.
    `SchemaRouter` | `addJson(URI uri, JsonObject object)` Add one or more json documents including schemas on top or inner levels.
    `SchemaRouter` | `addSchema(Schema schema, JsonPointer[] aliasScopes)` Add a parsed schema to this router.
    `SchemaRouter` | `addSchemaAlias(Schema schema, String alias)` Add an alias to a schema already registered in this router (this alias can be solved only from schema scope).
    `SchemaRouter` | `addSchemaWithScope(Schema schema, JsonPointer scope)` Add a parsed schema to this router.
    `static SchemaRouter` | `create(Vertx vertx, HttpClient client, FileSystem fs, SchemaRouterOptions schemaRouterOptions)` Create a new `SchemaRouter`
    `static SchemaRouter` | `create(Vertx vertx, SchemaRouterOptions schemaRouterOptions)` Create a new `SchemaRouter`
    `boolean` | `equals(Object o)`
    `SchemaRouter` | `getDelegate()`
    `int` | `hashCode()`
    `static SchemaRouter` | `newInstance(SchemaRouter arg)`
    `List<Schema>` | `registeredSchemas()`
    `Schema` | `resolveCachedSchema(JsonPointer refPointer, JsonPointer schemaScope, SchemaParser parser)` Resolve cached schema based on refPointer.
    `void` | `resolveRef(JsonPointer pointer, JsonPointer scope, SchemaParser schemaParser)` Like `resolveRef(io.vertx.reactivex.core.json.pointer.JsonPointer, io.vertx.reactivex.core.json.pointer.JsonPointer, io.vertx.reactivex.json.schema.SchemaParser, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.json.schema.Schema>>)` but with a direct callback.
    `void` | `resolveRef(JsonPointer pointer, JsonPointer scope, SchemaParser schemaParser, Handler<AsyncResult<Schema>> handler)` Like `resolveRef(io.vertx.reactivex.core.json.pointer.JsonPointer, io.vertx.reactivex.core.json.pointer.JsonPointer, io.vertx.reactivex.json.schema.SchemaParser, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.json.schema.Schema>>)` but with a direct callback.
    `Single<Schema>` | `rxResolveRef(JsonPointer pointer, JsonPointer scope, SchemaParser schemaParser)` Like `resolveRef(io.vertx.reactivex.core.json.pointer.JsonPointer, io.vertx.reactivex.core.json.pointer.JsonPointer, io.vertx.reactivex.json.schema.SchemaParser, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.json.schema.Schema>>)` but with a direct callback.
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<SchemaRouter> __TYPE_ARG

  - ### Constructor Detail

    - #### SchemaRouter

          public SchemaRouter(SchemaRouter delegate)

    - #### SchemaRouter

          public SchemaRouter(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getDelegate

          public SchemaRouter getDelegate()

    - #### resolveCachedSchema

          public Schema resolveCachedSchema(JsonPointer refPointer,
                                            JsonPointer schemaScope,
                                            SchemaParser parser)

      Resolve cached schema based on refPointer. If a schema isn't cached, it returns null
      Parameters:
        `refPointer` -
        `schemaScope` -
        `parser` -
      Returns:
        the resolved schema, or null if no schema was found

    - #### resolveRef

          public void resolveRef(JsonPointer pointer,
                                 JsonPointer scope,
                                 SchemaParser schemaParser,
                                 Handler<AsyncResult<Schema>> handler)

      Like `resolveRef(io.vertx.reactivex.core.json.pointer.JsonPointer, io.vertx.reactivex.core.json.pointer.JsonPointer, io.vertx.reactivex.json.schema.SchemaParser, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.json.schema.Schema>>)` but with a direct callback.
      Parameters:
        `pointer` -
        `scope` -
        `schemaParser` -
        `handler` -

    - #### resolveRef

          public void resolveRef(JsonPointer pointer,
                                 JsonPointer scope,
                                 SchemaParser schemaParser)

      Like `resolveRef(io.vertx.reactivex.core.json.pointer.JsonPointer, io.vertx.reactivex.core.json.pointer.JsonPointer, io.vertx.reactivex.json.schema.SchemaParser, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.json.schema.Schema>>)` but with a direct callback.
      Parameters:
        `pointer` -
        `scope` -
        `schemaParser` -

    - #### rxResolveRef

          public Single<Schema> rxResolveRef(JsonPointer pointer,
                                             JsonPointer scope,
                                             SchemaParser schemaParser)

      Like `resolveRef(io.vertx.reactivex.core.json.pointer.JsonPointer, io.vertx.reactivex.core.json.pointer.JsonPointer, io.vertx.reactivex.json.schema.SchemaParser, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.reactivex.json.schema.Schema>>)` but with a direct callback.
      Parameters:
        `pointer` -
        `scope` -
        `schemaParser` -
      Returns:

    - #### addSchemaWithScope

          public SchemaRouter addSchemaWithScope(Schema schema,
                                                 JsonPointer scope)

      Add a parsed schema to this router. When a schema is added to the cache, a new entry is created for the provided scope, but NOT for `Schema.getScope()`. This may be useful to register links to singleton schemas. This method is automatically called by `SchemaParser` when a new schema is parsed
      Parameters:
        `schema` - schema to add
        `scope` -
      Returns:
        a reference to this

    - #### addSchemaAlias

          public SchemaRouter addSchemaAlias(Schema schema,
                                             String alias)

      Add an alias to a schema already registered in this router (this alias can be solved only from schema scope).
      Parameters:
        `schema` - schema to add
        `alias` - the schema alias
      Returns:
        a reference to this

    - #### addJson

          public SchemaRouter addJson(String uri,
                                      JsonObject object)

      Add one or more json documents including schemas on top or inner levels. This method doesn't trigger the schema parsing

      You can use this schema if you have externally loaded some json document and you want to register to the schema router. You can later parse and retrieve a schema from this json structure using , providing the correct `refPointer`

      Parameters:
        `uri` -
        `object` -
      Returns:
        a reference to this

    - #### registeredSchemas

          public List<Schema> registeredSchemas()

      Returns:
        a list of all registered schemas

    - #### create

          public static SchemaRouter create(Vertx vertx,
                                            SchemaRouterOptions schemaRouterOptions)

      Create a new `SchemaRouter`
      Parameters:
        `vertx` -
        `schemaRouterOptions` -
      Returns:

    - #### create

          public static SchemaRouter create(Vertx vertx,
                                            HttpClient client,
                                            FileSystem fs,
                                            SchemaRouterOptions schemaRouterOptions)

      Create a new `SchemaRouter`
      Parameters:
        `vertx` -
        `client` -
        `fs` -
        `schemaRouterOptions` -
      Returns:

    - #### addSchema

          public SchemaRouter addSchema(Schema schema,
                                        JsonPointer[] aliasScopes)

      Add a parsed schema to this router. When a schema is added to the cache, a new entry is created for `Schema.getScope()` and, if you provide additional aliasScopes, this method register links to this schema with these scopes. This method is automatically called by `SchemaParser` when a new schema is parsed
      Parameters:
        `schema` - schema to add
        `aliasScopes` -
      Returns:
        a reference to this

    - #### addJson

          public SchemaRouter addJson(URI uri,
                                      JsonObject object)

      Add one or more json documents including schemas on top or inner levels. This method doesn't trigger the schema parsing

      You can use this schema if you have externally loaded some json document and you want to register to the schema router. You can later parse and retrieve a schema from this json structure using , providing the correct `refPointer`

      Parameters:
        `uri` -
        `object` -
      Returns:
        a reference to this

    - #### newInstance

          public static SchemaRouter newInstance(SchemaRouter arg)

Copyright © 2022 Eclipse. All rights reserved.