1 61 62 63 package org.jaxen; 64 65 import org.jaxen.function.BooleanFunction; 66 import org.jaxen.function.CeilingFunction; 67 import org.jaxen.function.ConcatFunction; 68 import org.jaxen.function.ContainsFunction; 69 import org.jaxen.function.CountFunction; 70 import org.jaxen.function.FalseFunction; 71 import org.jaxen.function.FloorFunction; 72 import org.jaxen.function.IdFunction; 73 import org.jaxen.function.LangFunction; 74 import org.jaxen.function.LastFunction; 75 import org.jaxen.function.LocalNameFunction; 76 import org.jaxen.function.NameFunction; 77 import org.jaxen.function.NamespaceUriFunction; 78 import org.jaxen.function.NormalizeSpaceFunction; 79 import org.jaxen.function.NotFunction; 80 import org.jaxen.function.NumberFunction; 81 import org.jaxen.function.PositionFunction; 82 import org.jaxen.function.RoundFunction; 83 import org.jaxen.function.StartsWithFunction; 84 import org.jaxen.function.StringFunction; 85 import org.jaxen.function.StringLengthFunction; 86 import org.jaxen.function.SubstringAfterFunction; 87 import org.jaxen.function.SubstringBeforeFunction; 88 import org.jaxen.function.SubstringFunction; 89 import org.jaxen.function.SumFunction; 90 import org.jaxen.function.TranslateFunction; 91 import org.jaxen.function.TrueFunction; 92 import org.jaxen.function.ext.EndsWithFunction; 93 import org.jaxen.function.ext.EvaluateFunction; 94 import org.jaxen.function.ext.LowerFunction; 95 import org.jaxen.function.ext.MatrixConcatFunction; 96 import org.jaxen.function.ext.UpperFunction; 97 import org.jaxen.function.xslt.DocumentFunction; 98 99 135 public class XPathFunctionContext extends SimpleFunctionContext 136 { 137 private static XPathFunctionContext instance = new XPathFunctionContext(); 138 139 143 public static FunctionContext getInstance() 144 { 145 return instance; 146 } 147 148 151 public XPathFunctionContext() 152 { 153 registerFunction( null, "boolean", 155 new BooleanFunction() ); 156 157 registerFunction( null, "ceiling", 159 new CeilingFunction() ); 160 161 registerFunction( null, "concat", 163 new ConcatFunction() ); 164 165 registerFunction( null, "contains", 167 new ContainsFunction() ); 168 169 registerFunction( null, "count", 171 new CountFunction() ); 172 173 registerFunction( null, "false", 175 new FalseFunction() ); 176 177 registerFunction( null, "floor", 179 new FloorFunction() ); 180 181 registerFunction( null, "id", 183 new IdFunction() ); 184 185 registerFunction( null, "lang", 187 new LangFunction() ); 188 189 registerFunction( null, "last", 191 new LastFunction() ); 192 193 registerFunction( null, "local-name", 195 new LocalNameFunction() ); 196 197 registerFunction( null, "name", 199 new NameFunction() ); 200 201 registerFunction( null, "namespace-uri", 203 new NamespaceUriFunction() ); 204 205 registerFunction( null, "normalize-space", 207 new NormalizeSpaceFunction() ); 208 209 registerFunction( null, "not", 211 new NotFunction() ); 212 213 registerFunction( null, "number", 215 new NumberFunction() ); 216 217 registerFunction( null, "position", 219 new PositionFunction() ); 220 221 registerFunction( null, "round", 223 new RoundFunction() ); 224 225 registerFunction( null, "starts-with", 227 new StartsWithFunction() ); 228 229 registerFunction( null, "string", 231 new StringFunction() ); 232 233 registerFunction( null, "string-length", 235 new StringLengthFunction() ); 236 237 registerFunction( null, "substring-after", 239 new SubstringAfterFunction() ); 240 241 registerFunction( null, "substring-before", 243 new SubstringBeforeFunction() ); 244 245 registerFunction( null, "substring", 247 new SubstringFunction() ); 248 249 registerFunction( null, "sum", 251 new SumFunction() ); 252 253 registerFunction( null, "true", 255 new TrueFunction() ); 256 257 registerFunction( null, "translate", 259 new TranslateFunction() ); 260 261 registerFunction( null, "document", 264 new DocumentFunction() ); 265 266 270 registerFunction( null, "matrix-concat", 272 new MatrixConcatFunction() ); 273 274 registerFunction( null, "evaluate", 276 new EvaluateFunction() ); 277 278 registerFunction( null, "lower-case", 280 new LowerFunction() ); 281 282 registerFunction( null, "upper-case", 284 new UpperFunction() ); 285 286 registerFunction( null, "ends-with", 288 new EndsWithFunction() ); 289 290 } 291 } 292 | Popular Tags |