Class MultiSubmodelElementProvider
- java.lang.Object
-
- org.eclipse.basyx.submodel.restapi.MultiSubmodelElementProvider
-
- All Implemented Interfaces:
IModelProvider
public class MultiSubmodelElementProvider extends Object implements IModelProvider
Provider that handles container properties. Container properties can contain other submodel elements.- Author:
- espen, conradi
-
-
Constructor Summary
Constructors Constructor Description MultiSubmodelElementProvider(IModelProvider provider)
Constructor based on a model provider that contains the container property
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createValue(String path, Object newEntity)
Create a new value under the given pathvoid
deleteValue(String path)
Deletes value under the given pathvoid
deleteValue(String path, Object obj)
Deletes an entry from a map or collection by the given keyprotected Collection<Map<String,Object>>
getElementsList()
The elements are stored in a map => convert them to a listObject
getValue(String path)
Gets a value stored in a given pathObject
invokeOperation(String path, Object... parameters)
Invoke an operationvoid
setValue(String path, Object newValue)
Sets or overrides existing value in a given path
-
-
-
Field Detail
-
ELEMENTS
public static final String ELEMENTS
- See Also:
- Constant Field Values
-
VALUE
public static final String VALUE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MultiSubmodelElementProvider
public MultiSubmodelElementProvider(IModelProvider provider)
Constructor based on a model provider that contains the container property
-
-
Method Detail
-
getElementsList
protected Collection<Map<String,Object>> getElementsList()
The elements are stored in a map => convert them to a list
-
getValue
public Object getValue(String path) throws ProviderException
Description copied from interface:IModelProvider
Gets a value stored in a given path- Specified by:
getValue
in interfaceIModelProvider
- Parameters:
path
- Path to the requested value- Returns:
- Object type is assumed to be [Integer | ... | Collection]
- Throws:
ProviderException
-
setValue
public void setValue(String path, Object newValue) throws ProviderException
Description copied from interface:IModelProvider
Sets or overrides existing value in a given path- Specified by:
setValue
in interfaceIModelProvider
- Parameters:
path
- Path to the requested valuenewValue
- Updated value- Throws:
ProviderException
-
createValue
public void createValue(String path, Object newEntity) throws ProviderException
Description copied from interface:IModelProvider
Create a new value under the given path- Specified by:
createValue
in interfaceIModelProvider
- Parameters:
path
- Path to the entity where the element should be creatednewEntity
- new Element to be created on the server- Throws:
ProviderException
-
deleteValue
public void deleteValue(String path) throws ProviderException
Description copied from interface:IModelProvider
Deletes value under the given path- Specified by:
deleteValue
in interfaceIModelProvider
- Parameters:
path
- Path to the entity that should be deleted- Throws:
ProviderException
-
deleteValue
public void deleteValue(String path, Object obj)
Description copied from interface:IModelProvider
Deletes an entry from a map or collection by the given key- Specified by:
deleteValue
in interfaceIModelProvider
- Parameters:
path
- Path to the entity that should be deleted
-
invokeOperation
public Object invokeOperation(String path, Object... parameters) throws ProviderException
Description copied from interface:IModelProvider
Invoke an operation- Specified by:
invokeOperation
in interfaceIModelProvider
- Parameters:
path
- Path to operationparameters
- Operation parameter- Returns:
- Return value
- Throws:
ProviderException
-
-