Tabnine Logo
Message.setParser
Code IndexAdd Tabnine to your IDE (free)

How to use
setParser
method
in
ca.uhn.hl7v2.model.Message

Best Java code snippets using ca.uhn.hl7v2.model.Message.setParser (Showing top 12 results out of 315)

origin: ca.uhn.hapi/hapi-base

/**
 * {@inheritDoc}
 */
@Override
public Message parse(String theMessage) throws HL7Exception {
  Message retVal = super.parse(theMessage);
  Parser parser = getAppropriateParser(theMessage);
  retVal.setParser(parser);
  return retVal;
}
origin: ca.uhn.hapi/hapi-osgi-base

/**
 * {@inheritDoc}
 */
@Override
public Message parse(String theMessage) throws HL7Exception {
  Message retVal = super.parse(theMessage);
  Parser parser = getAppropriateParser(theMessage);
  retVal.setParser(parser);
  return retVal;
}
origin: ca.uhn.hapi/hapi-base

public <T extends Message> T newMessage(Class<T> clazz) throws HL7Exception {
  T msg = ReflectionUtil.instantiateMessage(clazz, getModelClassFactory());
  msg.setParser(getGenericParser());
  return msg;
}
origin: ca.uhn.hapi/hapi-osgi-base

public <T extends Message> T newMessage(Class<T> clazz) throws HL7Exception {
  T msg = ReflectionUtil.instantiateMessage(clazz, getModelClassFactory());
  msg.setParser(getGenericParser());
  return msg;
}
origin: ca.uhn.hapi/hapi-osgi-base

/**
 * Parses a message string and returns the corresponding Message object.
 * Unexpected segments added at the end of their group.
 * 
 * @throws HL7Exception
 *             if the message is not correctly formatted.
 * @throws EncodingNotSupportedException
 *             if the message encoded is not supported by this parser.
 */
protected Message doParse(String message, String version) throws HL7Exception {
  // try to instantiate a message object of the right class
  MessageStructure structure = getStructure(message);
  Message m = instantiateMessage(structure.messageStructure, version, structure.explicitlyDefined);
  m.setParser(this);
  parse(m, message);
  return m;
}
origin: ca.uhn.hapi/hapi-base

/**
 * Parses a message string and returns the corresponding Message object.
 * Unexpected segments added at the end of their group.
 * 
 * @throws HL7Exception
 *             if the message is not correctly formatted.
 * @throws EncodingNotSupportedException
 *             if the message encoded is not supported by this parser.
 */
protected Message doParse(String message, String version) throws HL7Exception {
  // try to instantiate a message object of the right class
  MessageStructure structure = getStructure(message);
  Message m = instantiateMessage(structure.messageStructure, version, structure.explicitlyDefined);
  m.setParser(this);
  parse(m, message);
  return m;
}
origin: ca.uhn.hapi/hapi-osgi-base

/**
 * Parse a message using a specific model package instead of the default, using
 * {@link ModelClassFactory#getMessageClassInASpecificPackage(String, String, boolean, String)}
 * .
 * 
 * <b>WARNING: This method is only implemented in some parser implementations</b>. Currently it
 * will only work with the PipeParser parser implementation. Use with caution.
 *
 * @param message message string
 * @param packageName name of the package of the models
 * @return parsed message
 * @throws HL7Exception if an error occurred while parsing
 */
public Message parseForSpecificPackage(String message, String packageName) throws HL7Exception {
  String encoding = getEncoding(message);
  if (!supportsEncoding(encoding)) {
    throw new EncodingNotSupportedException("Can't parse message beginning "
        + message.substring(0, Math.min(message.length(), 50)));
  }
  String version = getVersion(message);
  assertVersionExists(version);
  assertMessageValidates(message, encoding, version);
  Message result = doParseForSpecificPackage(message, version, packageName);
  assertMessageValidates(result);
  result.setParser(this);
  return result;
}
origin: ca.uhn.hapi/hapi-base

/**
 * Parse a message using a specific model package instead of the default, using
 * {@link ModelClassFactory#getMessageClassInASpecificPackage(String, String, boolean, String)}
 * .
 * 
 * <b>WARNING: This method is only implemented in some parser implementations</b>. Currently it
 * will only work with the PipeParser parser implementation. Use with caution.
 *
 * @param message message string
 * @param packageName name of the package of the models
 * @return parsed message
 * @throws HL7Exception if an error occurred while parsing
 */
public Message parseForSpecificPackage(String message, String packageName) throws HL7Exception {
  String encoding = getEncoding(message);
  if (!supportsEncoding(encoding)) {
    throw new EncodingNotSupportedException("Can't parse message beginning "
        + message.substring(0, Math.min(message.length(), 50)));
  }
  String version = getVersion(message);
  assertVersionExists(version);
  assertMessageValidates(message, encoding, version);
  Message result = doParseForSpecificPackage(message, version, packageName);
  assertMessageValidates(result);
  result.setParser(this);
  return result;
}
origin: ca.uhn.hapi/hapi-base

assertMessageValidates(result);
result.setParser(this);
origin: ca.uhn.hapi/hapi-osgi-base

assertMessageValidates(result);
result.setParser(this);
origin: ca.uhn.hapi/hapi-base

/**
 * {@inheritDoc }
 */    
public Message generateACK(AcknowledgmentCode theAcknowledgementCode, HL7Exception theException) throws HL7Exception, IOException {
  if (theException != null && theException.getResponseMessage() != null) {
    return theException.getResponseMessage();
  }
  Message out = instantiateACK();
  out.setParser(getParser());
  fillResponseHeader(out, theAcknowledgementCode);
  if (theException != null) {
    theException.populateResponse(out, theAcknowledgementCode, 0);
  }
  return out;
}
origin: ca.uhn.hapi/hapi-osgi-base

/**
 * {@inheritDoc }
 */    
public Message generateACK(AcknowledgmentCode theAcknowledgementCode, HL7Exception theException) throws HL7Exception, IOException {
  if (theException != null && theException.getResponseMessage() != null) {
    return theException.getResponseMessage();
  }
  Message out = instantiateACK();
  out.setParser(getParser());
  fillResponseHeader(out, theAcknowledgementCode);
  if (theException != null) {
    theException.populateResponse(out, theAcknowledgementCode, 0);
  }
  return out;
}
ca.uhn.hl7v2.modelMessagesetParser

Javadoc

Sets the parser to be used when parse/encode methods are called on this Message, as well as its children. It is recommended that if these methods are going to be called, a parser be supplied with the validation context wanted. Where possible, the parser should be reused for best performance, unless thread safety is an issue. Note that not all parsers can be used. As of version 1.0, only PipeParser supports this functionality

Popular methods of Message

  • get
  • getVersion
    Returns the version number of the HL7 version in which this message structure is defined (e.g. "2.4"
  • generateACK
    Generates and returns an ACK message which would be used to acknowledge this message successfully.
  • encode
    Encodes this message using the parser returned by #getParser()
  • getName
  • getParser
    Returns the parser to be used when parse/encode methods are called on this Message, as well as its c
  • addNonstandardSegment
  • getEncodingCharactersValue
    Convenience method which retrieves the encoding characters value from the second field of the first
  • getFieldSeparatorValue
    Convenience method which retrieves the field separator value from the first field of the first segme
  • getNames
  • parse
    Parses the string into this message using the parser returned by #getParser()
  • printStructure
    Prints a summary of the contents and structure of this message. This is useful for debugging purpos
  • parse,
  • printStructure

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • JCheckBox (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now