public DecoratedInterpretedPropertyValue(InterpretedPropertyValue interpretedPropertyValue, Record record) { try { rawValue = interpretedPropertyValue.getRawValue(record); } catch (InterpreterEngineException iee) { throw new RuntimeException(iee); } }
public static PropertyValue getInstance( final PropertyDescriptor descriptor, final String rawValue, final ControllerServiceLookup controllerServiceLookup, final VariableRegistry variableRegistry) { if (descriptor != null && descriptor.isExpressionLanguageSupported() && InterpreterEngine.isExpressionLanguage(rawValue)) { InterpreterEngine ie = InterpreterEngineFactory.get(); return new InterpretedPropertyValue(descriptor, rawValue, controllerServiceLookup, variableRegistry); } return new StandardPropertyValue(rawValue, controllerServiceLookup, variableRegistry); }
/** * Method that applies a record to an expression language * @param record * @return * @throws InterpreterEngineException */ protected Object getRawValue(Record record) throws InterpreterEngineException { ScriptContext context = new SimpleScriptContext(); record.getFieldsEntrySet().forEach(entry -> context.setAttribute(entry.getKey(), entry.getValue().getRawValue(), ScriptContext.ENGINE_SCOPE)); return getRawValue(context); }