/** * Creates an instance that uses the specified <code>Parser</code>. * * @param theParser the parser used for converting between Message and * Transportable */ public ApplicationRouterImpl(Parser theParser) { this(theParser.getHapiContext(), theParser); }
/** * Creates an instance that uses the specified <code>Parser</code>. * * @param theParser the parser used for converting between Message and * Transportable */ public ApplicationRouterImpl(Parser theParser) { this(theParser.getHapiContext(), theParser); }
/** * @return the factory used by this Parser for model class lookup */ public ModelClassFactory getFactory() { return getHapiContext().getModelClassFactory(); }
/** * @return the factory used by this Parser for model class lookup */ public ModelClassFactory getFactory() { return getHapiContext().getModelClassFactory(); }
/** * <p> * Returns the parser configuration. This is a bean which contains configuration * instructions relating to how a parser should be parsing or encoding messages it deals * with. * </p> * <p> * <b>Note that the parser configuration comes from the {@link #getHapiContext() HAPI Context}.</b> * Changes to the configuration for one parser will affect all parsers which share the same * context. * </p> * * @return the current parser configuration */ public ParserConfiguration getParserConfiguration() { return getHapiContext().getParserConfiguration(); }
private <R> void assertMessageValidates(Message message) throws HL7Exception { if (isValidating()) { Validator<R> validator = getHapiContext().getMessageValidator(); ValidationExceptionHandlerFactory<R> factory = getHapiContext().getValidationExceptionHandlerFactory(); if (factory == null) { throw new NullPointerException("Validation is enabled for this parser, but ValidationExceptionHandlerFactory is null"); } ValidationExceptionHandler<R> handler = factory.getNewInstance(getHapiContext()); R result = validator.validate(message, handler); handleException(handler, result); } }
private <R> void assertMessageValidates(Message message) throws HL7Exception { if (isValidating()) { Validator<R> validator = getHapiContext().getMessageValidator(); ValidationExceptionHandlerFactory<R> factory = getHapiContext().getValidationExceptionHandlerFactory(); if (factory == null) { throw new NullPointerException("Validation is enabled for this parser, but ValidationExceptionHandlerFactory is null"); } ValidationExceptionHandler<R> handler = factory.getNewInstance(getHapiContext()); R result = validator.validate(message, handler); handleException(handler, result); } }
private <R> void assertMessageValidates(String message, String encoding, String version) throws HL7Exception { if (isValidating()) { Validator<R> validator = getHapiContext().getMessageValidator(); ValidationExceptionHandlerFactory<R> factory = getHapiContext().getValidationExceptionHandlerFactory(); ValidationExceptionHandler<R> handler = factory.getNewInstance(getHapiContext()); R result = validator.validate(message, encoding.equals("XML"), version, handler); handleException(handler, result); } }
/** * @return the set of validation rules that is applied to messages parsed or encoded by this * parser. Note that this method may return <code>null</code> */ public ValidationContext getValidationContext() { return isValidating() ? getHapiContext().getValidationContext() : null; }
/** * @return the set of validation rules that is applied to messages parsed or encoded by this * parser. Note that this method may return <code>null</code> */ public ValidationContext getValidationContext() { return isValidating() ? getHapiContext().getValidationContext() : null; }
private <R> void assertMessageValidates(String message, String encoding, String version) throws HL7Exception { if (isValidating()) { Validator<R> validator = getHapiContext().getMessageValidator(); ValidationExceptionHandlerFactory<R> factory = getHapiContext().getValidationExceptionHandlerFactory(); ValidationExceptionHandler<R> handler = factory.getNewInstance(getHapiContext()); R result = validator.validate(message, encoding.equals("XML"), version, handler); handleException(handler, result); } }
private boolean isValidating() { return getHapiContext().getParserConfiguration().isValidating(); }
private boolean isValidating() { return getHapiContext().getParserConfiguration().isValidating(); }
/** * @param context the set of validation rules to be applied to messages parsed or encoded by * this parser (defaults to ValidationContextFactory.DefaultValidation) * * @deprecated use a dedicated {@link HapiContext} and set its ValidationContext property */ public void setValidationContext(ValidationContext context) { HapiContext newContext = new DefaultHapiContext(getHapiContext()); newContext.setValidationContext(context); setHapiContext(newContext); }
/** * Sets the parser configuration for this parser (may not be null). This is a bean which * contains configuration instructions relating to how a parser should be parsing or encoding * messages it deals with. * * @param configuration The parser configuration * * @deprecated use a dedicated {@link HapiContext} and set its ParserConfiguration property */ public void setParserConfiguration(ParserConfiguration configuration) { HapiContext newContext = new DefaultHapiContext(getHapiContext()); newContext.setParserConfiguration(configuration); setHapiContext(newContext); }
/** * @param context the set of validation rules to be applied to messages parsed or encoded by * this parser (defaults to ValidationContextFactory.DefaultValidation) * * @deprecated use a dedicated {@link HapiContext} and set its ValidationContext property */ public void setValidationContext(ValidationContext context) { HapiContext newContext = new DefaultHapiContext(getHapiContext()); newContext.setValidationContext(context); setHapiContext(newContext); }
/** * Sets the parser configuration for this parser (may not be null). This is a bean which * contains configuration instructions relating to how a parser should be parsing or encoding * messages it deals with. * * @param configuration The parser configuration * * @deprecated use a dedicated {@link HapiContext} and set its ParserConfiguration property */ public void setParserConfiguration(ParserConfiguration configuration) { HapiContext newContext = new DefaultHapiContext(getHapiContext()); newContext.setParserConfiguration(configuration); setHapiContext(newContext); }
/** * Given a concatenation of message type and event (e.g. ADT_A04), and the version, finds the * corresponding message structure (e.g. ADT_A01). This is needed because some events share * message structures, although it is not needed when the message structure is explicitly valued * in MSH-9-3. If no mapping is found, returns the original name. * * @throws HL7Exception if there is an error retrieving the map, or if the given version is * invalid * * @deprecated use {@link ModelClassFactory#getMessageStructureForEvent(String, Version)} */ public String getMessageStructureForEvent(String name, String version) throws HL7Exception { assertVersionExists(version); return getHapiContext().getModelClassFactory(). getMessageStructureForEvent(name, Version.versionOf(version)); }
/** * Returns the set of validation rules that applied to this message. If the parser * was set to "not-validating", this method returns null * * @return the set of validation rules that applied to this message */ public ValidationContext getValidationContext() { if (getParser() == null || !getParser().getParserConfiguration().isValidating()) return null; return getParser().getHapiContext().getValidationContext(); }
/** * Returns the set of validation rules that applied to this message. If the parser * was set to "not-validating", this method returns null * * @return the set of validation rules that applied to this message */ public ValidationContext getValidationContext() { if (getParser() == null || !getParser().getParserConfiguration().isValidating()) return null; return getParser().getHapiContext().getValidationContext(); }