Package railo.runtime.exp

Examples of railo.runtime.exp.CasterException


    public static Component toComponent(Object o ) throws PageException {
        if(o instanceof Component) return (Component)o;
        else if(o instanceof ObjectWrap) {
            return toComponent(((ObjectWrap)o).getEmbededObject());
        }
        throw new CasterException(o,"Component");
    }
View Full Code Here


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

     */
    public static Object toNull(Object value) throws PageException {
       if(value==null)return null;
       if(value instanceof String && Caster.toString(value).trim().length()==0) return null;
       if(value instanceof Number && ((Number)value).intValue()==0) return null;
       throw new CasterException(value,"null");
    }
View Full Code Here

      if(existing)
        return ResourceUtil.toResourceExisting(pc, (String)src,allowRealpath);
      return ResourceUtil.toResourceNotExisting(pc, (String)src,allowRealpath);
    }
    if(src instanceof FileStreamWrapper) return ((FileStreamWrapper)src).getResource();
        throw new CasterException(src,"Resource");
  }
View Full Code Here

      if(existing)
        return ResourceUtil.toResourceExisting(config, (String)src);
      return ResourceUtil.toResourceNotExisting(config, (String)src);
    }
    if(src instanceof FileStreamWrapper) return ((FileStreamWrapper)src).getResource();
        throw new CasterException(src,"Resource");
  }
View Full Code Here

    return c;
  }

  public static Serializable toSerializable(Object object) throws CasterException {
    if(object instanceof Serializable)return (Serializable)object;
    throw new CasterException(object,"Serializable");
  }
View Full Code Here

      throw toPageException(ioe);
    }
    catch(SQLException ioe) {
      throw toPageException(ioe);
    }
    throw new CasterException(obj,byte[].class);
  }
View Full Code Here

      throw toPageException(ioe);
    }
    catch(SQLException ioe) {
      throw toPageException(ioe);
    }
    throw new CasterException(obj,InputStream.class);
  }
View Full Code Here

    throw new CasterException(obj,InputStream.class);
  }

  public static OutputStream toOutputStream(Object obj) throws PageException {
    if(obj instanceof OutputStream)return (OutputStream)obj;
    throw new CasterException(obj,OutputStream.class);
  }
View Full Code Here

        else if(o instanceof Boolean) return new BigDecimal(((Boolean)o).booleanValue()?1:0);
        else if(o instanceof String) return new BigDecimal(o.toString());
        else if(o instanceof Castable) return new BigDecimal(((Castable)o).castToDoubleValue());
        else if(o == null) return BigDecimal.ZERO;
        else if(o instanceof ObjectWrap) return toBigDecimal(((ObjectWrap)o).getEmbededObject());
        throw new CasterException(o,"number");
  }
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.