title: JSONSchema parsing and processing in Java
body: <p>There is a perfect .NET library Json.NET Schema. I use it in my C# application to parse schemas and make a <code>Dictionary&lt;string, JSchema&gt;</code> with pairs "name_of_simple_element" - "simple_element". Then I process each pair and for example try to find "string" type elements with pattern "[a-z]" or "string" elements with maximumLength > 300.
  Now I should create application with same functions in Java. It is very simple in C#:</p>
  
  <pre><code>Jschema schema = JSchema.Parse(string json);
  IDictionary&lt;string, JSchema&gt; dict = schema.Properties; 
  ... etc.
  </code></pre>
  
  <p>But i cant find same way to do that in Java. I need to convert this</p>
  
  <pre><code>{
      "$schema": "http://json-schema.org/draft-04/schema#",
      "id": "http://iitrust.ru",
      "type": "object",
      "properties": {
          "regions": {
              "id": "...regions",
              "type": "array",
              "items": {
                  "id": "http://iitrust.ru/regions/0",
                  "type": "object",
                  "properties": {
                      "id": {
                          "id": "...id",
                          "type": "string",
                          "pattern": "^[0-9]+$",
                          "description": "Идентификатор региона"
                      },
                      "name": {
                          "id": "...name",
                          "type": "string",
                          "maxLength": 255,
                          "description": "Наименование региона"
                      },
                      "code": {
                          "id": "...code",
                          "type": "string",
                          "pattern": "^[0-9]{1,3}$",
                          "description": "Код региона"
                      }
                  },
                  "additionalProperties": false,
                  "required": ["id",
                  "name",
                  "code"]
              }
          }
      },
      "additionalProperties": false,
      "required": ["regions"]
  }
  </code></pre>
  
  <p>to pseudocode dictionary/map like this</p>
  
  <pre><code>["...id" : "id": { ... };
  "...name" : "name": { ... };
  "...code":  "code": { ... }]
  </code></pre>
  
  <p>What is the best way to do that? </p>