public abstract class SchemaMap extends ConcurrentHashMap<URI,Schema>
Schema
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 of Schema
objects.
ConcurrentHashMap.KeySetView<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
SchemaMap() |
Modifier and Type | Method and Description |
---|---|
SchemaMap |
add(Schema... schemas)
Convenience method for pre-populating this map with the specified schemas.
|
Schema |
get(Object uri)
Return the
Schema object at the specified URI. |
Reader |
getReader(URI uri)
Subclasses must implement either this method or
load(URI) to load the schema with the specified URI. |
Schema |
load(URI uri)
Subclasses must implement either this method or
getReader(URI) to load the schema with the specified URI. |
clear, 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, values
clone
public SchemaMap()
public SchemaMap add(Schema... schemas)
The schemas passed in through this method MUST have their ID properties set.
schemas
- The set of schemas to add to this map.RuntimeException
- If one or more schema objects did not have their ID property set.public Schema load(URI uri)
getReader(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.
If getReader(URI)
returns
uri
- The URI to load the schema from.public Reader getReader(URI uri)
load(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
uri
- The URI to connect to and retrieve the contents.Copyright © 2018 Apache. All rights reserved.