title: validate a Java POJO using JSON schema or equivalent?
body: <p>It's there a way or technology like JSON schema in which I get a JSON description of the data structure and I can validate in JAVA if fits the description.
  I want something like JSON schema to validate incoming data, but I want to validate that the POJOs or Maps as Java objects, not the JSON document themselves.</p>
  
  <p>Make the POJO a JSON just to validate it isn't a practical option, thanks!</p>
  
  <p>is a way to do this with JSON schema or any other technologies? </p>
  
  <p>UPDATE: SUMMARY 
  AS far as I know: JSON Schema is a JSON document used to validate JSON documents. I want a schema written in JSON to validate Java POJOs.</p>
  
  <p>the example below (I use the validate as a static function of class Validator ):</p>
  
  <pre><code>public static void main(String[] args) {
          String schema = "{\n" +
                  "  \"type\": \"object\",\n" +
                  "  \"properties\": {\n" +
                  "    \"street_address\": { \"type\": \"string\" },\n" +
                  "    \"city\":           { \"type\": \"string\" },\n" +
                  "    \"state\":          { \"type\": \"string\" }\n" +
                  "  },\n" +
                  "  \"required\": [\"street_address\", \"city\", \"state\"]\n" +
                  "}";
          Object foo = new Hashtable();
  
          ((Map)foo).put("street_address","first street");
          ((Map)foo).put("street_address","The city");
          ((Map)foo).put("street_address","Not the USA");
  
          Validator validator = new Validator(schema);
  
          if (Validator.validate(foo, schema)) {
              System.out.println("It's validated");
          } else
              System.err.println("It isn't validated");
      }
  </code></pre>