org.deegree.sqldialect.filter.expression
Class SQLArgument

java.lang.Object
  extended by org.deegree.sqldialect.filter.expression.SQLArgument
All Implemented Interfaces:
SQLExpression

public class SQLArgument
extends Object
implements SQLExpression

SQLExpression that represents a constant argument value, e.g. a string, a number or a geometry.

Version:
$Revision: 31370 $, $Date: 2011-07-28 19:37:13 +0200 (Do, 28. Jul 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Constructor Summary
SQLArgument(Geometry value, GeometryParticleConverter converter)
          Creates a new spatial valued SQLArgument.
SQLArgument(PrimitiveValue value, PrimitiveParticleConverter converter)
          Creates a new primitive valued SQLArgument.
 
Method Summary
 void cast(SQLExpression expr)
          Propagates type information to this expression (=performs a type cast).
 List<SQLArgument> getArguments()
          Returns the SQLArgument instances that occur in the expression, in same order as in the SQL snippet.
 ParticleConverter<? extends TypedObjectNode> getConverter()
          Returns the attached particle converter for this expression.
 ICRS getCRS()
          Returns the CRS of the expression (only for spatial ones).
 PrimitiveType getPrimitiveType()
          Returns the primitive type of this expression.
 StringBuilder getSQL()
          Returns the corresponding SQL snippet, with question marks for every SQLArgument argument (as required for JDBC PreparedStatements).
 String getSRID()
          Returns the databases' SRID of the expression (only for spatial ones).
 TypedObjectNode getValue()
           
 boolean isMultiValued()
          Returns whether the expression has multiple values (currently this can only be a string column that stores multiple values in concatenated form).
 boolean isSpatial()
          Returns whether the expression denotes a spatial value.
 void setArgument(PreparedStatement stmt, int paramIndex)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLArgument

public SQLArgument(PrimitiveValue value,
                   PrimitiveParticleConverter converter)
Creates a new primitive valued SQLArgument.

Parameters:
value - value, can be null
converter - converter, can be null

SQLArgument

public SQLArgument(Geometry value,
                   GeometryParticleConverter converter)
Creates a new spatial valued SQLArgument.

Parameters:
value - value, can be null
converter - converter, can be null
Method Detail

setArgument

public void setArgument(PreparedStatement stmt,
                        int paramIndex)
                 throws SQLException
Throws:
SQLException

isSpatial

public boolean isSpatial()
Description copied from interface: SQLExpression
Returns whether the expression denotes a spatial value.

Specified by:
isSpatial in interface SQLExpression
Returns:
true, if the expression is spatial, false otherwise

isMultiValued

public boolean isMultiValued()
Description copied from interface: SQLExpression
Returns whether the expression has multiple values (currently this can only be a string column that stores multiple values in concatenated form).

Specified by:
isMultiValued in interface SQLExpression
Returns:
true, if the expresion is multi-valued, false otherwise

toString

public String toString()
Overrides:
toString in class Object

getArguments

public List<SQLArgument> getArguments()
Description copied from interface: SQLExpression
Returns the SQLArgument instances that occur in the expression, in same order as in the SQL snippet.

Specified by:
getArguments in interface SQLExpression
Returns:
the SQL literals, never null
See Also:
SQLExpression.getSQL()

getSQL

public StringBuilder getSQL()
Description copied from interface: SQLExpression
Returns the corresponding SQL snippet, with question marks for every SQLArgument argument (as required for JDBC PreparedStatements).

Specified by:
getSQL in interface SQLExpression
Returns:
the corresponding SQL snippet, never null
See Also:
SQLExpression.getArguments()

getCRS

public ICRS getCRS()
Description copied from interface: SQLExpression
Returns the CRS of the expression (only for spatial ones).

Specified by:
getCRS in interface SQLExpression
Returns:
the CRS, can be null (unknown or not a spatial expression)

getSRID

public String getSRID()
Description copied from interface: SQLExpression
Returns the databases' SRID of the expression (only for spatial ones).

Specified by:
getSRID in interface SQLExpression
Returns:
the SRID, can be null (unknown or not a spatial expression)

getPrimitiveType

public PrimitiveType getPrimitiveType()
Description copied from interface: SQLExpression
Returns the primitive type of this expression.

Specified by:
getPrimitiveType in interface SQLExpression
Returns:
the primitive type, can be null (no type information / spatial)

cast

public void cast(SQLExpression expr)
Description copied from interface: SQLExpression
Propagates type information to this expression (=performs a type cast).

Specified by:
cast in interface SQLExpression
Parameters:
expr - type information to be applied, must not be null

getConverter

public ParticleConverter<? extends TypedObjectNode> getConverter()
Description copied from interface: SQLExpression
Returns the attached particle converter for this expression.

Specified by:
getConverter in interface SQLExpression
Returns:
particle converter, can be null

getValue

public TypedObjectNode getValue()


Copyright © 2011. All Rights Reserved.