ContentQueryBase Class

com.bea.p13n.content
ContentQueryBase Class

public abstract class ContentQueryBase

    extends Object

Abstract base class that provides common funcitons for ContentQuery which parses the xml content query and RulesContentQuery which takes the rules node structure as input.


Hierarchy
Object
  ContentQueryBase
Direct Known Subclasses

ContentQuery, RulesContentQuery

Field Summary

public static final DateFormat
dateFormat
The date format for toDate()s in queries.
public static final String
dateFormatStr
The date format string for toDate()s in queries.
public static final PropertyProvider
EMPTY_PROP_PROVIDER
A PropertyProvider that always return empty.
protected static final String
STRING_CONTAINS
Return value from getOperator() to signify a string "contains", which should get converted to a like.
protected static final int
TYPE_BOOLEAN
The boolean type.
protected static final int
TYPE_DATE
The Double type.
protected static final int
TYPE_DOUBLE
The Date type.
protected static final int
TYPE_LONG
The Long type.
protected static final int
TYPE_STRING
The String type.
 

Constructor Summary

ContentQueryBase()

 

Method Summary

protected Timestamp
getISO8601Date(String name, String charData)
Get a Timestamp from an ISO8601 formatted date string.
protected String
getLogic(String logic)
Get the ExpressionHelper.AND or OR type of the specific logic string.
protected String
getOperator(String operator)
Get the ExpressionHelper comparision operator constants for the specified operator string.
protected int
getType(String type)
Get the type constant for the specified type string.
protected Object
getValueAsType(Object o, int type)
Convert the specified object to the specified type as best we can.
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   

Field Detail

dateFormat

public static final DateFormat dateFormat
The date format for toDate()s in queries.


dateFormatStr

public static final String dateFormatStr
The date format string for toDate()s in queries.


EMPTY_PROP_PROVIDER

public static final PropertyProvider EMPTY_PROP_PROVIDER
A PropertyProvider that always return empty.


STRING_CONTAINS

protected static final String STRING_CONTAINS
Return value from getOperator() to signify a string "contains", which should get converted to a like.


TYPE_BOOLEAN

protected static final int TYPE_BOOLEAN
The boolean type.


TYPE_DATE

protected static final int TYPE_DATE
The Double type.


TYPE_DOUBLE

protected static final int TYPE_DOUBLE
The Date type.


TYPE_LONG

protected static final int TYPE_LONG
The Long type.


TYPE_STRING

protected static final int TYPE_STRING
The String type.

 

Constructor Detail

ContentQueryBase

public ContentQueryBase()
 

Method Detail

getISO8601Date(String, String) Method

protected Timestamp getISO8601Date(String name, 
                                   String charData)
throws IllegalArgumentException
Get a Timestamp from an ISO8601 formatted date string.

Parameters

name
the name of the element this came from.
charData
the formatted date string.

Exceptions

IllegalArgumentException

Related Topics

XMLDateTimeUtil.readTimeInstantAsDate(String, char)


getLogic(String) Method

protected String getLogic(String logic)
throws IllegalArgumentException
Get the ExpressionHelper.AND or OR type of the specific logic string.

Exceptions

IllegalArgumentException
on invalid logic.

getOperator(String) Method

protected String getOperator(String operator)
throws IllegalArgumentException
Get the ExpressionHelper comparision operator constants for the specified operator string.

Returns

ExpressionHelper.EQUALS, ExpressionHelper.NOT_EQUALS, ExpressionHelper.LESS_THAN, ExpressionHelper.LESS_THAN_EQUALS, ExpressionHelper.GREATER_THAN, or ExpressionHelper.GREATER_THAN_EQUALS

Exceptions

IllegalArgumentException
thrown on invalid operator string

getType(String) Method

protected int getType(String type)
throws IllegalArgumentException
Get the type constant for the specified type string.

Returns

TYPE_STRING, TYPE_LONG, TYPE_DOUBLE, TYPE_DATE, or TYPE_BOOLEAN.

Exceptions

IllegalArgumentException
thrown on invalid type string.

getValueAsType(Object, int) Method

protected Object getValueAsType(Object o, 
                                int type)
throws IllegalArgumentException
Convert the specified object to the specified type as best we can.

Exceptions

IllegalArgumentException
thrown on invalid string input or invalid type.