package net.sf.tomp.xml.include.xtcl; import net.sf.tomp.xml.include.AdaptiveXIncludeFilter; import net.sf.tomp.xml.type.TypeDatabase; import net.sf.tomp.xtcl.Context; /** * DOCUMENT ME! * * @author tomp */ public class AdaptiveXIncluderCommand extends AdaptiveFilterCommand { /** * DOCUMENT ME! * * @param context DOCUMENT ME! * @return DOCUMENT ME! * @throws Exception DOCUMENT ME! */ public int execute(Context context) throws Exception { // FIXME: not very effective: // transfers props -> params of command -> params of filter // the same applies for AdaptiveFilter // transfer props to params propertiesToParameters(context); AdaptiveXIncludeFilter aif = new AdaptiveXIncludeFilter(); TypeDatabase tdb = (TypeDatabase) context.get(tdVar); if (tdb == null) { return done(context, 1); } else { // set type database aif.setTypeDatabase(tdb); // set params initFilter(aif, context); // put the filter to context context.put(var, aif); return done(context, 0); } } /** * DOCUMENT ME! * * @return DOCUMENT ME! */ public String toString() { return "ADAPTIVEXINCLUDER " + var + " type-database=" + tdVar + " (" + listMap(params) + ")"; } } /* * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. The * Original Code is: all this file. The Initial Developer of the Original Code * is: Tomas Pitner, Masaryk University in Brno, Czech Republic. Contributor(s): */