1 /* 2 * Copyright (C) 2003-2005 SINTEF 3 * Author: Fredrik Vraalsen (fredrik dot vraalsen at sintef dot no) 4 * Webpage: http://coras.sourceforge.net/ 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public License 8 * as published by the Free Software Foundation; either version 2.1 9 * of the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this program; if not, write to the Free 18 * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 * 02111-1307 USA 20 */ 21 package no.sintef.clix.functions; 22 23 import java.util.Collections; 24 import java.util.List; 25 26 import org.jaxen.JaxenException; 27 import org.jaxen.NamespaceContext; 28 import org.jaxen.VariableContext; 29 import org.jaxen.XPath; 30 import org.jaxen.dom.DOMXPath; 31 32 import no.sintef.clix.jaxb.BinaryPredicateType; 33 34 public abstract class FunBinaryPredicate implements Fun { 35 36 private XPath xpath1, xpath2; 37 38 FunBinaryPredicate(BinaryPredicateType f) { 39 try { 40 xpath1 = new DOMXPath(f.getOp1()); 41 xpath2 = new DOMXPath(f.getOp2()); 42 } catch (JaxenException e) { 43 // TODO Auto-generated catch block 44 e.printStackTrace(); 45 } 46 } 47 48 /* (non-Javadoc) 49 * @see no.sintef.clix.functions.Fun#genLinks(java.lang.Object, org.jaxen.VariableContext) 50 */ 51 public List genLinks(Object context, VariableContext variableContext, NamespaceContext namespaceContext) { 52 return Collections.EMPTY_LIST; 53 } 54 55 protected XPath getXPath1() { 56 return xpath1; 57 } 58 59 protected XPath getXPath2() { 60 return xpath2; 61 } 62 63 }