1 package org
.argeo
.slc
.core
.execution
;
3 import java
.util
.HashMap
;
6 import org
.argeo
.slc
.execution
.ExecutionFlowDescriptor
;
7 import org
.argeo
.slc
.execution
.ExecutionFlowDescriptorConverter
;
9 public class DefaultDescriptorConverter
implements
10 ExecutionFlowDescriptorConverter
{
12 public Map
<String
, Object
> convertValues(
13 ExecutionFlowDescriptor executionFlowDescriptor
) {
14 // convert the values of flow.getFlowDescriptor()
15 Map
<String
, Object
> values
= executionFlowDescriptor
.getValues();
17 Map
<String
, Object
> convertedValues
= new HashMap
<String
, Object
>();
20 for (String key
: values
.keySet()) {
21 Object value
= values
.get(key
);
22 if (value
instanceof PrimitiveValue
) {
23 PrimitiveValue primitiveValue
= (PrimitiveValue
) value
;
25 // TODO: check that the class of the the
26 // primitiveValue.value
28 // the primitiveValue.type
29 convertedValues
.put(key
, primitiveValue
.getValue());
30 } else if (value
instanceof RefValue
) {
31 RefValue refValue
= (RefValue
) value
;
32 convertedValues
.put(key
, refValue
.getLabel());
36 return convertedValues
;