Package nexj.core.scripting

Examples of nexj.core.scripting.Symbol


            Object head = attributes.getHead();

            if (head instanceof Pair)
            {
               Pair field = (Pair)head;
               Symbol sym = (Symbol)field.getHead();

               if (sym == Symbol.ATAT)
               {
                  field = field.getNext();

                  if (instance.getMetaclass().getMetadata().getMetaclass(
                     ((Symbol)field.getHead()).getName()).isUpcast(instance.getMetaclass()))
                  {
                     collectInstances(instance, field.getNext(), instanceSet);
                  }
               }
               else
               {
                  collectInstances(instance.getValue(sym.getName()), field.getNext(), instanceSet);
               }
            }
            else
            {
               collectInstances(instance.getValue(((Symbol)head).getName()), null, instanceSet);
View Full Code Here


    */
   public static Instance audit(Instance instance, PropertyMap tobj, Event event, boolean bForce, InvocationContext context)
   {
      if (bForce || event.isAudited())
      {
         Symbol symbol = event.getSymbol();
         int nArgCount = event.getArgumentCount();
         boolean bStatic = event.isStatic();

         if (instance == null ||
            instance.getUnitOfWork() == null ||
View Full Code Here

         if (head instanceof Pair)
         {
            assoc = (Pair)head;

            Symbol sym = (Symbol)assoc.getHead();

            assoc = assoc.getNext();

            if (sym == Symbol.ATAT)
            {
View Full Code Here

         if (head instanceof Pair)
         {
            assoc = (Pair)head;

            Symbol sym = (Symbol)assoc.getHead();

            assoc = assoc.getNext();

            if (sym == Symbol.ATAT)
            {
View Full Code Here

               reader.getValue("offset"), reader.getValue("xlock"));

            reader.setValue("event", args);
         }

         Symbol symbol = (Symbol)args.getHead();

         args = args.getNext();

         Event event = (Event)m_context.getMetadata()
            .getMetaclass(((Symbol)reader.getValue("class")).getName())
View Full Code Here

         if (!isEnabled(reader))
         {
            return setEmptyResult(reader);
         }

         Symbol classSym = (Symbol)reader.getValue("class");
         Pair attributes = (Pair)reader.getValue("attributes");
         Object where = reader.getValue("where");
         Pair orderBy = (Pair)reader.getValue("orderBy");
         Number count = (Number)reader.getValue("count");
         Number offset = (Number)reader.getValue("offset");
         Boolean xlock = (Boolean)reader.getValue("xlock");
         Pair bookmark = (Pair)reader.getValue("bookmark");
         Boolean next = (Boolean)reader.getValue("next");
         Boolean inclusive = (Boolean)reader.getValue("inclusive");
         List parentList = (List)reader.getValue("parents");
         Object args = reader.getValue("event");
         Metaclass metaclass = m_context.getMetadata().getMetaclass(classSym.getName());
         Object[] argArray = null;
         Event event = null;

         if (args instanceof Pair)
         {
View Full Code Here

         Pair lastConj = null;

         for (Pair pair = orderBy, mark = bookmark;;
            pair = pair.getNext(), mark = mark.getNext())
         {
            Symbol op;

            if (pair.getTail() == lastOrderBy || mark.getTail() == null)
            {
               lastOrderBy = pair;
View Full Code Here

      instance.setNew();

      for (; values != null; values = values.getNext())
      {
         Pair pair = (Pair)values.getHead();
         Symbol sym = (Symbol)pair.getHead();

         if (sym == Symbol._OID)
         {
            instance.setOID((OID)pair.getTail());
         }
         else
         {
            instance.setValue(sym.getName(), pair.getTail());
         }
      }

      ((Event)metaclass.getSelector("create").getMember(0)).invoke(instance, (Object[])null, m_context.getMachine());
View Full Code Here

      Variable indexVar = new Variable(sLoopName + ":var");

      activity.getFlow().addVariable(indexVar);

      Symbol collectionSym = collectionVar.getSymbol();
      Symbol indexSym = indexVar.getSymbol();
      Symbol itemSym = itemVar.getSymbol();

      // Loop initializer step
      Script initializer = new Script(sLoopName + ":init");

      initializer.setActivity(activity);
View Full Code Here

    * @param bReplace True to replace an already existing attribute with the same name,
    *    false to throw an exception instead.
    */
   public void addAttribute(AttributeObject attribute, boolean bReplace)
   {
      Symbol symbol = attribute.getSymbol();
      int nOrdinal = findAttributeOrdinal(symbol);

      if (nOrdinal >= 0)
      {
         if (!bReplace)
         {
            throw new DeclarationException("err.scripting.attributeDup",
               new Object[]{symbol.getName(), getName()});
         }
      }
      else
      {
         for (int i = 0; i <= 1; ++i)
         {
            if (findMethod(symbol, i) != null)
            {
               throw new DeclarationException("err.scripting.methodDup",
                  new Object[]{symbol.getName(), Primitive.createInteger(i), getName()});
            }
         }
      }

      if (attribute.getHolder() != null && attribute.getHolder() != this)
      {
         throw new DeclarationException("err.scripting.attributeReuse",
            new Object[]{symbol.getName(),
               attribute.getHolder().getName(),
               getName()});
      }

      getMetaclass().validateAttribute(this, attribute);
View Full Code Here

TOP

Related Classes of nexj.core.scripting.Symbol

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.