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.transformer.cfml.evaluator; 020 021import lucee.runtime.config.Config; 022import lucee.runtime.exp.TemplateException; 023import lucee.transformer.bytecode.statement.tag.Tag; 024import lucee.transformer.cfml.Data; 025import lucee.transformer.library.function.FunctionLib; 026import lucee.transformer.library.tag.TagLib; 027import lucee.transformer.library.tag.TagLibTag; 028 029 030 031 032/** 033 * Die Klasse EvaluatorSupport hat die Aufgabe, 034 * Zugriffe auf die CFXD zu vereinfachen. 035 * Dazu stellt die Klasse mehrere Methoden zur Verfuegung die verschiedene, immer wieder verwendete Abfragen 036 * abbilden. 037 * Die Klasse implementiert das Interface Evaluator. 038 * Desweiteren splittet diese Klasse auch die Methode evaluate in drei Methoden auf so, 039 * das man eine hoehere flexibilitaet beim Einstiegspunkt einer konkreten Implementation hat. 040 * 041 */ 042public class EvaluatorSupport implements Evaluator { 043 044 045 /** 046 * Die Methode execute wird aufgerufen, wenn der Context eines Tags geprueft werden soll. 047 * Diese Methode ueberschreibt, jene des Interface Evaluator. 048 * Falls diese Methode durch eine Implementation nicht ueberschrieben wird, ruft sie wiederere, 049 * allenfalls implementierte evaluate Methoden auf. 050 * Mit Hilfe dieses Konstrukt ist es moeglich drei evaluate methoden anzubieten. 051 * @param cfxdTag Das konkrete Tag innerhalb der kompletten CFXD. 052 * @param libTag Die Definition des Tag aus der TLD. 053 * @param flibs Saemtliche Function Library Deskriptoren des aktuellen Tag Libray Deskriptors. 054 * @param cfml 055 * @return TagLib 056 * @throws TemplateException 057 */ 058 public TagLib execute(Config config,Tag tag, TagLibTag libTag, FunctionLib[] flibs,Data data) 059 throws TemplateException { 060 061 return null; 062 } 063 064 065 066 /** 067 * Die Methode evaluate wird aufgerufen, wenn der Context eines Tags geprueft werden soll. 068 * Diese Methode ueberschreibt, jene des Interface Evaluator. 069 * Falls diese Methode durch eine Implementation nicht ueberschrieben wird, ruft sie wiederere, 070 * allenfalls implementierte evaluate Methoden auf. 071 * Mit Hilfe dieses Konstrukt ist es moeglich drei evaluate methoden anzubieten. 072 * @param cfxdTag Das konkrete Tag innerhalb der kompletten CFXD. 073 * @param libTag Die Definition des Tag aus der TLD. 074 * @param flibs Saemtliche Function Library Deskriptoren des aktuellen Tag Libray Deskriptors. 075 * @throws EvaluatorException 076 */ 077 public void evaluate(Tag tag, TagLibTag libTag, FunctionLib[] flibs) throws EvaluatorException { 078 evaluate(tag); 079 evaluate(tag,libTag); 080 } 081 082 /** 083 * ueberladene evaluate Methode nur mit einem CFXD Element. 084 * @param cfxdTag 085 * @throws EvaluatorException 086 */ 087 public void evaluate(Tag tag) throws EvaluatorException { 088 089 } 090 091 /** 092 * ueberladene evaluate Methode mit einem CFXD Element und einem TagLibTag. 093 * @param cfxdTag 094 * @param libTag 095 * @throws EvaluatorException 096 */ 097 public void evaluate(Tag tag,TagLibTag libTag) throws EvaluatorException { 098 } 099 100}