Package railo.runtime.type.dt

Examples of railo.runtime.type.dt.DateTimeImpl


   * @param date Date to serialize
   * @return serialized date
   * @throws ConverterException
   */
  private String _serializeDate(Date date) {
    return _serializeDateTime(new DateTimeImpl(date));
  }
View Full Code Here


        if(o instanceof Number) return ((Number)o).intValue();
        else if(o instanceof Boolean) return ((Boolean)o).booleanValue()?1:0;
        else if(o instanceof String) return toIntValue(o.toString().trim());
        //else if(o instanceof Clob) return toIntValue(toString(o));
        else if(o instanceof Castable) return (int)((Castable)o).castToDoubleValue();
        else if(o instanceof Date) return (int)new DateTimeImpl((Date)o).castToDoubleValue();
       
        if(o instanceof String)
            throw new ExpressionException("Can't cast String ["+o.toString()+"] to a number");
        else if(o instanceof ObjectWrap) return toIntValue(((ObjectWrap)o).getEmbededObject());
   
View Full Code Here

        //else if(o instanceof Clob) return toIntValue(toString(o));
        else if(o instanceof Castable) {
            return (int)((Castable)o).castToDoubleValue(defaultValue);
           
        }
        else if(o instanceof Date) return (int)new DateTimeImpl((Date)o).castToDoubleValue();
        else if(o instanceof ObjectWrap) return toIntValue(((ObjectWrap)o).getEmbededObject(Integer.valueOf(defaultValue)),defaultValue);
   
        return defaultValue;
    }
View Full Code Here

        else if(o instanceof Number) return toString(((Number)o));
        else if(o instanceof Boolean) return toString(((Boolean)o).booleanValue());
        else if(o instanceof Castable) return ((Castable)o).castToString();
        else if(o instanceof Date) {
            if(o instanceof DateTime) return ((DateTime)o).castToString();
            return new DateTimeImpl((Date)o).castToString();
        }
        else if(o instanceof Clob) return toString((Clob)o);
        else if(o instanceof Node) return XMLCaster.toString((Node)o);
        else if(o instanceof Reader) {
          Reader r=null;
View Full Code Here

        else if(o instanceof Date) {
            if(o instanceof DateTime) {
                return ((DateTime)o).castToString(defaultValue);
               
            }
            return new DateTimeImpl((Date)o).castToString(defaultValue);
        }
        else if(o instanceof Clob) {
            try {
                return toString((Clob)o);
            } catch (ExpressionException e) {
View Full Code Here

    private final void readCollection(Config config, Element el) throws SearchException {
        SearchCollectionPlus sc;
        //try {
            // Collection
            DateTime last = DateCaster.toDateAdvanced(el.getAttribute("lastUpdate"),ThreadLocalPageContext.getTimeZone(config),null);
            if(last==null)last=new DateTimeImpl();
            DateTime cre = DateCaster.toDateAdvanced(el.getAttribute("created"),ThreadLocalPageContext.getTimeZone(config),null);
            if(cre==null)cre=new DateTimeImpl();
            ResourceProvider frp = ResourcesImpl.getFileResourceProvider();
            sc =(SearchCollectionPlus) _readCollection(
                    el.getAttribute("name"),
                    frp.getResource(el.getAttribute("path")),
                    el.getAttribute("language"),
View Full Code Here

  private Object getMeta(Key key, Object defaultValue) {
    if(KEY_ELAPSEDTIME.equalsIgnoreCase(key)) return new Double(System.currentTimeMillis()-ct.getStartTime());
    if(KeyConstants._NAME.equalsIgnoreCase(key)) return ct.getTagName();
    if(KEY_OUTPUT.equalsIgnoreCase(key)) return getOutput();
    if(KEY_PRIORITY.equalsIgnoreCase(key)) return ThreadUtil.toStringPriority(ct.getPriority());
    if(KEY_STARTTIME.equalsIgnoreCase(key)) return new DateTimeImpl(ct.getStartTime(),true);
    if(KEY_STATUS.equalsIgnoreCase(key)) return getState();
    if(KEY_ERROR.equalsIgnoreCase(key)) return ct.catchBlock;
    if(KEY_STACKTRACE.equalsIgnoreCase(key)) return getStackTrace();
    return defaultValue;
  }
View Full Code Here

    /**
     * change the last update attribute and store it
     * @throws SearchException
     */
    private void changeLastUpdate() throws SearchException {
        lastUpdate=new DateTimeImpl();
        searchEngine.store();
    }
View Full Code Here

    tz=ThreadLocalPageContext.getTimeZone(tz);
      if(locale==null)locale=pc.getLocale();
    SimpleDateFormat df = new SimpleDateFormat(format, locale);
    df.setTimeZone(tz);
    try {
      return new DateTimeImpl(df.parse(strDate));
    } catch (ParseException e) {
      throw Caster.toPageException(e);
    }
  }
View Full Code Here

      String str=Caster.toString(object);
     
      DateFormat[] formats=FormatUtil.getTimeFormats(locale,timeZone,true);
      for(int i=0;i<formats.length;i++) {
        try {
          return new DateTimeImpl(formats[i].parse(str).getTime(),false);
        }
        catch (ParseException e) {}
      }
     
    }
View Full Code Here

TOP

Related Classes of railo.runtime.type.dt.DateTimeImpl

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.