Package nexj.core.meta.integration

Examples of nexj.core.meta.integration.TransformationMapping


   {
      setSourceObject(source.getLevel(), obj);

      for (int nMapping = 0, nMappingCount = source.getMappingCount(); nMapping != nMappingCount; ++nMapping)
      {
         TransformationMapping mapping = source.getMapping(nMapping);

         if (mapping.getDestinationCount() != 0)
         {
            boolean bMissing = false;

            m_argList.clear();

            for (int nArg = 0, nArgCount = mapping.getArgumentCount(); nArg != nArgCount; ++nArg)
            {
               TransformationArgument arg = mapping.getArgument(nArg);
               TransformationSource src = arg.getSource();
               int nStartLevel = arg.getStartLevel();
               Object value = getSourceObject(nStartLevel);
               Object parent = getSourceObject(Math.max(0, nStartLevel - 1));
               int nLevel;

               for (nLevel = nStartLevel; nLevel < src.getLevel() && value != null && value != Undefined.VALUE; ++nLevel)
               {
                  parent = value;
                  value = src.getPath(nLevel + 1).getPart().getValue((PropertyMap)parent, Undefined.VALUE);
               }

               if (value == null)
               {
                  if (nLevel != src.getLevel() || !arg.isNull())
                  {
                     bMissing = true;

                     break;
                  }
               }
               else if (value == Undefined.VALUE)
               {
                  if (nLevel != src.getLevel())
                  {
                     bMissing = true;

                     break;
                  }

                  Function fun = arg.getDefaultValueFunction();

                  if (fun == null)
                  {
                     bMissing = true;

                     break;
                  }

                  if (parent == Undefined.VALUE)
                  {
                     parent = null;
                  }

                  value = m_context.getMachine().invoke(fun, parent, (Object[])null);
               }

               m_argList.add(value);
            }

            if (!bMissing)
            {
               Object value;
              
               if (mapping.getOrdinal() != 0)
               {
                  value = m_context.getMachine().invoke(
                     (Function)m_scriptArray[mapping.getOrdinal()], m_argList);
               }
               else
               {
                  value = m_argList.get(0);
               }
View Full Code Here


            {
               private int m_nOrdinal;

               public void handleElement(Element mappingElement, String sMappingName)
               {
                  TransformationMapping mapping = new TransformationMapping(sMappingName);

                  if (sMappingName == null)
                  {
                     sMappingName = String.valueOf(m_nOrdinal);
                  }
View Full Code Here

TOP

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

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.