001    package railo.runtime.type.trace;
002    
003    import railo.runtime.PageContext;
004    import railo.runtime.debug.Debugger;
005    import railo.runtime.dump.DumpData;
006    import railo.runtime.dump.DumpProperties;
007    import railo.runtime.exp.PageException;
008    import railo.runtime.type.Query;
009    import railo.runtime.type.QueryImpl;
010    import railo.runtime.type.dt.DateTime;
011    
012    public class TODateTime extends DateTime implements TraceObject {
013    
014            private DateTime dt;
015            //private Debugger debugger;
016            private Query qry=new QueryImpl(
017                new String[]{"label","action","params","template","line","time"},
018                0,"traceObjects");
019            private int type;
020            private String category;
021            private String text;
022            private Debugger debugger;
023    
024            
025    
026            public TODateTime(Debugger debugger,DateTime dt, int type, String category, String text){
027                    this.dt=dt;
028                    this.debugger=debugger;
029                    this.type=type;
030                    this.category=category;
031                    this.text=text;
032            }
033            
034            public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties properties) {
035                    log();
036                    return dt.toDumpData(pageContext, maxlevel, properties);
037            }
038    
039            public String castToString() throws PageException {
040                    log();
041                    return dt.castToString();
042            }
043    
044            public String castToString(String defaultValue) {
045                    log();
046                    return dt.castToString(defaultValue);
047            }
048    
049            public boolean castToBooleanValue() throws PageException {
050                    log();
051                    return dt.castToBooleanValue();
052            }
053    
054            public Boolean castToBoolean(Boolean defaultValue) {
055                    log();
056                    return dt.castToBoolean(defaultValue);
057            }
058    
059            public double castToDoubleValue() throws PageException {
060                    log();
061                    return dt.castToDoubleValue();
062            }
063    
064            public double castToDoubleValue(double defaultValue) {
065                    log();
066                    return dt.castToDoubleValue(defaultValue);
067            }
068    
069            public DateTime castToDateTime() throws PageException {
070                    log();
071                    return this;
072            }
073    
074            public DateTime castToDateTime(DateTime defaultValue) {
075                    log();
076                    return this;
077            }
078    
079            public int compareTo(String str) throws PageException {
080                    log();
081                    return dt.compareTo(str);
082            }
083    
084            public int compareTo(boolean b) throws PageException {
085                    log();
086                    return dt.compareTo(b);
087            }
088    
089            public int compareTo(double d) throws PageException {
090                    log();
091                    return dt.compareTo(d);
092            }
093    
094            public int compareTo(DateTime dt) throws PageException {
095                    log();
096                    return dt.compareTo(dt);
097            }
098    
099            public double toDoubleValue() {
100                    log();
101                    return this.dt.toDoubleValue();
102            }
103            
104    
105            protected void log() {
106                    TraceObjectSupport.log(debugger,type,category,text,null,null);
107            }
108    
109            public Query getDebugData() {
110                    return qry;
111            }
112    }