001 package railo.runtime; 002 003 004 import railo.commons.lang.types.RefBoolean; 005 import railo.runtime.component.Property; 006 import railo.runtime.exp.PageException; 007 import railo.runtime.type.Collection; 008 import railo.runtime.type.Objects; 009 import railo.runtime.type.Struct; 010 import railo.runtime.type.UDF; 011 import railo.runtime.type.UDFProperties; 012 /** 013 * interface for a Component 014 */ 015 public interface Component extends Struct,Objects,CFObject { 016 017 /** 018 * Constant for Access Mode Remote 019 */ 020 public static final int ACCESS_REMOTE = 0; 021 022 /** 023 * Constant for Access Mode Public 024 */ 025 public static final int ACCESS_PUBLIC = 1; 026 027 /** 028 * Constant for Access Mode Package 029 */ 030 public static final int ACCESS_PACKAGE = 2; 031 032 /** 033 * Constant for Access Mode Private 034 */ 035 public static final int ACCESS_PRIVATE = 3; 036 037 /** 038 * Field <code>ACCESS_COUNT</code> 039 */ 040 public static final int ACCESS_COUNT=4; 041 042 /** 043 * returns java class to the component interface (all UDFs), 044 * this class is generated dynamic when used 045 * @param isNew 046 * @throws PageException 047 * FUTURE deprecated 048 */ 049 public Class getJavaAccessClass(RefBoolean isNew) throws PageException; 050 // FUTURE public Class getJavaAccessClass(PageContext pc,RefBoolean isNew) throws PageException; 051 052 /** 053 * @return Returns the display name. 054 */ 055 public abstract String getDisplayName(); 056 057 /** 058 * @return Returns the Extends. 059 */ 060 public abstract String getExtends(); 061 062 /** 063 * @return Returns the Hint. 064 */ 065 public abstract String getHint(); 066 067 /** 068 * @return Returns the Name. 069 */ 070 public abstract String getName(); 071 072 /** 073 * @return Returns the Name. 074 */ 075 public abstract String getCallName(); 076 077 /** 078 * @return Returns the Name. 079 */ 080 public abstract String getAbsName(); 081 082 /** 083 * @return Returns the output. 084 */ 085 public abstract boolean getOutput(); 086 087 /** 088 * check if Component is instance of this type 089 * @param type type to compare as String 090 * @return is instance of this type 091 */ 092 public abstract boolean instanceOf(String type); 093 094 /** 095 * check if value is a valid access modifier constant 096 * @param access 097 * @return is valid access 098 */ 099 public abstract boolean isValidAccess(int access); 100 101 102 /** 103 * returns Meta Data to the Component 104 * @param pc 105 * @return meta data to component 106 * @throws PageException 107 */ 108 public abstract Struct getMetaData(PageContext pc) throws PageException; 109 110 /** 111 * call a method of the component with no named arguments 112 * @param pc PageContext 113 * @param key name of the method 114 * @param args Arguments for the method 115 * @return return result of the method 116 * @throws PageException 117 */ 118 public abstract Object call(PageContext pc, String key, Object[] args) throws PageException; 119 120 /** 121 * call a method of the component with named arguments 122 * @param pc PageContext 123 * @param key name of the method 124 * @param args Named Arguments for the method 125 * @return return result of the method 126 * @throws PageException 127 */ 128 public abstract Object callWithNamedValues(PageContext pc, String key, Struct args) throws PageException; 129 130 131 /** 132 * return all properties from component 133 * @param onlyPeristent if true return only columns where attribute persistent is not set to false 134 * @return 135 */ 136 public Property[] getProperties(boolean onlyPeristent);// FUTURE deprecated 137 138 public void setProperty(Property property) throws PageException; 139 140 public ComponentScope getComponentScope(); 141 142 public boolean contains(PageContext pc,Key key); 143 144 public PageSource getPageSource(); 145 //public Member getMember(int access,Collection.Key key, boolean dataMember,boolean superAccess); 146 147 public String getBaseAbsName(); 148 149 public boolean isBasePeristent(); 150 151 public boolean equalTo(String type); 152 153 public String getWSDLFile(); 154 155 156 157 158 public void registerUDF(String key, UDF udf); 159 160 public void registerUDF(Collection.Key key, UDF udf); 161 162 public void registerUDF(String key, UDFProperties props); 163 164 public void registerUDF(Collection.Key key, UDFProperties props); 165 }