|
Project: stp | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectcom.ibm.rational.stp.client.samples.QueryUtilities
public abstract class QueryUtilities
A CmdBaseQuery
Nested Class Summary | |
---|---|
private static class |
QueryUtilities.FilterSym<T>
The representation for a symbol in a filtering expression |
private static class |
QueryUtilities.Kind
|
private static class |
QueryUtilities.Tokenizer
Tokenizes a stream containing a filtering expression from the command line |
Field Summary | |
---|---|
private static EnumSet<QueryUtilities.Kind> |
END_MASK
Kind mask for the end of a FilterLeaf expression |
private static javax.wvcm.PropertyRequestItem.PropertyRequest |
FIELD_DEFINITION_PROPERTIES
CqFieldDefinition properties we will be needing |
private static HashMap<com.ibm.rational.wvcm.stp.StpLocation,CqRecordType> |
g_recordTypeMap
A Map from user-friendly location to fully-populated record type proxy. |
protected static javax.wvcm.PropertyRequestItem.PropertyRequest |
RECORD_TYPE_WITH_FIELDS
Properties needed from a record type of a database |
private static javax.wvcm.PropertyRequestItem.PropertyRequest |
RECORD_TYPE_WITHOUT_FIELDS
Properties needed from a record type of a database (without its field definitions) |
private static EnumSet<QueryUtilities.Kind> |
SEPARATOR_MASK
Kind mask for a target separator token |
private static QueryUtilities.FilterSym[] |
symbol
Pre-defined Filter token definitions |
private static EnumSet<QueryUtilities.Kind> |
TARGET_MASK
Kind mask for target specification token |
Constructor Summary | |
---|---|
QueryUtilities()
|
Method Summary | |
---|---|
private static CqFieldDefinition[] |
buildFieldPath(CqQuery query,
String path)
Constructs a CqFieldDefinition[] from a field path specification consisting of dotted segments: field1.field2. ... .fieldN |
private static CqQuery.Filter.Operation |
checkOp(CqQuery.Filter.Operation oldOp,
CqQuery.Filter.Operation newOp)
Verifies that the operation in the input is consistent with the previous operations used. |
private static CqFieldDefinition |
findField(String name,
javax.wvcm.ResourceList fields)
Locates that CqFieldDefinition that corresponds to a given field name. |
private static CqRecordType |
getReferencedRecordType(CqFieldDefinition def)
Returns a fully-populated proxy for the record type of the records referenced by a given field definition. |
protected static CqQuery.DisplayField |
parseDisplayField(CqQuery query,
String fieldSpec)
Parses a specification for a query display field and constructs a DisplayField object to represent it. |
protected static CqQuery.FilterLeaf |
parseDynamicFilter(CqQuery query,
int n,
String param)
Parses the specification for the parameter value that matches a dynamic filter. |
protected static CqQuery.Filter |
parseFilter(CqQuery query,
Iterator filterItems)
Parses a filtering expression, builds a Filter structure for it, and defines that as the value of the query's FILTERING property. |
protected static CqQuery.FilterLeaf |
parseFilterLeaf(CqQuery query,
String image)
Parses a single filter leaf specification and construct the corresponding FilterLeaf structure for it. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final EnumSet<QueryUtilities.Kind> TARGET_MASK
private static final EnumSet<QueryUtilities.Kind> SEPARATOR_MASK
private static final EnumSet<QueryUtilities.Kind> END_MASK
private static QueryUtilities.FilterSym[] symbol
private static HashMap<com.ibm.rational.wvcm.stp.StpLocation,CqRecordType> g_recordTypeMap
private static final javax.wvcm.PropertyRequestItem.PropertyRequest RECORD_TYPE_WITHOUT_FIELDS
private static final javax.wvcm.PropertyRequestItem.PropertyRequest FIELD_DEFINITION_PROPERTIES
protected static final javax.wvcm.PropertyRequestItem.PropertyRequest RECORD_TYPE_WITH_FIELDS
Constructor Detail |
---|
public QueryUtilities()
Method Detail |
---|
private static CqFieldDefinition findField(String name, javax.wvcm.ResourceList fields) throws javax.wvcm.WvcmException
name
- The field name to be matched. Must not be null.fields
- The list of FieldDefinitions against which the name is to
be compared.
javax.wvcm.WvcmException
- Thrown if the supplied FieldDefinitions do not
define the DISPLAY_NAME property.private static CqFieldDefinition[] buildFieldPath(CqQuery query, String path) throws javax.wvcm.WvcmException
query
- A CqQuery proxy for the query in which the field path will
be used. Must define
PRIMARY_RECORD_TYPE.nest(FIELD_DEFINITIONS.nest(FIELD_DEFINITION_PROPERTIES))path
- A dot-separated list of field names describing the path
from a field of the primary resource type, through references, to the
targeted field.
javax.wvcm.WvcmException
- If the information needed to analyze the path is
unavailable or unobtainable.private static CqRecordType getReferencedRecordType(CqFieldDefinition def) throws javax.wvcm.WvcmException
def
- The CqFieldDefinition whose referenced record type is desired.
must not be null.
javax.wvcm.WvcmException
private static CqQuery.Filter.Operation checkOp(CqQuery.Filter.Operation oldOp, CqQuery.Filter.Operation newOp)
oldOp
- The previous Operation used; may be null if this is first
use of an Operation.newOp
- The current Operation in the input.
RuntimeException
- if the newOp is not compatible with the oldOp.protected static CqQuery.FilterLeaf parseFilterLeaf(CqQuery query, String image) throws javax.wvcm.WvcmException
owner[eq][user] date[between]10/26/94[and]10/24/95 submit_date[outside]8-feb-02[and]10-mar-02 owner.name[unlike]Fred State[is]Submitted[or]Closed Severity[isnt]High[or]Low Description[null] Priority[set]
query
- The Query proxy for the query that will be using the filterimage
- String containing the filter leaf expression.
javax.wvcm.WvcmException
- If the necessary information is not available or
attainable from the server.protected static CqQuery.FilterLeaf parseDynamicFilter(CqQuery query, int n, String param) throws javax.wvcm.WvcmException
query
- The query for which the parameter is being specifiedn
- The index of the dynamic filter in the query's dynamic filter
list.param
- The parameter value specification, which is a filter leaf
specification without the field path and optionally without
the operator, these being defaulted from the dynamic filter.
Must not be null, but may be "" to indicate no value
is to be supplied for the dynamic filter
javax.wvcm.WvcmException
protected static CqQuery.Filter parseFilter(CqQuery query, Iterator filterItems) throws javax.wvcm.WvcmException
filter ::= filterLeaf filter ::= [(] filter [)] filter ::= filter ([or] filter)+ filter ::= filter ([and] filter)+Examples
query
- The CqQuery proxy in which the FILTERING property is to be
defined. This proxy must define the PRIMARY_RESOURCE property
using a CqRecordType proxy that defines the FIELD_DEFINITIONS
property.filterItems
- An Iterator over String objects producing the terms of
the filtering expression in order left to right, where a term
is one of the elements, filterLeaf
,
[(]
, [)]
, [and]
,
or [or]
in the above grammar
javax.wvcm.WvcmException
protected static CqQuery.DisplayField parseDisplayField(CqQuery query, String fieldSpec) throws javax.wvcm.WvcmException
query
- A CqQuery proxy for the query for which the DisplayField is
to be constructed. Must define the properties required by
buildFieldPath.fieldSpec
- A String containing the specification for one display
field of a query.
javax.wvcm.WvcmException
- If the necessary information is not available or
obtainable from the server.
|
Generated Fri 18-Apr-2014 01:42 PM | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |