Package nexj.core.scripting

Examples of nexj.core.scripting.ScriptingException


         machine.returnValue(new InstanceAssociationCollection(this, arg.toString()), nArgCount);

         return false;
      }

      throw new ScriptingException(
         (nArgCount < 1) ? "err.scripting.maxArgCount" : "err.scripting.maxArgCount",
         new Object[]{"#<association-collection>", Primitive.createInteger(1),
         Primitive.createInteger(nArgCount)});
   }
View Full Code Here


                  machine.returnValue(value, nArgCount);
               }
               else
               {
                  throw new ScriptingException("err.scripting.maxArgCount",
                     new Object[]{toString(),
                        Primitive.ONE_INTEGER,
                        Primitive.createInteger(nArgCount - 1)});
               }

               return false;
            }
            else
            {
               if (member.isStatic())
               {
                  machine.setArg(0, nArgCount, m_metaclass);
               }
               else
               {
                  machine.setArg(0, nArgCount, this);
               }

               if (m_metaclass.getLogger().isDebugEnabled())
               {
                  ((Event)member).dump(nArgCount, machine);
               }

               return ((Event)member).getFunction().invoke(nArgCount, machine);
            }
         }
      }
      else
      {
         throw new ScriptingException("err.scripting.minArgCount",
            new Object[]{m_metaclass.getName(),
               Primitive.ONE_INTEGER,
               Primitive.createInteger(nArgCount)});
      }

      throw new ScriptingException("err.scripting.funCall");
   }
View Full Code Here

                  {
                     machine.returnValue(findValue(sName), nArgCount);
                  }
                  else
                  {
                     throw new ScriptingException("err.scripting.tobjAttribute", new Object[]{sName});
                  }
               }
               else
               {
                  machine.returnValue(findValue(sName), nArgCount);
               }
            }
            else if (nArgCount == 2)
            {
               Object value = machine.getArg(1, nArgCount);

               if (sName.length() > 0 && sName.charAt(0) == ':')
               {
                  if (sym == Symbol._EVENT)
                  {
                     if (value != null && !(value instanceof String))
                     {
                        throw new TypeMismatchException(Symbol._EVENT);
                     }
                    
                     setEventName((String)value);
                  }
                  else if (sym == Symbol._CLASS)
                  {
                     if (value != null && !(value instanceof String))
                     {
                        throw new TypeMismatchException(Symbol._CLASS);
                     }
                    
                     setClassName((String)value);
                  }
                  else if (sym == Symbol._OID)
                  {
                     if (value != null && !(value instanceof OID))
                     {
                        throw new TypeMismatchException(Symbol._OID);
                     }
                    
                     setOID((OID)value);
                  }
                  else if (sym == Symbol._VERSION)
                  {
                     if (!(value instanceof Number))
                     {
                        throw new TypeMismatchException(Symbol._VERSION);
                     }
                    
                     setVersion(((Number)value).shortValue());
                  }
                  else if (sym == Symbol._CONTAINS)
                  {
                     if (value instanceof Symbol)
                     {
                        value = Boolean.valueOf(hasValue(value.toString()));
                     }
                     else if (value instanceof String)
                     {
                        value = Boolean.valueOf(hasValue((String)value));
                     }
                     else
                     {
                        throw new TypeMismatchException(Symbol._CONTAINS);
                     }
                  }
                  else if (sym == Symbol._GET)
                  {
                     if (value instanceof Symbol)
                     {
                        value = getValue(value.toString());
                     }
                     else if (value instanceof String)
                     {
                        value = getValue((String)value);
                     }
                     else
                     {
                        throw new TypeMismatchException(Symbol._GET);
                     }
                  }
                  else if (sym == Symbol._REMOVE)
                  {
                     if (value instanceof Symbol)
                     {
                        value = Boolean.valueOf(removeValue(value.toString()));
                     }
                     else if (value instanceof String)
                     {
                        value = Boolean.valueOf(removeValue((String)value));
                     }
                     else
                     {
                        throw new TypeMismatchException(Symbol._REMOVE);
                     }
                  }
                  else if (sym == Symbol._PRE)
                  {
                     setValue(sName, value);
                  }
                  else
                  {
                     throw new ScriptingException("err.scripting.tobjAttribute", new Object[]{sName});
                  }
               }
               else
               {
                  setValue(sName, value);
               }

               machine.returnValue(value, nArgCount);
            }
            else
            {
               throw new ScriptingException("err.scripting.maxArgCount",
                  new Object[]{sym.toString(),
                     Primitive.ONE_INTEGER,
                     Primitive.createInteger(nArgCount - 1)});
            }

            return false;
         }
         else
         {
            throw new ScriptingException("err.scripting.funCall");
         }
      }
      else
      {
         throw new ScriptingException("err.scripting.minArgCount",
            new Object[]{"TransferObject",
               Primitive.ONE_INTEGER,
               Primitive.createInteger(nArgCount)});
      }
   }
View Full Code Here

         {
            return symbol.evaluateNode(sValue, (Pair)expression, intArray, context);
         }
     }

     throw new ScriptingException("err.scripting.invalidMatchExpression",   // can get here
                                     new Object[] {expression});     // through a recursive call
   }
View Full Code Here

         {
            return node;
         }
      }

      throw new ScriptingException("err.scripting.invalidMatchExpression",
                                      new Object[] {fault});
   }
View Full Code Here

      if (attribute.isStatic())
      {
         return getValue(attribute.getOrdinal());
      }

      throw new ScriptingException("err.scripting.staticAttribute",
         new Object[]{attribute.getName(), getName()});
   }
View Full Code Here

      if (attribute.isStatic())
      {
         return getValue(attribute.getOrdinal());
      }

      throw new ScriptingException("err.scripting.staticAttribute",
         new Object[]{attribute.getName(), getName()});
   }
View Full Code Here

      {
         setValue(attribute.getOrdinal(), value);
      }
      else
      {
         throw new ScriptingException("err.scripting.staticAttribute",
            new Object[]{attribute.getName(), getName()});
      }
   }
View Full Code Here

   {
      Event event = (Event)getSelector(sName).getMember((args != null) ? args.length : 0);

      if (!event.isStatic())
      {
         throw new ScriptingException("err.scripting.staticEvent", new Object[]{sName, getName()});
      }

      return event.invoke(this, args, ThreadContextHolder.getContext().getMachine());
   }
View Full Code Here

   {
      Event event = (Event)getSelector(sName).getMember(Pair.length(args));

      if (!event.isStatic())
      {
         throw new ScriptingException("err.scripting.staticEvent", new Object[]{sName, getName()});
      }

      return event.invoke(this, args, ThreadContextHolder.getContext().getMachine());
   }
View Full Code Here

TOP

Related Classes of nexj.core.scripting.ScriptingException

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.