com.bea.p13n.content
Class ContentQueryBase

java.lang.Object
  extended by com.bea.p13n.content.ContentQueryBase
Direct Known Subclasses:
ContentQuery, RulesContentQuery

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.


Field Summary
static DateFormat dateFormat
          The date format for toDate()s in queries.
static String dateFormatStr
          The date format string for toDate()s in queries.
static PropertyProvider EMPTY_PROP_PROVIDER
          A PropertyProvider that always return empty.
protected static String STRING_CONTAINS
          Return value from getOperator() to signify a string "contains", which should get converted to a like.
protected static int TYPE_BOOLEAN
          The boolean type.
protected static int TYPE_DATE
          The Double type.
protected static int TYPE_DOUBLE
          The Date type.
protected static int TYPE_LONG
          The Long type.
protected static 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 inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_PROP_PROVIDER

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


TYPE_STRING

protected static final int TYPE_STRING
The String type.

See Also
Constants Summary

TYPE_LONG

protected static final int TYPE_LONG
The Long type.

See Also
Constants Summary

TYPE_DOUBLE

protected static final int TYPE_DOUBLE
The Date type.

See Also
Constants Summary

TYPE_DATE

protected static final int TYPE_DATE
The Double type.

See Also
Constants Summary

TYPE_BOOLEAN

protected static final int TYPE_BOOLEAN
The boolean type.

See Also
Constants Summary

dateFormatStr

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

See Also
Constants Summary

dateFormat

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


STRING_CONTAINS

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

See Also
Constants Summary
Constructor Detail

ContentQueryBase

public ContentQueryBase()
Method Detail

getISO8601Date

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.
Throws
IllegalArgumentException
See Also
XMLDateTimeUtil.readTimeInstantAsDate(java.lang.String)

getType

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.
Throws
IllegalArgumentException - thrown on invalid type string.

getLogic

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

Throws
IllegalArgumentException - on invalid logic.

getOperator

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
Throws
IllegalArgumentException - thrown on invalid operator string

getValueAsType

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

Throws
IllegalArgumentException - thrown on invalid string input or invalid type.


Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.