Skip to content

Conversation

@pc0202
Copy link
Owner

@pc0202 pc0202 commented Mar 25, 2019

Part 2 changes done-
Introduced IEvaluator: public T evaluate() and EvaluatorFactory: getInstance()

Impl classes added :- ProviderEvaluator and FunctionEvaluator
Added impl class SampleViewFunctionProvider (IViewFunctionProvider)
SampleViewFunctionProvider : doAction() called by ProviderEvaluator:evaluate()

Note: No impl for reference is present

@@ -0,0 +1,31 @@
package io.opensaber.provider;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this into another package altogether and call it as an example. Say, src/main/java/org/example/provider

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

result.put(field.getTitle(), evaluator.evaluate().toString());

Object evaluatedValue = evaluator.evaluate();
if(evaluatedValue instanceof String){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test that JsonNodeFactory.instance.pojoNode(evaluatedValue)); will not work for String? Asking if we should really have if-else here.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have tested this, does not work for String. Hence I preferred a check.

{
"title": "Name in passport",
"function": "#/functionDefinitions/concat($lastName, $firstName)",
"function": "#/functionDefinitions/userDefinedConcat($lastName, $firstName)",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a sample with both in-line and provider and ref for test purposes.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants