org.infinispan.schematic.internal

## Class DocumentValidationMapper

- java.lang.Object
- - org.infinispan.schematic.internal.DocumentValidationMapper

- All Implemented Interfaces:
    Serializable, Mapper<String,SchematicEntry,String,SchemaLibrary.Results>

      public class DocumentValidationMapper
      extends Object
      implements Mapper<String,SchematicEntry,String,SchemaLibrary.Results>

  A `Mapper` implementation that validates `JSON Documents` within Infinispan's Map-Reduce framework.
  Since:
    5.1
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DocumentValidationMapper(DocumentLibrary schemaLibrary, String defaultSchemaUri)` Create a new instance of the document validation `Mapper`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `map(String key, SchematicEntry value, Collector<String,SchemaLibrary.Results> collector)`
    `SchemaLibrary.Results` | `validate(String key, SchematicEntry value)`

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

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

- - ### Constructor Detail

    - #### DocumentValidationMapper

          public DocumentValidationMapper(DocumentLibrary schemaLibrary,
                                  String defaultSchemaUri)

      Create a new instance of the document validation `Mapper`.
      Parameters:
        `schemaLibrary` - the serializable document library containing all required/available JSON Schema documents; may not be null
        `defaultSchemaUri` - the URI of the JSON Schema that should be used for JSON documents that have not been associated with a schema (via the "`schemaUri`" field in the document's metadata); may be null if JSON documents without a schema reference should be skipped and not validated

  - ### Method Detail

    - #### map

          public void map(String key,
                 SchematicEntry value,
                 Collector<String,SchemaLibrary.Results> collector)

      Specified by:
        `map` in interface `Mapper<String,SchematicEntry,String,SchemaLibrary.Results>`

    - #### validate

          public SchemaLibrary.Results validate(String key,
                                       SchematicEntry value)

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.