Package ai.libs.hasco.serialization
Class ComponentLoader
- java.lang.Object
-
- ai.libs.hasco.serialization.ComponentLoader
-
public class ComponentLoader extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ComponentLoader()
ComponentLoader(boolean checkRequiredInterfacesResolvable)
ComponentLoader(java.io.File jsonFile)
ComponentLoader(java.io.File jsonFile, boolean checkRequiredInterfacesResolvable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.JsonNode
getComponentAsJsonNode(java.lang.String componentName)
java.util.Collection<Component>
getComponents()
Component
getComponentWithName(java.lang.String name)
This method searches for a component with the given name.java.util.Map<java.lang.String,com.fasterxml.jackson.databind.JsonNode>
getJsonNodeComponents()
java.util.Map<Component,java.util.Map<Parameter,ParameterRefinementConfiguration>>
getParamConfigs()
java.util.Collection<java.lang.String>
getUnresolvableRequiredInterfaces()
ComponentLoader
loadComponents(java.io.File componentDescriptionFile)
static void
main(java.lang.String[] args)
void
readFromString(java.lang.String json)
-
-
-
Constructor Detail
-
ComponentLoader
public ComponentLoader()
-
ComponentLoader
public ComponentLoader(boolean checkRequiredInterfacesResolvable)
-
ComponentLoader
public ComponentLoader(java.io.File jsonFile) throws java.io.IOException
- Throws:
java.io.IOException
-
ComponentLoader
public ComponentLoader(java.io.File jsonFile, boolean checkRequiredInterfacesResolvable) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
readFromString
public void readFromString(java.lang.String json) throws java.io.IOException
- Throws:
java.io.IOException
-
loadComponents
public ComponentLoader loadComponents(java.io.File componentDescriptionFile) throws java.io.IOException
- Throws:
java.io.IOException
-
getUnresolvableRequiredInterfaces
public java.util.Collection<java.lang.String> getUnresolvableRequiredInterfaces()
- Returns:
- Returns the collection of required interfaces that cannot be resolved by a provided interface.
-
getComponentAsJsonNode
public com.fasterxml.jackson.databind.JsonNode getComponentAsJsonNode(java.lang.String componentName)
- Parameters:
componentName
- The name of the component.- Returns:
- Returns the collection of required interfaces that cannot be resolved by a provided interface.
-
getParamConfigs
public java.util.Map<Component,java.util.Map<Parameter,ParameterRefinementConfiguration>> getParamConfigs()
- Returns:
- The map describing for each component individually how its parameters may be refined.
-
getComponents
public java.util.Collection<Component> getComponents()
- Returns:
- The collection of parsed components.
-
getComponentWithName
public Component getComponentWithName(java.lang.String name)
This method searches for a component with the given name. If such a component does not exist, a NoSuchElementException is thrown.- Parameters:
name
- The name of the component in question.- Returns:
- The component for the given name.
-
main
public static void main(java.lang.String[] args) throws java.io.IOException
- Throws:
java.io.IOException
-
getJsonNodeComponents
public java.util.Map<java.lang.String,com.fasterxml.jackson.databind.JsonNode> getJsonNodeComponents()
-
-