Class YamlSemanticCatalog
java.lang.Object
de.iip_ecosphere.platform.support.iip_aas.YamlSemanticCatalog
A simple Yaml-based semantic catalog for testing/shipping with the platform.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA default Yaml-based resolver. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult> Returns the definitions.static YamlSemanticCatalogread(InputStream input) Reads a Yaml semantic catalog from an input stream.static YamlSemanticCatalogreadSafe(InputStream input) Reads a Yaml semantic catalog from an input stream logging IO exceptions.voidsetDefinitions(List<de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult> definitions) Defines the definitions.toMap(YamlSemanticCatalog catalog, Function<de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult, de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult> adjuster) Turns a semantic catalog into a resolution map.
-
Field Details
-
definitions
private List<de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult> definitions
-
-
Constructor Details
-
YamlSemanticCatalog
public YamlSemanticCatalog()
-
-
Method Details
-
getDefinitions
public List<de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult> getDefinitions()Returns the definitions.- Returns:
- the definitions
-
setDefinitions
public void setDefinitions(List<de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult> definitions) Defines the definitions. [snakeyaml]- Parameters:
definitions- the definitions
-
read
Reads a Yaml semantic catalog from an input stream.- Parameters:
input- the input stream- Returns:
- the catalog
- Throws:
IOException- if the catalog cannot be read
-
readSafe
Reads a Yaml semantic catalog from an input stream logging IO exceptions.- Parameters:
input- the input stream- Returns:
- the catalog
-
toMap
public static Map<String,de.iip_ecosphere.platform.support.semanticId.SemanticIdResolutionResult> toMap(YamlSemanticCatalog catalog, Function<de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult, de.iip_ecosphere.platform.support.semanticId.DefaultSemanticIdResolutionResult> adjuster) Turns a semantic catalog into a resolution map.- Parameters:
catalog- the catalogadjuster- optional function to set, e.g., default values for a catalog (may be null)- Returns:
- the resolution map
-