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

## Class StringValidator

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

-     public class StringValidator
      extends java.lang.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, java.lang.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,
                                                                      java.lang.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-2022 Apache Software Foundation. All Rights Reserved.