Package railo.runtime.exp

Examples of railo.runtime.exp.CasterException


        else if(o instanceof Number) return (((Number)o).shortValue());
        else if(o instanceof String) return (short)toDoubleValue(o.toString());                                                                                                                                                            
        else if(o instanceof Castable) return (short)((Castable)o).castToDoubleValue();
        else if(o instanceof ObjectWrap) return toShortValue(((ObjectWrap)o).getEmbededObject());
   
        throw new CasterException(o,"short");
    }
View Full Code Here


     */
    public static boolean stringToBooleanValue(String str) throws ExpressionException {
        str=StringUtil.toLowerCase(str.trim());
        if(str.equals("yes") || str.equals("true")) return true;
        else if(str.equals("no") || str.equals("false")) return false;
        throw new CasterException("Can't cast String ["+str+"] to boolean");
    }
View Full Code Here

        else if(o instanceof Calendar) return toString(((Calendar)o).getTime());
        else if(o == null) return "";
       
        // INFO Collection is new of type Castable
        if(o instanceof Map || o instanceof List || o instanceof Function)
            throw new CasterException(o,"string");
        /*if((x instanceof Query) ||
            (x instanceof RowSet) ||
            (x instanceof coldfusion.runtime.Array) ||
            (x instanceof JavaProxy) ||
            (x instanceof FileStreamWrapper))
View Full Code Here

      if(o instanceof UDF) return (UDF)o;
     
        else if(o instanceof ObjectWrap) {
            return toFunction(((ObjectWrap)o).getEmbededObject());
        }
        throw new CasterException(o,"function");
    }
View Full Code Here

        else if(o instanceof int[])return toList(ArrayUtil.toReferenceType((int[])o));
        else if(o instanceof long[])return toList(ArrayUtil.toReferenceType((long[])o));
        else if(o instanceof float[])return toList(ArrayUtil.toReferenceType((float[])o));
        else if(o instanceof double[])return toList(ArrayUtil.toReferenceType((double[])o));
       
        throw new CasterException(o,"List");
       

    }
View Full Code Here

        else if(o instanceof int[])return new ArrayImpl(ArrayUtil.toReferenceType((int[])o));
        else if(o instanceof long[])return new ArrayImpl(ArrayUtil.toReferenceType((long[])o));
        else if(o instanceof float[])return new ArrayImpl(ArrayUtil.toReferenceType((float[])o));
        else if(o instanceof double[])return new ArrayImpl(ArrayUtil.toReferenceType((double[])o));
       
        throw new CasterException(o,"Array");
    }
View Full Code Here

        else if(o instanceof int[])return ArrayUtil.toReferenceType((int[])o);
        else if(o instanceof long[])return ArrayUtil.toReferenceType((long[])o);
        else if(o instanceof float[])return ArrayUtil.toReferenceType((float[])o);
        else if(o instanceof double[])return ArrayUtil.toReferenceType((double[])o);
       
        throw new CasterException(o,"Array");
    }
View Full Code Here

            return (XMLCaster.toXMLStruct((Node)o,false));
        }
        else if(o instanceof ObjectWrap) {
            return toMap(((ObjectWrap)o).getEmbededObject(),duplicate);
        }
        throw new CasterException(o,"Map");
    }
View Full Code Here

            return new ObjectStruct(jo);
          }
            return toStruct(((ObjectWrap)o).getEmbededObject(),caseSensitive);
        }
        if(Decision.isSimpleValue(o) || Decision.isArray(o))
          throw new CasterException(o,"Struct");
        if(o instanceof Collection) return new CollectionStruct((Collection)o);

        if ( o == null )
            throw new CasterException( "null can not be casted to a Struct" );

        return new ObjectStruct(o);
    }
View Full Code Here

        }
        try {
      return Coder.decode(Coder.ENCODING_BASE64,toString(o));
    }
        catch (CoderException e) {
      throw new CasterException(e.getMessage(),"binary");
    }
        catch (PageException e) {
            throw new CasterException(o,"binary");
        }
    }
View Full Code Here

TOP

Related Classes of railo.runtime.exp.CasterException

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.