Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- currently, PatientHandler looks like this
- @Component
- @Order(Ordered.LOWEST_PRECEDENCE)
- public class PatientHandler extends CustomDatatypeHandler implements ComplexObsHandler {
- public static final Log log = LogFactory.getLog(PatientHandler.class);
- public static final String HANDLER_TYPE = "PatientHandler";
- /**
- * The default Constructor method
- */
- public PatientHandler() {
- super();
- }
- --- etc.
- Note // earlier I used a String variable with getters and setters instead of the constant.
- in the complexObshandler interface, I used to have a getHandlerType method defined, so that the api knows that anything that implements the complexObsHandler interface has a constant.
- alternatively,
- the ImageHandler (which also implements ComplexObsHandler) looks like this -
- @Component
- @Order(Ordered.LOWEST_PRECEDENCE)
- public class ImageHandler extends AbstractHandler implements ComplexObsHandler {
- public static final Log log = LogFactory.getLog(ImageHandler.class);
- private Set<String> extensions;
- public static final String HANDLER_TYPE = "ImageHandler";
- In short, anything that implements ComplexObsHandler needs have a constant value defined
- but problem is, when I do that, I cant do this,
- while (itr.hasNext()) {
- ComplexObsHandler obsHandler = (ComplexObsHandler) itr.next();
- handlerMap.put(obsHandler.getHandlerType(), obsHandler);
- }
- (earlier, this (obsHandler.getHandlerType()) was possible becoz the interface had a getter method - so the interface knew of it. But after we moved to constants, the getter came off. Hence the issue)
- now, because of this, I cant iterate through a list and call the getter on each...............
Advertisement
Add Comment
Please, Sign In to add comment