org.ametys.plugins.datainclusion.data
Class AbstractQuery

java.lang.Object
  extended by org.ametys.plugins.datainclusion.data.AbstractQuery
All Implemented Interfaces:
Query
Direct Known Subclasses:
LdapQuery, SqlQuery

public abstract class AbstractQuery
extends Object
implements Query

An abstract query.
Defines getters and setters for all base members of a query, and provides some helpful methods.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ametys.plugins.datainclusion.data.Query
Query.ResultType
 
Field Summary
protected  String _description
          The query description.
protected  String _id
          The query id.
protected  String _name
          The query name.
protected  List<String> _parameters
          The query parameter names.
protected  Query.ResultType _resultType
          The query result type.
 
Fields inherited from interface org.ametys.plugins.datainclusion.data.Query
PARAMETER_MATCHER, PARAMETER_PATTERN
 
Constructor Summary
AbstractQuery()
           
 
Method Summary
protected  List<String> _buildParameters(String query)
          Extract parameters from a query string in the form ${parameterName}.
 String getDescription()
          Get the query description.
 String getId()
          Get the query ID.
 String getName()
          Get the query name.
 Query.ResultType getResultType()
          Get the query result type.
 void setDescription(String description)
          Set the query description.
 void setId(String id)
          Set the query id.
 void setName(String name)
          Set the query name.
 void setResultType(Query.ResultType resultType)
          Set the query result type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ametys.plugins.datainclusion.data.Query
execute, getAdditionalConfiguration, getDataSource, getParameterNames, getType
 

Field Detail

_id

protected String _id
The query id.


_name

protected String _name
The query name.


_description

protected String _description
The query description.


_parameters

protected List<String> _parameters
The query parameter names.


_resultType

protected Query.ResultType _resultType
The query result type.

Constructor Detail

AbstractQuery

public AbstractQuery()
Method Detail

getId

public String getId()
Description copied from interface: Query
Get the query ID.

Specified by:
getId in interface Query
Returns:
the query ID.

setId

public void setId(String id)
Set the query id.

Parameters:
id -

getName

public String getName()
Description copied from interface: Query
Get the query name.

Specified by:
getName in interface Query
Returns:
the query name.

setName

public void setName(String name)
Set the query name.

Parameters:
name -

getDescription

public String getDescription()
Description copied from interface: Query
Get the query description.

Specified by:
getDescription in interface Query
Returns:
the query description.

setDescription

public void setDescription(String description)
Set the query description.

Parameters:
description -

getResultType

public Query.ResultType getResultType()
Description copied from interface: Query
Get the query result type.

Specified by:
getResultType in interface Query
Returns:
the query result type.

setResultType

public void setResultType(Query.ResultType resultType)
Set the query result type.

Parameters:
resultType - the query result type.

_buildParameters

protected List<String> _buildParameters(String query)
Extract parameters from a query string in the form ${parameterName}.

Parameters:
query - the query containing parameters.
Returns:
the parameter names as a Set.


Copyright © 2010 Anyware Services. All Rights Reserved.