Package nexj.core.meta.integration

Examples of nexj.core.meta.integration.TransformationSource


            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);
               }

               if (value != Undefined.VALUE)
               {
                  setDestination(mapping, source, value);
               }
            }
         }
      }

      if (obj != null && obj != Undefined.VALUE)
      {
         int nChildCount = source.getChildCount();

         if (nChildCount != 0)
         {
            PropertyMap tobj = (PropertyMap)obj;

            for (int nChild = 0; nChild != nChildCount; ++nChild)
            {
               TransformationSource child = source.getChild(nChild);

               if (child.isPrimary())
               {
                  Object value = child.getPart().getValue(tobj, Undefined.VALUE);

                  if (value == null)
                  {
                     if (child.isNull())
                     {
                        transform(null, child);
                     }
                  }
                  else if (value == Undefined.VALUE)
                  {
                     if (child.isDefault())
                     {
                        transform(value, child);
                     }
                  }
                  else
View Full Code Here


               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)
                        {
View Full Code Here

                     {
                        sSource = "";
                     }

                     StringTokenizer tokenizer = new StringTokenizer(sSource);
                     TransformationSource source = transformation.getRoot();

                     while (tokenizer.hasMoreTokens())
                     {
                        String sPartName = tokenizer.nextToken();
                        boolean bFixed = sPartName.endsWith("$");

                        if (bFixed)
                        {
                           sPartName = sPartName.substring(0, sPartName.length() - 1);
                        }

                        source = source.addChild(sPartName);

                        if (bFixed)
                        {
                           mapping.setFixedSource(source, true);
                        }
View Full Code Here

TOP

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

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.