© 2002 BEA Systems, Inc.


com.bea.p13n.content
Class ContentQueryBase

java.lang.Object
  |
  +--com.bea.p13n.content.ContentQueryBase
Direct Known Subclasses:
ContentQuery, RulesContentQuery

public abstract class ContentQueryBase
extends java.lang.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
protected static java.lang.Boolean collectionContentQueriesAllowed
           
static java.text.DateFormat dateFormat
          The date format for toDate()s in queries.
static java.lang.String dateFormatStr
          The date format string for toDate()s in queries.
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  java.sql.Timestamp getISO8601Date(java.lang.String name, java.lang.String charData)
          Get a Timestamp from an ISO8601 formatted date string.
protected  java.lang.String getLogic(java.lang.String logic)
          Get the ExpressionHelper.AND or OR type of the specific logic string.
protected  java.lang.String getOperator(java.lang.String operator)
          Get the ExpressionHelper comparision operator constants for the specified operator string.
protected  int getType(java.lang.String type)
          Get the type constant for the specified type string.
protected  java.lang.Object getValueAsType(java.lang.Object o, int type)
          Convert the specified object to the specified type as best we can.
protected static boolean isCollectionContentQueriesAllowed()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

collectionContentQueriesAllowed

protected static java.lang.Boolean collectionContentQueriesAllowed

TYPE_STRING

protected static final int TYPE_STRING
The String type.

TYPE_LONG

protected static final int TYPE_LONG
The Long type.

TYPE_DOUBLE

protected static final int TYPE_DOUBLE
The Date type.

TYPE_DATE

protected static final int TYPE_DATE
The Double type.

TYPE_BOOLEAN

protected static final int TYPE_BOOLEAN
The boolean type.

dateFormatStr

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

dateFormat

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

ContentQueryBase

public ContentQueryBase()
Method Detail

isCollectionContentQueriesAllowed

protected static boolean isCollectionContentQueriesAllowed()

getISO8601Date

protected java.sql.Timestamp getISO8601Date(java.lang.String name,
                                            java.lang.String charData)
                                     throws java.lang.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.
See Also:
XMLDateTimeUtil.readTimeInstantAsDate(java.lang.String)

getType

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

Returns:
TYPE_STRING, TYPE_LONG, TYPE_DOUBLE, TYPE_DATE, or TYPE_BOOLEAN.
Throws:
java.lang.IllegalArgumentException - thrown on invalid type string.

getLogic

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

Throws:
java.lang.IllegalArgumentException - on invalid logic.

getOperator

protected java.lang.String getOperator(java.lang.String operator)
                                throws java.lang.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:
java.lang.IllegalArgumentException - thrown on invalid operator string

getValueAsType

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

Throws:
java.lang.IllegalArgumentException - thrown on invalid string input or invalid type.

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved