Class JsonSchemaMap
java.lang.Object
java.util.AbstractMap<K,V>
 
java.util.concurrent.ConcurrentHashMap<URI,JsonSchema>
 
org.apache.juneau.bean.jsonschema.JsonSchemaMap
- All Implemented Interfaces:
- Serializable,- ConcurrentMap<URI,,- JsonSchema> - Map<URI,- JsonSchema> 
A container for retrieving JSON 
JsonSchema objects by URI.
 Subclasses must implement one of the following methods to load schemas from external sources:
- 
      getReader(URI)- If schemas should be loaded from readers and automatically parsed.
- 
      load(URI)- If you want control over construction ofJsonSchemaobjects.
- 
Nested Class SummaryNested classes/interfaces inherited from class java.util.concurrent.ConcurrentHashMapConcurrentHashMap.KeySetView<K extends Object,V extends Object> Nested classes/interfaces inherited from class java.util.AbstractMapAbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionadd(JsonSchema... schemas) Convenience method for pre-populating this map with the specified schemas.Return theJsonSchemaobject at the specified URI.Subclasses must implement either this method orload(URI)to load the schema with the specified URI.Subclasses must implement either this method orgetReader(URI)to load the schema with the specified URI.Methods inherited from class java.util.concurrent.ConcurrentHashMapclear, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, merge, newKeySet, newKeySet, put, putAll, putIfAbsent, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, remove, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, valuesMethods inherited from class java.util.AbstractMapclone
- 
Constructor Details- 
JsonSchemaMappublic JsonSchemaMap()
 
- 
- 
Method Details- 
getReturn theJsonSchemaobject at the specified URI.If this schema object has not been loaded yet, calls load(URI).The value can be of any of the following types: URI,URL,String. Strings must be valid URIs.URIs defined by UriResolvercan be used for values.- Specified by:
- getin interface- Map<URI,- JsonSchema> 
- Overrides:
- getin class- ConcurrentHashMap<URI,- JsonSchema> 
- Parameters:
- uri- The URI of the schema to retrieve.
- Returns:
- The JsonSchema, or null if schema was not located and could not be loaded.
 
- 
addConvenience method for pre-populating this map with the specified schemas.The schemas passed in through this method MUST have their ID properties set. - Parameters:
- schemas- The set of schemas to add to this map.
- Returns:
- This object.
- Throws:
- RuntimeException- If one or more schema objects did not have their ID property set.
 
- 
loadSubclasses must implement either this method orgetReader(URI)to load the schema with the specified URI.It's up to the implementer to decide where these come from. The default implementation calls getReader(URI)and parses the schema document. IfgetReader(URI)returnsnull , this method returnsnull indicating this is an unreachable document.- Parameters:
- uri- The URI to load the schema from.
- Returns:
- The parsed schema.
 
- 
getReaderSubclasses must implement either this method orload(URI)to load the schema with the specified URI.It's up to the implementer to decide where these come from. The default implementation returns null .- Parameters:
- uri- The URI to connect to and retrieve the contents.
- Returns:
- The reader from reading the specified URI.
 
 
-