@Test public void addingAndCallingTransformersByNameTest() { CallCheckTransformer dummyTransformerOne = new CallCheckTransformer(); CallCheckTransformer dummyTransformerTwo = new CallCheckTransformer(); CallCheckTransformer dummyTransformerThree = new CallCheckTransformer(); HashMap<String, DataTransformer> transformerNames = new HashMap<>(); transformerNames.put("one", dummyTransformerOne); transformerNames.put("two", dummyTransformerTwo); transformerNames.put("three", dummyTransformerThree); InLineTransformerExtension transformerExtension = new InLineTransformerExtension(transformerNames); List<Map<String, String>> pipelineInput = new LinkedList<>(); pipelineInput.add(new HashMap<String, String>()); InLineTransformerExtension.TransformTag transformTag = new InLineTransformerExtension.TransformTag(); transformTag.setName("two"); transformerExtension.pipelinePossibleStates(transformTag, pipelineInput); Assert.assertFalse(dummyTransformerOne.isWasCalled()); Assert.assertTrue(dummyTransformerTwo.isWasCalled()); Assert.assertFalse(dummyTransformerThree.isWasCalled()); }
public List<Map<String, String>> pipelinePossibleStates(TransformTag action, List<Map<String, String>> possibleStateList) { DataTransformer tr = transformers.get(action.getName()); DataPipe pipe = new DataPipe(0, null); for (Map<String, String> possibleState : possibleStateList) { pipe.getDataMap().putAll(possibleState); tr.transform(pipe); possibleState.putAll(pipe.getDataMap()); } return possibleStateList; }
InLineTransformerExtension implements CustomTagExtension<InLineTransformerExtension.TransformTag> { public List<Map<String, String>> pipelinePossibleStates(TransformTag action, List<Map<String, String>> possibleStateList) { DataTransformer tr = transformers.get(action.getName()); DataPipe pipe = new DataPipe(0, null); for (Map<String, String> possibleState : possibleStateList) { pipe.getDataMap().putAll(possibleState); tr.transform(pipe); possibleState.putAll(pipe.getDataMap()); } return possibleStateList; } }
InLineTransformerExtension implements CustomTagExtension<InLineTransformerExtension.TransformTag> { public List<Map<String, String>> pipelinePossibleStates(TransformTag action, List<Map<String, String>> possibleStateList) { DataTransformer tr = transformers.get(action.getName()); DataPipe pipe = new DataPipe(0, null); for (Map<String, String> possibleState : possibleStateList) { pipe.getDataMap().putAll(possibleState); tr.transform(pipe); possibleState.putAll(pipe.getDataMap()); } return possibleStateList; } InLineTransformerExtension(final Map<String, DataTransformer> transformers); }
InLineTransformerExtension implements CustomTagExtension<InLineTransformerExtension.TransformTag> { public List<Map<String, String>> pipelinePossibleStates(TransformTag action, List<Map<String, String>> possibleStateList) { DataTransformer tr = transformers.get(action.getName()); DataPipe pipe = new DataPipe(0, null); for (Map<String, String> possibleState : possibleStateList) { pipe.getDataMap().putAll(possibleState); tr.transform(pipe); possibleState.putAll(pipe.getDataMap()); } return possibleStateList; } InLineTransformerExtension(final Map<String, DataTransformer> transformers); Class<TransformTag> getTagActionClass(); String getTagName(); String getTagNameSpace(); List<Map<String, String>> pipelinePossibleStates(TransformTag action,
                                                            List<Map<String, String>> possibleStateList); }
InLineTransformerExtension implements CustomTagExtension<InLineTransformerExtension.TransformTag> { public List<Map<String, String>> pipelinePossibleStates(TransformTag action, List<Map<String, String>> possibleStateList) { DataTransformer tr = transformers.get(action.getName()); DataPipe pipe = new DataPipe(0, null); for (Map<String, String> possibleState : possibleStateList) { pipe.getDataMap().putAll(possibleState); tr.transform(pipe); possibleState.putAll(pipe.getDataMap()); } return possibleStateList; } InLineTransformerExtension(final Map<String, DataTransformer> transformers); Class<TransformTag> getTagActionClass(); String getTagName(); String getTagNameSpace(); List<Map<String, String>> pipelinePossibleStates(TransformTag action,
                                                            List<Map<String, String>> possibleStateList);  }