Package nexj.core.meta.integration

Examples of nexj.core.meta.integration.EndpointPart


      value = convert(value, source, mapping);

      for (int i = 0, n = mapping.getDestinationCount() - 1; i <= n; ++i)
      {
         EndpointPart destinationPart = mapping.getDestination(i);
         String sDestinationName = destinationPart.getName();

         if (destinationPart.isCollection())
         {
            List list = (List)tobj.findValue(sDestinationName);

            if (list == null)
            {
               list = new ArrayList(4);
               destinationPart.setValue(tobj, list);
            }

            if (destinationPart.isPrimitive())
            {
               if (value instanceof List)
               {
                  list.addAll((List)value);
               }
               else
               {
                  list.add(value);
               }
            }
            else if (mapping.isFixedDestination(i))
            {
               if (list.isEmpty())
               {
                  tobj = destinationPart.createObject();
                  list.add(tobj);
               }
               else
               {
                  tobj = (TransferObject)list.get(0);
               }
            }
            else if (i == n && value instanceof List)
            {
               list.addAll((List)value);
            }
            else
            {
               int nLastCollection = mapping.getLastCollectionDestinationOrdinal();
               int nParentLevel = (mapping.getCollectionParent() == null) ? 0 : mapping.getCollectionParent().getLevel();
               boolean bListKey = false;

               tobj = null;
              
               while (++nList <= source.getLevel())
               {
                  TransformationSource path = source.getPath(nList);

                  if (!mapping.isFixedSource(path))
                  {
                     EndpointPart sourcePart = path.getPart();

                     if (sourcePart.isCollection())
                     {
                        if (m_listKey == null)
                        {
                           m_listKey = new ListKey();
                        }

                        if (i == nLastCollection)
                        {
                           nList = nParentLevel;
                        }

                        m_listKey.set(list, getSourceList(nList), getSourceIndex(nList), sourcePart);
                        tobj = (TransferObject)m_listMap.get(m_listKey);
                        bListKey = true;

                        break;
                     }
                     else if (i == nLastCollection && nList > nParentLevel)
                     {
                        Object sourceObject = getSourceObject(nList);

                        if (sourcePart.isPrimitive() ||
                           sourceObject == null ||
                           sourceObject == Undefined.VALUE)
                        {
                           sourceObject = getSourceObject(nList - 1);
                        }
View Full Code Here


   protected Object convert(Object value, TransformationSource source, TransformationMapping mapping)
   {
      // Process only if there is no script.
      if (mapping.getOrdinal() == 0)
      {
         EndpointPart srcPart = source.getPart();
         EndpointPart dstPart = mapping.getDestination(mapping.getDestinationCount() - 1);
         Message message = null;
         boolean bParse = false;

         // Handle ref -> primitive and primitive -> ref.
         if (srcPart instanceof CompositeMessagePartRef && dstPart.isPrimitive())
         {
            message = m_context.getMetadata().getMessage(((CompositeMessagePartRef)srcPart).getRefPart().getName());
         }
         else if (dstPart instanceof CompositeMessagePartRef && srcPart.isPrimitive())
         {
View Full Code Here

TOP

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

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.