Search in sources :

Example 6 with ParameterValueBean

use of eu.esdihumboldt.hale.common.align.io.impl.internal.ParameterValueBean in project hale by halestudio.

the class NilReasonTranslator method getNewParameters.

/**
 * @see FunctionTranslator#getNewParameters(List, CellBean, IOReporter,
 *      ICell)
 */
@Override
public List<ParameterValueBean> getNewParameters(List<ParameterValueBean> params, CellBean cellBean, IOReporter reporter, ICell cell) {
    // update target, adding nilReason child to path
    ChildContextBean nilReason = new ChildContextBean();
    nilReason.setChildName(new QName("nilReason"));
    PropertyBean target = (PropertyBean) cellBean.getTarget().get(0).getEntity();
    target.getProperties().add(nilReason);
    // updated parameters
    List<ParameterValueBean> newList = new ArrayList<ParameterValueBean>();
    for (ParameterValueBean val : params) {
        // translate the nilReason type to the value being assigned
        if (val.getName().equals(PARAMETER_NIL_REASON_TYPE)) {
            newList.add(new ParameterValueBean(PARAMETER_VALUE, val.getValue()));
        } else {
            newList.add(val);
        }
    }
    return newList;
}
Also used : ChildContextBean(eu.esdihumboldt.hale.common.align.io.impl.internal.ChildContextBean) QName(javax.xml.namespace.QName) ParameterValueBean(eu.esdihumboldt.hale.common.align.io.impl.internal.ParameterValueBean) ArrayList(java.util.ArrayList) PropertyBean(eu.esdihumboldt.hale.common.align.io.impl.internal.PropertyBean)

Example 7 with ParameterValueBean

use of eu.esdihumboldt.hale.common.align.io.impl.internal.ParameterValueBean in project hale by halestudio.

the class RenameTranslator method getNewParameters.

/**
 * @see eu.esdihumboldt.hale.io.oml.helper.FunctionTranslator#getNewParameters(java.util.List,
 *      eu.esdihumboldt.hale.common.align.io.impl.internal.CellBean,
 *      eu.esdihumboldt.hale.common.core.io.report.IOReporter,
 *      eu.esdihumboldt.hale.io.oml.internal.model.align.ICell)
 */
@Override
public List<ParameterValueBean> getNewParameters(List<ParameterValueBean> params, CellBean cellBean, IOReporter reporter, ICell cell) {
    List<ParameterValueBean> newList = new ArrayList<ParameterValueBean>();
    newList.add(new ParameterValueBean("structuralRename", "false"));
    return newList;
}
Also used : ParameterValueBean(eu.esdihumboldt.hale.common.align.io.impl.internal.ParameterValueBean) ArrayList(java.util.ArrayList)

Aggregations

ParameterValueBean (eu.esdihumboldt.hale.common.align.io.impl.internal.ParameterValueBean)7 ArrayList (java.util.ArrayList)7 ChildContextBean (eu.esdihumboldt.hale.common.align.io.impl.internal.ChildContextBean)2 NamedEntityBean (eu.esdihumboldt.hale.common.align.io.impl.internal.NamedEntityBean)2 PropertyBean (eu.esdihumboldt.hale.common.align.io.impl.internal.PropertyBean)2 IParameter (eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IParameter)2 Joiner (com.google.common.base.Joiner)1 IOMessageImpl (eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl)1 ComposedProperty (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.ComposedProperty)1 Property (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Property)1 Restriction (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Restriction)1 IEntity (eu.esdihumboldt.hale.io.oml.internal.model.align.IEntity)1 IValueExpression (eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IValueExpression)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 HashSet (java.util.HashSet)1 QName (javax.xml.namespace.QName)1