Package nexj.core.util

Examples of nexj.core.util.Lookup


    */
   private final ExceptionHolder compile(Machine machine, ExceptionHolder eh)
   {
      verifyNotReadOnly();

      Lookup urlMap = (m_textPosMap == null) ? null : new IdentityHashTab(m_textPosMap.size() * 2);

      eh = resolveInheritance2(urlMap, eh);
      m_logger = Logger.getLogger(LOG_CATEGORY_PREFIX + getName());
      setCurrent();

      // Compile the validation function
      if (m_validation != Undefined.VALUE)
      {
         if (m_base != null && m_validation == m_base.m_validation)
         {
            m_validationFunction = m_base.m_validationFunction;
         }
         else
         {
            try
            {
               Object expr = new Pair(Symbol.LAMBDA, new Pair(new Pair(Symbol.THIS), new Pair(m_validation)));

               if (m_textPosMap != null)
               {
                  TextPosition pos = new TextPosition(0,0);

                  m_textPosMap.put(expr, pos);
                  urlMap.put(pos, "class:" + getName() + "$validation");
               }

               m_validationFunction = new Compiler().compile(expr, m_textPosMap, urlMap, machine, false);
            }
            catch (Exception e)
View Full Code Here


   protected boolean serializeValues(Writer writer, InvocationContext context)
   {
      int nCount = m_flow.getVariableCount();
      TransferObject tobj = new TransferObject(nCount + ((m_tokenMap == null) ? 0 : m_tokenMap.size()));
      TransferObject instances = null;
      Lookup identityMap = null;

      for (int i = 0; i != nCount; ++i)
      {
         Variable var = m_flow.getVariable(i);
         Object value = getValue(var);
View Full Code Here

      else
      {
         int nActionCount = getActionCount();
         final int nArgOffset = 7; // number of non-vararg arguments
         Object[] args = new Object[Math.max(nActionCount, 1) + nArgOffset];
         Lookup posMap = new IdentityHashTab(64);
         Lookup urlMap = new IdentityHashTab(64);
         String sEventURL = getURL(m_metaclass);
         String sURLPrefix = sEventURL + "$";

         // When updating the event generator invocation code,
         // also update the plugin action compilation validation
         args[0] = this;
         args[1] = getArguments(true);
         args[2] = getVariables();
         args[3] = getPrivilege();

         if (m_accessAttribute == null)
         {
            args[4] = null;
         }
         else if (m_bStatic)
         {
            if (m_accessAttribute.isStatic())
            {
               args[4] = Primitive.createInteger(m_accessAttribute.getOrdinal());
            }
            else
            {
               args[4] = null;
            }
         }
         else
         {
            args[4] = Primitive.createInteger(
               (m_accessAttribute.isStatic()) ?
                  -1 -m_accessAttribute.getOrdinal() :
                  m_accessAttribute.getOrdinal());
         }

         args[5] = Boolean.valueOf(getArgumentCount() == 0 && "delete".equals(m_sName));

         byte nTransactionMode = ((getSymbol() == Symbol.CREATE || getSymbol() == Symbol.UPDATE) &&
            getArgumentCount() == 0) ? TX_SUPPORTED : getTransactionMode();

         args[6] = Primitive.createInteger(nTransactionMode);
         m_bTransient = (nTransactionMode != TX_SUPPORTED);

         for (int i = 0; i < nActionCount; ++i)
         {
            Action action = getAction(i);
            Object condition = action.getCondition();
            String sURL;
            Object body;

            if (action.getDeclarator() != null)
            {
               sURL = getURL(action.getDeclarator()) + "$" + action.getFullName();
            }
            else
            {
               sURL = sURLPrefix + action.getFullName();
            }

            if (action.getMethod() == null)
            {
               body = action.getBody();

               if (body == null)
               {
                  body = EMPTY_BODY;
               }
            }
            else
            {
               body = Pair.list(Pair.list(Pair.quote(new JavaAction(action)),
                  (action.getType() == Action.AROUND) ? Symbol.CALL_NEXT : EMPTY_CLOSURE));
            }

            Lookup map = action.getTextPositionMap();

            if (map != null)
            {
               for (Lookup.Iterator itr = map.iterator(); itr.hasNext();)
               {
                  itr.next();
                  posMap.put(itr.getKey(), itr.getValue());
                  urlMap.put(itr.getValue(), sURL);
               }
View Full Code Here

      Upgrade upgrade = getMetadata().getUpgrade("Main");

      upgrade.validate(getMetadata(), null);

      VersionUpgrade firstVersion = upgrade.getFirstVersion();
      Lookup stateMap = Upgrade.getInitialState(firstVersion);
      SchemaVersion version = new SchemaVersion();

      version.setNamespace(getMetadata().getNamespace());
      version.setUpgradable(true);
View Full Code Here

TOP

Related Classes of nexj.core.util.Lookup

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.