1 61 62 package org.jaxen.function; 63 64 import java.util.List ; 65 66 import org.jaxen.Context; 67 import org.jaxen.Function; 68 import org.jaxen.FunctionCallException; 69 import org.jaxen.Navigator; 70 71 82 public class NotFunction implements Function 83 { 84 85 88 public NotFunction() {} 89 90 105 public Object call(Context context, 106 List args) throws FunctionCallException 107 { 108 if (args.size() == 1) 109 { 110 return evaluate( args.get(0), context.getNavigator() ); 111 } 112 113 throw new FunctionCallException( "not() requires one argument." ); 114 } 115 116 128 public static Boolean evaluate(Object obj, Navigator nav) 129 { 130 return ( ( BooleanFunction.evaluate( obj, nav ).booleanValue() ) 131 ? Boolean.FALSE 132 : Boolean.TRUE 133 ); 134 } 135 136 } | Popular Tags |