1 /* 2 * reserved comment block 3 * DO NOT REMOVE OR ALTER! 4 */ 5 /* 6 * Copyright 1999-2004 The Apache Software Foundation. 7 * 8 * Licensed under the Apache License, Version 2.0 (the "License"); 9 * you may not use this file except in compliance with the License. 10 * You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, software 15 * distributed under the License is distributed on an "AS IS" BASIS, 16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 * See the License for the specific language governing permissions and 18 * limitations under the License. 19 */ 20 /* 21 * $Id: FuncNot.java,v 1.2.4.1 2005/09/14 20:18:44 jeffsuttor Exp $ 22 */ 23 package com.sun.org.apache.xpath.internal.functions; 24 25 import com.sun.org.apache.xpath.internal.XPathContext; 26 import com.sun.org.apache.xpath.internal.objects.XBoolean; 27 import com.sun.org.apache.xpath.internal.objects.XObject; 28 29 /** 30 * Execute the Not() function. 31 * @xsl.usage advanced 32 */ 33 public class FuncNot extends FunctionOneArg 34 { 35 static final long serialVersionUID = 7299699961076329790L; 36 37 /** 38 * Execute the function. The function must return 39 * a valid object. 40 * @param xctxt The current execution context. 41 * @return A valid XObject. 42 * 43 * @throws javax.xml.transform.TransformerException 44 */ execute(XPathContext xctxt)45 public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException 46 { 47 return m_arg0.execute(xctxt).bool() ? XBoolean.S_FALSE : XBoolean.S_TRUE; 48 } 49 } 50