Search in sources :

Example 1 with ParamType

use of eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ParamType in project hale by halestudio.

the class OmlRdfReader method getParameters.

private List<IParameter> getParameters(List<ParamType> param) {
    List<IParameter> params = new ArrayList<IParameter>(param.size());
    Iterator<ParamType> iterator = param.iterator();
    ParamType paramType;
    IParameter parameter;
    while (iterator.hasNext()) {
        paramType = iterator.next();
        List<String> values = paramType.getValue();
        String value;
        if (values != null && !values.isEmpty()) {
            value = values.get(0);
        } else {
            // TODO what should be the default empty value?
            value = null;
        // null or empty string?
        }
        parameter = new Parameter(paramType.getName(), value);
        params.add(parameter);
    }
    return params;
}
Also used : IParameter(eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IParameter) ArrayList(java.util.ArrayList) Parameter(eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.Parameter) IParameter(eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IParameter) ParamType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ParamType)

Example 2 with ParamType

use of eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ParamType in project hale by halestudio.

the class OmlRdfGenerator method getParameters.

/**
 * Converts from List of OML IParameter to the collecion of the JAXB
 * ParameterType
 *
 * @param parameters
 * @return
 */
private Collection<? extends ParamType> getParameters(List<IParameter> parameters) {
    if (parameters != null) {
        ArrayList<ParamType> pTypes = new ArrayList<ParamType>(parameters.size());
        ParamType pType;
        IParameter param;
        Iterator<?> iterator = parameters.iterator();
        while (iterator.hasNext()) {
            param = (IParameter) iterator.next();
            pType = getParameterType(param);
            pTypes.add(pType);
        }
        return pTypes;
    }
    return new ArrayList<ParamType>();
}
Also used : IParameter(eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IParameter) ArrayList(java.util.ArrayList) ParamType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ParamType)

Aggregations

IParameter (eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IParameter)2 ParamType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ParamType)2 ArrayList (java.util.ArrayList)2 Parameter (eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.Parameter)1