Package nexj.core.meta

Examples of nexj.core.meta.TypeMismatchException


                  right = coercedType.getConverter(rightType).invoke(right);
               }

               if ((fun = m_functionArray[coercedType.getOrdinal()]) == null)
               {
                  throw new TypeMismatchException(getSymbol());
               }

               if (fun.invoke(left, right) == Boolean.TRUE)
               {
                  left = right;
View Full Code Here


         Object left = machine.getArg(0, nArgCount);

         if (left != null && !(left instanceof String))
         {
            throw new TypeMismatchException(getSymbol());
         }

         String sLeft = (String)left;

         for (int i = 1; i < nArgCount; ++i)
         {
            Object right = machine.getArg(i, nArgCount);

            if (right != null && !(right instanceof String))
            {
               throw new TypeMismatchException(getSymbol());
            }

            String sRight = (String)right;

            if (!cmp(sLeft, sRight))
View Full Code Here

      {
         Object head = path.getHead();

         if (!(head instanceof Symbol))
         {
            throw new TypeMismatchException("#<instance-collection select/1>");
         }

         col = new InstanceAssociationCollection(col, head.toString());
      }
View Full Code Here

      {
         Object arg = machine.getArg(0, nArgCount);

         if (!(arg instanceof Symbol))
         {
            throw new TypeMismatchException("#<association-collection>");
         }

         String sName = arg.toString();

         if (sName.length() != 0 && sName.charAt(0) == ':')
View Full Code Here

                  return null;
               }

               if (!(obj instanceof Instance))
               {
                  throw new TypeMismatchException("#<instance-collection select/1>");
               }

               Instance instance = (Instance)obj;

               Object value = instance.getValue(m_sName);
View Full Code Here

      {
         Object value = machine.getArg(nCapacityIndex, nArgCount);

         if (!(value instanceof Number))
         {
            throw new TypeMismatchException(getSymbol());
         }

         int nCapacity = ((Number)value).intValue();

         if (nCapacity < 0)
View Full Code Here

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

      {
         Object value = machine.getArg(nArgIndex, nArgCount);

         if (!(value instanceof Number))
         {
            throw new TypeMismatchException(getSymbol());
         }

         return ((Number)value).intValue();
      }
View Full Code Here

      {
         Object obj = machine.getArg(nArgIndex, nArgCount);

         if (!(obj instanceof byte[]))
         {
            throw new TypeMismatchException(getSymbol());
         }

         return (byte[])obj;
      }
View Full Code Here

         if (obj instanceof Binary)
         {
            return ((Binary)obj).getData();
         }

         throw new TypeMismatchException(getSymbol());
      }
View Full Code Here

TOP

Related Classes of nexj.core.meta.TypeMismatchException

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.