Package nexj.core.meta.integration

Examples of nexj.core.meta.integration.PrimitiveMessagePart


         Object value = null;
         boolean bMatch = false;

         if (msgPart instanceof PrimitiveMessagePart)
         {
            PrimitiveMessagePart part = (PrimitiveMessagePart)msgPart;
            String s = getCurToken();

            if (s.length() != 0)
            {
               if (s.equals("\"\""))
               {
                  value = null;
               }
               else
               {
                  value = convert(part, s);
               }

               bMatch = true;
            }
         }
         else
         {
            if (nLevel == HL7MessagePartMapping.LEVEL_SEGMENT)
            {
               String sName = getCurToken();

               if (!mapping.getName().equals(sName))
               {
                  if (parentMsgPart.isLax() && nCount == 0 && sName.length() != 0 && sName.charAt(0) == 'Z')
                  {
                     skipTokens(nLevel, 1);

                     continue;
                  }

                  break;
               }

               skipTokens(nLevel + 1, 1);
               bMatch = true;
            }

            final CompositeMessagePart composite = (CompositeMessagePart)msgPart;
            TransferObject tobj = (parentMsgPart == null) ? parent : null;
            int nSeq = 1;

            if (msgPart == m_msh)
            {
               m_buf.append(m_sepArray[SEP_COMPONENT]);

               for (;;)
               {
                  int ch = getNextChar();

                  if (ch == m_sepArray[SEP_FIELD])
                  {
                     break;
                  }

                  m_buf.append((char)ch);
               }

               m_nSepLevel = HL7MessagePartMapping.LEVEL_FIELD;
               nSeq = 2;
            }

            for (int nPart = 0, nPartCount = composite.getPartCount(); nPart != nPartCount; ++nPart)
            {
               MessagePart part = composite.getPart(nPart);

               if (nLevel > HL7MessagePartMapping.LEVEL_GROUP)
               {
                  int nNextSeq = ((HL7MessagePartMapping)part.getMapping()).getSeq();

                  if (msgPart == m_msh && nNextSeq <= 2)
                  {
                     if (nNextSeq == 1)
                     {
                        m_sToken = new String(m_sepArray, SEP_FIELD, 1);
                     }
                     else
                     {
                        m_sToken = m_buf.toString();
                     }

                     nNextSeq = 2;
                  }

                  skipTokens(nLevel + 1, nNextSeq - nSeq);
                  nSeq = nNextSeq;
               }

               if (parse(part, composite, parentMsgPart, tobj))
               {
                  bMatch = true;

                  if (tobj == null)
                  {
                     value = tobj = m_tobj;
                  }
               }
               else
               {
                  if (part.isRequired())
                  {
                     if (bMatch ||
                        nLevel == HL7MessagePartMapping.LEVEL_SEGMENT ||
                        nLevel > HL7MessagePartMapping.LEVEL_SEGMENT && m_nSepLevel > nLevel)
                     {
                        throw new IntegrationException("err.integration.minPartCount", new Object[]{part.getFullPath()});
                     }
                     else
                     {
                        break loop;
                     }
View Full Code Here


      int nOffset = 0;

      for (int i = 0; i < recordPart.getPartCount(); i++)
      {
         PrimitiveMessagePart fieldPart = (PrimitiveMessagePart)recordPart.getPart(i);
         FixedMessagePartMapping mapping = (FixedMessagePartMapping)fieldPart.getMapping();

         String sToken = mapping.getPrefix();
         int nTokenLen = sToken.length();

         sToken.getChars(0, nTokenLen, m_chTemplate, nOffset);
View Full Code Here

   public void testFieldEscapeButNoQuoting() throws Exception
   {
      TestCSVMessageFormatter format = new TestCSVMessageFormatter();
      CSVMessagePartMapping mapping = new CSVMessagePartMapping();
     
      mapping.setMessagePart(new PrimitiveMessagePart("TestPart"));
     
      mapping.setDelimiter(Character.valueOf(','));
      mapping.setQuote(null)//no quote
      mapping.setEscape(Character.valueOf('_'));
           
View Full Code Here

TOP

Related Classes of nexj.core.meta.integration.PrimitiveMessagePart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.