Package nexj.core.scripting

Examples of nexj.core.scripting.Pair


      if (assoc == null)
      {
         assoc = EMPTY_ASSOC;
      }

      m_functionMap.put(event, assoc, new Pair(code, m_functionMap.get(event, assoc)));
      setPosURLs(code, step.getName());
   }
View Full Code Here


      for (Lookup2D.Iterator itr = m_functionMap.valueIterator(); itr.hasNext();)
      {
         itr.next();

         Event event = (Event)itr.getKey1();
         Pair body = (Pair)machine.invoke((Function)machine.getGlobalEnvironment()
            .getVariable(Symbol.SYS_GENERATE_FLOW_FUNCTION), itr.getValue(), (Object[])null);

         itr.setValue(new Pair(new Compiler().compile(m_variables,
            event.getArguments(true), body, m_posMap, m_urlMap, machine)));
         map.put(event.getRoot(), itr.getKey2(), null);
      }

      for (Lookup2D.Iterator itr = map.valueIterator(); itr.hasNext();)
View Full Code Here

      Metaclass metaclass = event.getMetaclass();
     
      for (int i = 0, nCount = metaclass.getDerivedCount(); i < nCount; ++i)
      {
         Event derived = metaclass.getDerived(i).findEvent(event.getName(), event.getArgumentCount());
         Pair dpair = (Pair)m_functionMap.get(derived, assoc);
        
         if (pair != null)
         {
            dpair = Pair.append(pair, dpair);
            m_functionMap.put(derived, assoc, dpair);
View Full Code Here

       *
       * @see nexj.core.meta.xml.XMLSOAMetadataLoader.SOAObject#getCode()
       */
      public Object getCode()
      {
         Pair interfaces = null;

         for (int i = m_interfaceList.size() - 1; i >= 0; i--)
         {
            interfaces = new Pair(
               Symbol.define(((InterfaceRef)m_interfaceList.get(i)).getInterface().getGlobalName()),
               interfaces
            );
         }

         Pair implementations = null;

         if (m_implementation != null)
         {
            for (Iterator itr = m_implementation.getInterfaceImplementationIterator(); itr.hasNext(); )
            {
               InterfaceImplementation ifaceImpl = (InterfaceImplementation)itr.next();

               implementations = new Pair(Symbol.define(ifaceImpl.getGlobalName()), implementations);
            }
         }

         return Pair.list(
            DEFINE_CLASS,
View Full Code Here

       *
       * @see nexj.core.meta.xml.XMLSOAMetadataLoader.SOAObject#getCode()
       */
      public Object getCode()
      {
         Pair methods = null;

         for (Iterator itr = m_methodSet.iterator(); itr.hasNext(); )
         {
            methods = new Pair(((Method)itr.next()).getCode(), methods);
         }

         return new Pair(
            DEFINE_CLASS,
            new Pair(Symbol.define(getGlobalName()),
               new Pair(null,
                  new Pair(getDescription(), methods)
               )
            )
         );
      }
View Full Code Here

       *
       * @see nexj.core.meta.xml.XMLSOAMetadataLoader.SOAObject#getCode()
       */
      public Object getCode()
      {
         Pair argList = null;

         for (int i = m_argumentList.size() - 1; i >= 0; i--)
         {
            argList = new Pair(((Argument)m_argumentList.get(i)).getCode(), argList);
         }

         return Pair.list(
            CLASS_METHOD,
            Symbol.define(m_sName),
View Full Code Here

    */
   public void generate(Machine machine)
   {
      verifyNotReadOnly();

      Pair body = getBody();

      if (body != null)
      {
         if (m_activity.getFlow().isPrivileged())
         {
            body = Pair.list(new Pair(Symbol.BEGIN_PRIVILEGED, body));
         }

         m_function = compile(ARGUMENTS, body, machine);
      }
   }
View Full Code Here

       *
       * @see nexj.core.meta.xml.XMLSOAMetadataLoader.SOAObject#getCode()
       */
      public Object getCode()
      {
         Pair attributes = null;

         for (Iterator itr = m_attributeSet.iterator(); itr.hasNext(); )
         {
            attributes = new Pair(((Attribute)itr.next()).getCode(), attributes);
         }

         Pair bases = null;

         for (int i = m_baseList.size() - 1; i >= 0; i--)
         {
            bases = new Pair(Symbol.define(((ModelType)m_baseList.get(i)).getGlobalName()), bases);
         }

         return new Pair(
            DEFINE_CLASS,
            new Pair(Symbol.define(getGlobalName()),
               new Pair(bases,
                  new Pair(getDescription(), attributes)
               )
            )
         );
      }
View Full Code Here

       *
       * @see nexj.core.meta.xml.XMLSOAMetadataLoader.CodeProvider#getCode()
       */
      public Object getCode()
      {
         Pair code = null;

         for (Iterator itr = m_interfaceSet.iterator(); itr.hasNext(); )
         {
            InterfaceImplementation iface = (InterfaceImplementation)itr.next();

            code = new Pair(iface.getCode(), code);
         }

         return new Pair(Symbol.BEGIN, code);
      }
View Full Code Here

    * @param sym The argument symbol.
    * @param arg The argument expression.
    */
   protected static Pair addArg(Pair code, Symbol sym, Object arg)
   {
      return new Pair(Pair.list(Symbol.CONS, Pair.quote(sym), arg), code);
   }
View Full Code Here

TOP

Related Classes of nexj.core.scripting.Pair

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.