View Javadoc
1   /*
2    * #%L
3    * Expression.java - mongodb-async-driver - Allanbank Consulting, Inc.
4    * %%
5    * Copyright (C) 2011 - 2014 Allanbank Consulting, Inc.
6    * %%
7    * Licensed under the Apache License, Version 2.0 (the "License");
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   * 
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   * 
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   * #L%
19   */
20  
21  package com.allanbank.mongodb.builder.expression;
22  
23  import com.allanbank.mongodb.bson.Element;
24  import com.allanbank.mongodb.bson.ElementAssignable;
25  
26  /**
27   * Expression provides a common interface for all expressions. Most expression
28   * classes also implement the {@link ElementAssignable}, the notable exception
29   * being {@link Constant}.
30   * 
31   * @api.yes This interface is part of the driver's API. Public and protected
32   *          members will be deprecated for at least 1 non-bugfix release
33   *          (version numbers are <major>.<minor>.<bugfix>)
34   *          before being removed or modified.
35   * @copyright 2012-2013, Allanbank Consulting, Inc., All Rights Reserved
36   */
37  public interface Expression {
38      /**
39       * Returns the expression in the form of a BSON element.
40       * 
41       * @param name
42       *            The name for the expression's element.
43       * @return The expression in the form of a BSON element.
44       */
45      public Element toElement(String name);
46  }