Package org.apache.commons.collections

Examples of org.apache.commons.collections.FunctorException


        public T create() {
            try {
                return clazz.newInstance();
            } catch (final Exception ex) {
                throw new FunctorException("Cannot instantiate class: " + clazz, ex);
            }
        }
View Full Code Here


/* 47 */     return INSTANCE;
/*    */   }
/*    */
/*    */   public void execute(Object input)
/*    */   {
/* 64 */     throw new FunctorException("ExceptionClosure invoked");
/*    */   }
View Full Code Here

/*     */     try
/*     */     {
/* 128 */       return this.iConstructor.newInstance(this.iArgs);
/*     */     }
/*     */     catch (InstantiationException ex) {
/* 131 */       throw new FunctorException("InstantiateFactory: InstantiationException", ex);
/*     */     } catch (IllegalAccessException ex) {
/* 133 */       throw new FunctorException("InstantiateFactory: Constructor must be public", ex); } catch (InvocationTargetException ex) {
/*     */     }
/* 135 */     throw new FunctorException("InstantiateFactory: Constructor threw an exception", ex);
/*     */   }
View Full Code Here

/*    */   }
/*    */
/*    */   public boolean evaluate(Object object)
/*    */   {
/* 73 */     if (object == null) {
/* 74 */       throw new FunctorException("Input Object must not be null");
/*    */     }
/* 76 */     return this.iPredicate.evaluate(object);
/*    */   }
View Full Code Here

/*     */   public Object transform(Object input)
/*     */   {
/*     */     try
/*     */     {
/*  99 */       if (!(input instanceof Class)) {
/* 100 */         throw new FunctorException("InstantiateTransformer: Input object was not an instanceof Class, it was a " + (input == null ? "null object" : input.getClass().getName()));
/*     */       }
/*     */
/* 104 */       Constructor con = ((Class)input).getConstructor(this.iParamTypes);
/* 105 */       return con.newInstance(this.iArgs);
/*     */     }
/*     */     catch (NoSuchMethodException ex) {
/* 108 */       throw new FunctorException("InstantiateTransformer: The constructor must exist and be public ");
/*     */     } catch (InstantiationException ex) {
/* 110 */       throw new FunctorException("InstantiateTransformer: InstantiationException", ex);
/*     */     } catch (IllegalAccessException ex) {
/* 112 */       throw new FunctorException("InstantiateTransformer: Constructor must be public", ex); } catch (InvocationTargetException ex) {
/*     */     }
/* 114 */     throw new FunctorException("InstantiateTransformer: Constructor threw an exception", ex);
/*     */   }
View Full Code Here

/* 123 */       Class cls = input.getClass();
/* 124 */       Method method = cls.getMethod(this.iMethodName, this.iParamTypes);
/* 125 */       return method.invoke(input, this.iArgs);
/*     */     }
/*     */     catch (NoSuchMethodException ex) {
/* 128 */       throw new FunctorException("InvokerTransformer: The method '" + this.iMethodName + "' on '" + input.getClass() + "' does not exist");
/*     */     } catch (IllegalAccessException ex) {
/* 130 */       throw new FunctorException("InvokerTransformer: The method '" + this.iMethodName + "' on '" + input.getClass() + "' cannot be accessed"); } catch (InvocationTargetException ex) {
/*     */     }
/* 132 */     throw new FunctorException("InvokerTransformer: The method '" + this.iMethodName + "' on '" + input.getClass() + "' threw an exception", ex);
/*     */   }
View Full Code Here

/* 183 */         localObject1 = in.readObject();
/*     */       }
/*     */       catch (ClassNotFoundException ex)
/*     */       {
/*     */         Object localObject1;
/* 186 */         throw new FunctorException(ex);
/*     */       } catch (IOException ex) {
/* 188 */         throw new FunctorException(ex);
/*     */       } finally {
/*     */         try {
/* 191 */           if (bais != null)
/* 192 */             bais.close();
/*     */         }
View Full Code Here

/*     */       try
/*     */       {
/* 138 */         return this.iCloneMethod.invoke(this.iPrototype, null);
/*     */       }
/*     */       catch (IllegalAccessException ex) {
/* 141 */         throw new FunctorException("PrototypeCloneFactory: Clone method must be public", ex); } catch (InvocationTargetException ex) {
/*     */       }
/* 143 */       throw new FunctorException("PrototypeCloneFactory: Clone method threw an exception", ex);
/*     */     }
View Full Code Here

/*    */
/*    */   public boolean evaluate(Object object)
/*    */   {
/* 73 */     Object result = this.iTransformer.transform(object);
/* 74 */     if (!(result instanceof Boolean)) {
/* 75 */       throw new FunctorException("Transformer must return an instanceof Boolean, it was a " + (result == null ? "null object" : result.getClass().getName()));
/*    */     }
/*    */
/* 79 */     return ((Boolean)result).booleanValue();
/*    */   }
View Full Code Here

/* 47 */     return INSTANCE;
/*    */   }
/*    */
/*    */   public Object transform(Object input)
/*    */   {
/* 65 */     throw new FunctorException("ExceptionTransformer invoked");
/*    */   }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.FunctorException

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.