001/** 002 * 003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. 004 * 005 * This library is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU Lesser General Public 007 * License as published by the Free Software Foundation; either 008 * version 2.1 of the License, or (at your option) any later version. 009 * 010 * This library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 017 * 018 **/ 019package lucee.runtime; 020 021import java.io.Serializable; 022import java.lang.ref.SoftReference; 023 024import lucee.runtime.component.ImportDefintion; 025import lucee.runtime.type.Struct; 026import lucee.runtime.type.UDF; 027import lucee.runtime.type.UDFProperties; 028 029/** 030 * abstract Method for all generated Page Object 031 */ 032public abstract class Page implements Serializable{ 033 034 private static final ImportDefintion[] ZERO=new ImportDefintion[0]; 035 /** 036 * Field <code>FALSE</code> 037 */ 038 public static boolean FALSE=false; 039 040 /** 041 * Field <code>TRUE</code> 042 */ 043 public static boolean TRUE=true; 044 private PageSource pageSource; 045 private byte loadType; 046 047 048 049 050 /** 051 * return version definition of the page 052 * @return version 053 */ 054 public int getVersion() {return -1;} 055 056 /** 057 * method to invoke a page 058 * @param pc PageContext 059 * @throws Throwable 060 */ 061 public void call(PageContext pc) throws Throwable{ 062 063 } 064 065 066 /** 067 * return when the source file last time was modified 068 * @return last modification of source file 069 */ 070 public long getSourceLastModified() {return 0;} 071 072 /** 073 * return the time when the file was compiled 074 */ 075 public long getCompileTime() {return 0;} 076 077 /** 078 * @param pageSource 079 */ 080 public void setPageSource(PageSource pageSource) { 081 this.pageSource=pageSource; 082 } 083 /** 084 * @return Returns the pageResource. 085 */ 086 public PageSource getPageSource() { 087 return pageSource; 088 } 089 090 /** 091 * @return gets the load type 092 */ 093 public byte getLoadType() { 094 return loadType; 095 } 096 097 /** 098 * @param loadType sets the load type 099 */ 100 public void setLoadType(byte loadType) { 101 this.loadType = loadType; 102 } 103 104 public Object udfCall(PageContext pageContext, UDF udf,int functionIndex) throws Throwable { 105 return null; 106 } 107 108 public void threadCall(PageContext pageContext, int threadIndex) throws Throwable { 109 } 110 111 // FUTURE @deprecated use instead <code>udfDefaultValue(PageContext pc, int functionIndex, int argumentIndex, Object defaultValue)</code> 112 public Object udfDefaultValue(PageContext pc, int functionIndex, int argumentIndex) { 113 return null; 114 } 115 116 /*FUTURE public Object udfDefaultValue(PageContext pc, int functionIndex, int argumentIndex, Object defaultValue) { 117 return null; 118 }*/ 119 120 121 122 public ImportDefintion[] getImportDefintions() { 123 return ZERO; 124 } 125 126 127 public SoftReference<Struct> metaData; 128 129 public UDFProperties[] udfs; 130}