org.apache.synapse.commons.json.jsonprocessor.validators

## Class StringValidator

- java.lang.Object
- - org.apache.synapse.commons.json.jsonprocessor.validators.StringValidator

-     public class StringValidator
      extends Object

  This class validate strings against the given schema object.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static com.google.gson.JsonPrimitive` | `validateNominal(com.google.gson.JsonObject inputObject, String value)` Validate a given string against its schema.

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

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

- - ### Method Detail

    - #### validateNominal

          public static com.google.gson.JsonPrimitive validateNominal(com.google.gson.JsonObject inputObject,
                                                                      String value)
                                                               throws ValidatorException,
                                                                      ParserException

      Validate a given string against its schema.
      Parameters:
        `inputObject` - json schema as an object.
        `value` - input string.
      Returns:
        if valid return a JsonPrimitive created using input string.
      Throws:
        `ValidatorException` - Didn't met validation criteria.
        `ParserException` - Exception occurs in data type conversions.

Copyright © 2005–2020 Apache Software Foundation. All rights reserved.