Search in sources :

Example 1 with IAttributeValuesProvider

use of org.adempiere.mm.attributes.spi.IAttributeValuesProvider in project metasfresh-webui-api by metasfresh.

the class HUEditorRowAttributesHelper method extractValueAndResolve.

private static final Object extractValueAndResolve(final IAttributeStorage attributesStorage, final IAttributeValue attributeValue) {
    final Object value = attributeValue.getValue();
    if (!attributeValue.isList()) {
        return value;
    }
    final IAttributeValuesProvider valuesProvider = attributeValue.getAttributeValuesProvider();
    final Evaluatee evalCtx = valuesProvider.prepareContext(attributesStorage);
    final NamePair valueNP = valuesProvider.getAttributeValueOrNull(evalCtx, value);
    return LookupValue.fromNamePair(valueNP);
}
Also used : IAttributeValuesProvider(org.adempiere.mm.attributes.spi.IAttributeValuesProvider) NamePair(org.compiere.util.NamePair) Evaluatee(org.compiere.util.Evaluatee)

Aggregations

IAttributeValuesProvider (org.adempiere.mm.attributes.spi.IAttributeValuesProvider)1 Evaluatee (org.compiere.util.Evaluatee)1 NamePair (org.compiere.util.NamePair)1