public abstract class Validator extends Object implements SimpleValidator<Object>
Each validator that responsible validate one certain type of object MUST extend this class.
Modifier and Type | Field and Description |
---|---|
protected boolean |
required
Whether the schema represented by this validator is required.
|
Constructor and Description |
---|
Validator(Map<String,Object> schema,
List<String> jsonPointer)
Default ctor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
collectAllValidators(Collection<Validator> results)
Collects all the sub-validators held in this validator and aggregates them in the passed in Collection.
|
protected static void |
collectAllValidators(Collection<Validator> results,
Collection<? extends Validator> col)
Collects all the sub-validators held in this validator and aggregates them in the passed in Collection.
|
protected static void |
collectAllValidators(Collection<Validator> results,
Map<?,? extends Validator> map)
Collects all the sub-validators held in this validator and aggregates them in the passed in Collection.
|
JsonPointer |
getJsonPointer()
Returns the JSON pointer locating where the validator was defined in the schema.
|
protected JsonPointer |
getPath(JsonPointer at,
String property)
Gets the valid JSONPath of the node or the given property.
|
boolean |
isRequired()
Returns whether the schema represented by this validator is required.
|
protected List<String> |
newList(List<String> list,
String... newElems)
Returns a new
List with the additional elements appended at the end. |
void |
resolveSchemaReferences()
Resolves schema references for this validator.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
validate
protected boolean required
protected final JsonPointer getPath(JsonPointer at, String property)
at
- JSONPath of the current node. If it's null then the value is /
property
- Property name of the child node.protected List<String> newList(List<String> list, String... newElems)
List
with the additional elements appended at the end.list
- the list to copynewElems
- the new elements to appendList
with the additional elements appended at the end.public JsonPointer getJsonPointer()
public boolean isRequired()
public void resolveSchemaReferences()
Constants.REF
protected void collectAllValidators(Collection<Validator> results)
results
- where collected validators are aggregatedprotected static void collectAllValidators(Collection<Validator> results, Collection<? extends Validator> col)
results
- where collected validators are aggregatedcol
- the sub-validators for which to collect other sub-validatorsprotected static void collectAllValidators(Collection<Validator> results, Map<?,? extends Validator> map)
results
- where collected validators are aggregatedmap
- the sub-validators for which to collect other sub-validatorsCopyright © 2025 Open Identity Platform Community. All rights reserved.