Package org.geotools.filter.text.commons
Class AbstractFilterBuilder
Object
AbstractFilterBuilder
This abstract class provides the common behavior to build the filters for the related semantic actions of parsing
language process.
Builds Filter or Expression and their components (literal, functions, etc). It maintains the results of semantic actions in the stack used to build complex filters and expressions.
Warning: This component is not published. It is part of module implementation. Client module should not use this feature.
- Since:
- 2.6
- Author:
- Mauricio Pazos (Axios Engineering)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractFilterBuilder
(String cqlSource, FilterFactory filterFactory) New instance of FilterBuilder -
Method Summary
Modifier and TypeMethodDescriptionprotected Literal
asLiteralDate
(String cqlDate) protected Literal
asLiteralDateTime
(String cqlDateTime) Transforms the cqlDateTime to a literal date.Build an After date filterBuilds an after period filterBuilds an Or filter composed of Before and During filters.builds PropertyIsBetween filterbuildCompoundAttribute
(int nodeSimpleAttr, String nodeAttrSeparator) buildDateExpression
(IToken token) buildDateTimeExpression
(IToken token) Creates a literal with date timebuildDE9IM
(String tokenImage) Build the intersection matrix patternbuildDistanceUnit
(IToken token) buildDurationExpression
(IToken token) Create an integer literal with duration value.Builds an Or filter composed of During and After.buildEnvelope
(IToken token) Returns the EnvelopebuildFunction
(int functionNode) Builds a function expressionbuildGeometry
(IToken geometry) Builds geometrybuildIdentifier
(int nodeIdentifier) buildIdentifierPart
(IToken token) Creates the identifier part.buildLikeFilter
(boolean matchCase) Builds a like filterbuildLiteralDouble
(String tokenImage) buildLiteralInteger
(String tokenImage) buildLiteralString
(String tokenImage) buildNotFilter
(Filter eq) buildNotLikeFilter
(boolean matchCase) builds a PeriodNode (date1,date2)builds a Period with (date,duration)builds a Period Node with (duration,date).Create an AND filter with property between dates of period.Creates PropertyIsEqualTo with PropertyExists predicateBuilds PropertyIsGreaterThanOrEqualTo begin of periodcreates PropertyIsGreaterThan end date of periodBuilds property is null filterBUild a TEquals date filter.protected FilterFactory
protected final BuildResultStack
protected final String
void
pushResult
(Result result) Adds in the result stack the partial result associated to node.protected String
removeQuotes
(String source) Removes initial and final "'" from string.protected String
scanExpression
(IToken initialToken) Extracts expression between initial token and last token in buffer.protected String
transformWKTGeometry
(String wktGeom) This transformation is required because some geometries like Multipoint has different definition in vividsolucion library.
-
Field Details
-
filterFactory
-
cqlSource
-
-
Constructor Details
-
AbstractFilterBuilder
New instance of FilterBuilder
-
-
Method Details
-
getFilterFactory
-
getResultStack
-
getStatement
-
pushResult
Adds in the result stack the partial result associated to node. -
peekResult
-
getFilter
- Throws:
CQLException
-
getExpression
- Throws:
CQLException
-
getFilterList
- Throws:
CQLException
-
buildAddExpression
- Throws:
CQLException
-
buildSubtractExression
- Throws:
CQLException
-
buildMultiplyExpression
- Throws:
CQLException
-
buildDivideExpression
- Throws:
CQLException
-
buildIntegerDivideExpression
- Throws:
CQLException
-
buildPowerExpression
- Throws:
CQLException
-
buildRemainderExpression
- Throws:
CQLException
-
buildAndFilter
- Throws:
CQLException
-
buildOrFilter
- Throws:
CQLException
-
buildNotFilter
- Throws:
CQLException
-
buildLikeFilter
Builds a like filter- Returns:
- a PropertyIsLike
- Throws:
CQLException
-
buildPropertyIsNull
Builds property is null filter- Returns:
- PropertyIsNull
- Throws:
CQLException
-
buildPorpertyNotIsNull
- Throws:
CQLException
-
buildBetween
builds PropertyIsBetween filter- Returns:
- PropertyIsBetween
- Throws:
CQLException
-
buildNotBetween
- Throws:
CQLException
-
buildNotLikeFilter
- Throws:
CQLException
-
buildPropertyExists
Creates PropertyIsEqualTo with PropertyExists predicate- Returns:
- PropertyIsEqualTo
- Throws:
CQLException
-
buildDateExpression
- Throws:
CQLException
-
buildDateTimeExpression
Creates a literal with date time- Parameters:
token
- with date time- Returns:
- Literal
- Throws:
CQLException
-
asLiteralDate
- Throws:
CQLException
-
asLiteralDateTime
Transforms the cqlDateTime to a literal date.- Parameters:
cqlDateTime
- a string with the format yyyy-MM-ddTHH:mm:ss.s[(+|-)HH:mm]- Returns:
- a literal Date
- Throws:
CQLException
-
buildNotFilter
-
buildTrueLiteral
-
buildFalseLiteral
-
buildLiteralInteger
-
buildLiteralDouble
-
buildLiteralString
-
removeQuotes
Removes initial and final "'" from string. If some "''" is found it will be changed by a single quote "'".- Returns:
- string without initial and final quote, and "''" replaced by "'".
-
buildIdentifier
- Throws:
CQLException
-
buildIdentifierPart
Creates the identifier part. An identifier like "idpart1:idpart2:idpart3: ... idpartN" has N part.- Returns:
- identifier part
-
buildSimpleAttribute
- Throws:
CQLException
-
buildCompoundAttribute
public PropertyName buildCompoundAttribute(int nodeSimpleAttr, String nodeAttrSeparator) throws CQLException - Returns:
- PropertyName
- Throws:
CQLException
-
buildDistanceUnit
- Throws:
CQLException
-
buildTolerance
- Throws:
CQLException
-
buildSpatialEqualFilter
- Throws:
CQLException
-
buildSpatialDisjointFilter
- Throws:
CQLException
-
buildSpatialIntersectsFilter
- Throws:
CQLException
-
buildSpatialRelateFilter
- Throws:
CQLException
-
buildDE9IM
Build the intersection matrix pattern -
buildSpatialTouchesFilter
- Throws:
CQLException
-
buildSpatialCrossesFilter
- Throws:
CQLException
-
buildSpatialWithinFilter
- Throws:
CQLException
-
buildSpatialContainsFilter
- Throws:
CQLException
-
buildSpatialOverlapsFilter
- Throws:
CQLException
-
buildBBox
- Throws:
CQLException
-
buildBBoxWithCRS
- Throws:
CQLException
-
buildSpatialDWithinFilter
- Throws:
CQLException
-
buildSpatialBeyondFilter
- Throws:
CQLException
-
buildPeriodBetweenDates
builds a PeriodNode (date1,date2)- Returns:
- PeriodNode
- Throws:
CQLException
-
buildPeriodDurationAndDate
builds a Period Node with (duration,date).- Returns:
- PeriodNode
- Throws:
CQLException
-
buildPeriodDateAndDuration
builds a Period with (date,duration)- Returns:
- PeriodNode
- Throws:
CQLException
-
buildDurationExpression
Create an integer literal with duration value.- Returns:
- Literal
-
buildPropertyBetweenDates
Create an AND filter with property between dates of period. (firstDate<= property <= lastDate)- Returns:
- And filter
- Throws:
CQLException
-
buildPropertyIsGTEFirstDate
Builds PropertyIsGreaterThanOrEqualTo begin of period- Returns:
- PropertyIsGreaterThanOrEqualTo
- Throws:
CQLException
-
buildPropertyIsGTLastDate
creates PropertyIsGreaterThan end date of period- Returns:
- PropertyIsGreaterThan
- Throws:
CQLException
-
buildPropertyIsLTFirsDate
- Returns:
- PropertyIsLessThan
- Throws:
CQLException
-
buildPropertyIsLTELastDate
- Returns:
- PropertyIsLessThanOrEqualTo
- Throws:
CQLException
-
buildEquals
- Returns:
- PropertyIsEqualTo
- Throws:
CQLException
-
buildGreater
- Returns:
- PropertyIsGreaterThan
- Throws:
CQLException
-
buildLess
- Returns:
- PropertyIsLessThan
- Throws:
CQLException
-
buildGreaterOrEqual
- Returns:
- PropertyIsGreaterThanOrEqualTo
- Throws:
CQLException
-
buildLessOrEqual
- Returns:
- PropertyIsLessThanOrEqualTo
- Throws:
CQLException
-
buildGeometry
Builds geometry- Returns:
- a geometry
- Throws:
CQLException
-
scanExpression
Extracts expression between initial token and last token in buffer.- Returns:
- String the expression
-
transformWKTGeometry
This transformation is required because some geometries like Multipoint has different definition in vividsolucion library.Then OGC require MULTIPOINT((1 2), (3 4)) but vividsolunion works without point "(" ans ")" MULTIPOINT(1 2, 3 4)
- Parameters:
wktGeom
- ogc wkt geometry- Returns:
- String vividsolution geometry
-
buildEnvelope
Returns the Envelope- Returns:
- Literal
- Throws:
CQLException
-
buildFunction
Builds a function expression- Parameters:
functionNode
- symbol used to identify the function node in parser tree- Returns:
- Function
- Throws:
CQLException
-
buildTEquals
BUild a TEquals date filter.- Throws:
CQLException
-
buildAfterDate
Build an After date filter- Returns:
- After
- Throws:
CQLException
-
buildAfterPeriod
Builds an after period filter- Returns:
- after
- Throws:
CQLException
-
buildBeforeDate
- Throws:
CQLException
-
buildBeforePeriod
- Throws:
CQLException
-
buildDuringPeriod
- Throws:
CQLException
-
buildDuringOrAfter
Builds an Or filter composed of During and After.- Returns:
- Or filter
- Throws:
CQLException
-
buildBeforeOrDuring
Builds an Or filter composed of Before and During filters.- Returns:
- Or filter
- Throws:
CQLException
-