Package org.apache.slide.search.basic.expression

Source Code of org.apache.slide.search.basic.expression.BasicExpression

/*
* $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/search/basic/expression/BasicExpression.java,v 1.2.2.1 2004/02/05 16:05:11 mholz Exp $
* $Revision: 1.2.2.1 $
* $Date: 2004/02/05 16:05:11 $
*
* ====================================================================
*
* Copyright 1999-2002 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package org.apache.slide.search.basic.expression;

import java.util.List;

import org.apache.slide.search.InvalidQueryException;
import org.apache.slide.search.basic.BasicExpressionFactory;
import org.apache.slide.search.basic.BasicResultSetImpl;
import org.apache.slide.search.basic.IBasicExpression;
import org.apache.slide.search.basic.IBasicResultSet;
import org.jdom.Attribute;
import org.jdom.Element;

/**
* A BasicSearchExpression represents exactly one operator (AND, GT, ...).
*
* @author <a href="mailto:martin.wallmer@softwareag.com">Martin Wallmer</a>
* @version $Revision: 1.2.2.1 $
*/
public abstract class BasicExpression implements IBasicExpression {
   
    protected BasicExpressionFactory expressionFactory;
   
    /** the JDOM element representing this expression. */
    protected Element   expressionElement;
   
    /** the resultset of this expression, if it has the state resolved */
    protected IBasicResultSet resultSet = new BasicResultSetImpl();
      
   
    /**
     * constructor. Only called by the conrecte expressions
     *
     * @param e                       the jdom element representing this expression.
     */
    protected BasicExpression (Element e) throws InvalidQueryException {
        this.expressionElement = e;
        List attrList = e.getAttributes();
        if (attrList.size() != 0) {
            Attribute attr = (Attribute) attrList.get(0);
            throw new InvalidQueryException (attr.getQualifiedName() +
                                                 " is an unprocessable entity");
        }
    }
  
}

TOP

Related Classes of org.apache.slide.search.basic.expression.BasicExpression

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.