org.infinispan.schematic.internal.schema

## Class DocumentTransformer

- java.lang.Object
- - org.infinispan.schematic.internal.schema.DocumentTransformer

-     public class DocumentTransformer
      extends Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `DocumentTransformer.Conversion`
    `protected static class` | `DocumentTransformer.PropertiesAccessor`
    `static class` | `DocumentTransformer.PropertiesTransformer` An implementation of `Document.ValueTransformer` that replaces variables in the field values with values from the system properties.
    `protected static interface` | `DocumentTransformer.PropertyAccessor`
    `static class` | `DocumentTransformer.SystemPropertiesTransformer` An implementation of `Document.ValueTransformer` that replaces variables in the field values with values from the system properties.
    `protected static class` | `DocumentTransformer.SystemPropertyAccessor`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DocumentTransformer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static Document` | `convertValuesWithMismatchedTypes(Document original, int level, LinkedList<DocumentTransformer.Conversion> conversions)`
    `static Document` | `convertValuesWithMismatchedTypes(Document original, SchemaLibrary.Results results)` Return a copy of the supplied document that contains converted values for all of the fields (including in the nested documents and arrays) that have values that are of the wrong type but can be converted to be of the correct type.
    `static String` | `getSubstitutedProperty(String value, DocumentTransformer.PropertyAccessor propertyAccessor)` getSubstitutedProperty is called to perform the property substitution on the value.

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

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

- - ### Constructor Detail

    - #### DocumentTransformer

          public DocumentTransformer()

  - ### Method Detail

    - #### getSubstitutedProperty

          public static String getSubstitutedProperty(String value,
                                      DocumentTransformer.PropertyAccessor propertyAccessor)

      getSubstitutedProperty is called to perform the property substitution on the value.
      Parameters:
        `value` -
        `propertyAccessor` -
      Returns:
        String

    - #### convertValuesWithMismatchedTypes

          public static Document convertValuesWithMismatchedTypes(Document original,
                                                  SchemaLibrary.Results results)

      Return a copy of the supplied document that contains converted values for all of the fields (including in the nested documents and arrays) that have values that are of the wrong type but can be converted to be of the correct type.

      This method does nothing and returns the original document if there are no changes to be made.

      Parameters:
        `original` - the original document that contains fields with mismatched values; may not be null
        `results` - the results of the `JSON Schema validation` and which contains the `type mismatch errors`
      Returns:
        the document with all of the conversions made the its fields and the fields of nested documents, or the original document if there are no conversions to be made; never null

    - #### convertValuesWithMismatchedTypes

          protected static Document convertValuesWithMismatchedTypes(Document original,
                                                  int level,
                                                  LinkedList<DocumentTransformer.Conversion> conversions)

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