public class ValidatableParameterMap extends Object
ValidatableParameterMap serves as registry of parameters that can be used
to configure a ValidatableParameterMap.
A ParameterMap holds a list of Property instances upon its
initialization, therefore acting as a registry of allowed Propertys.
Furthermore, a ValidatableParameterMap supports setting values of its parameters
either directly or automatically.
Calling init()} on a given ValidatableParameterMap will change its state to
initialized and prevent further modification of its values, effectively making it immutable.
It is mandatory to call init() before obtaining values from a ValidatableParameterMap.
| Modifier and Type | Class | Description |
|---|---|---|
static class |
ValidatableParameterMap.Builder |
Builder for
ValidatableParameterMap |
| Modifier and Type | Method | Description |
|---|---|---|
ValidatableParameterMap |
add(Property p,
RDFNode node) |
Add a Statement to this
ValidatableParameterMap by specifying its predicate and object. |
ValidatableParameterMap |
add(StmtIterator it) |
|
static ValidatableParameterMap.Builder |
builder() |
Obtain a builder instance
|
static ValidatableParameterMap |
emptyInstance() |
|
RDFNode |
get(Property p) |
Get the first object for a given property as an
Optional. |
Optional<RDFNode> |
getOptional(Property p) |
Get the first object for a given property as an
Optional. |
Model |
getValidationModel() |
|
ValidatableParameterMap |
init() |
Initializes this
ValidatableParameterMap. |
Stream<RDFNode> |
listPropertyObjects(Property p) |
Get a stream of objects for the given property.
|
Model |
parametrize(Resource exNode) |
Apply the parameters stored in this
ValidatableParameterMap to the given
Resource representing a Parameterized. |
ValidatableParameterMap |
populate(Resource root) |
Populate the ValidatableParameterMap with data taken from the
Model attached to the
given Resource. |
public static ValidatableParameterMap emptyInstance()
public static ValidatableParameterMap.Builder builder()
public ValidatableParameterMap populate(Resource root)
Model attached to the
given Resource.root - this Resource needs to be backed by a Modelpublic ValidatableParameterMap add(StmtIterator it)
public ValidatableParameterMap add(Property p, RDFNode node)
ValidatableParameterMap by specifying its predicate and object.
If the object is not a literal, its subgraph is also added to the Model backing
this ValidatableParameterMap by depth-first search.
Infinite loops from cyclical subgraphs are prevented by maintaining a set of visited resources.public ValidatableParameterMap init()
ValidatableParameterMap.
Initializing effectively disables all writing operations (attempting to write will result in exceptions)
and enables all reading operations.public Stream<RDFNode> listPropertyObjects(Property p)
public Optional<RDFNode> getOptional(Property p)
Optional.public Model parametrize(Resource exNode)
ValidatableParameterMap to the given
Resource representing a Parameterized.Resourcepublic Model getValidationModel()
Copyright © 2019. All rights reserved.