***  This interface is subject to change.  ***

com.sas.iquery.metadata.expr
Interface DataItemContainerExpression

All Superinterfaces:
Base, BusinessModelResourceReferencer, java.lang.Cloneable, java.util.EventListener, ExpressionInterface, ModelItem, PropertyChangeListenee, java.beans.PropertyChangeListener, UsabilityInterface
All Known Subinterfaces:
DataItem, DataItemReference
All Known Implementing Classes:
FunctionCall, ResourceAwareStringExpression

public interface DataItemContainerExpression
extends ExpressionInterface

Specifies ExpressionInterface classes that can (potentially) contain a data item as part of their expression. For example, the expression can be used in a ResourceAwareStringExpression (RASE). For example, SUM(<<DataItem1>>). Or the expression may be modeled as an expression tree for example, a ConditionalExpression on a DataItem filter. Note the DataItems can be nested to any depth within an expression. In the RASE example above, <<DataItem1>> may contain an expession with other dataitems in it. This interface does not impose limitations on anything else the expression may contain.

Given these types of expressions, it is very useful to find out if such expressions contain user typed aggregation, or obtain a list of leaf dataitems. There may be other uses in the future. For example, there is a need to run a query with detail usage on a dataitem for supporting ROLAP with calculated items. Using this interface a list of leaf items may be obtained from the dataitem's expression which can then be used in a detail query.


Field Summary
 
Fields inherited from interface com.sas.iquery.metadata.business.ModelItem
EVENT_OBJECT_PROPERTY_CHANGED
 
Fields inherited from interface com.sas.iquery.metadata.business.Base
EVENT_OBJECT_DEFINITION_CHANGED
 
Method Summary
 boolean containsUserTypedAggregation()
          Return true if this expression or any of its dataitems have an aggregation in their expression text.
 java.util.List getLeafDataItems()
          Return a list of leaf data items (dataitems which do not contain measure dataitems as part of their expression).
 
Methods inherited from interface com.sas.iquery.metadata.expr.ExpressionInterface
getExpressionType
 
Methods inherited from interface com.sas.iquery.metadata.business.BusinessModelResourceReferencer
getResources
 
Methods inherited from interface com.sas.iquery.metadata.PropertyChangeListenee
addListener, getListeners, removeListener
 
Methods inherited from interface com.sas.iquery.metadata.business.UsabilityInterface
getReasonsUnusable, isUsableInQuery
 

Method Detail

***  This method is subject to change.  ***

getLeafDataItems

java.util.List getLeafDataItems()
Return a list of leaf data items (dataitems which do not contain measure dataitems as part of their expression).

This will allow us to get dataitems which can return detail information by ignoring their aggregate function. Duplicates will be removed. If the same leaf dataitem appears more than once in the expression, the returned list will contain the dataitem only once.

DataItem can be both an expression and a leaf data item. Therefore, a data item when treated as an expression, may return itself from this method.

Returns:
List of DataItem objects or an empty list if none found.

***  This method is subject to change.  ***

containsUserTypedAggregation

boolean containsUserTypedAggregation()
                                     throws MetadataException
Return true if this expression or any of its dataitems have an aggregation in their expression text. For example, the user may have typed "SUM(X) + SUM(Y)" in the expression editor.

Returns:
true, if there is at least one user typed aggregation, false otherwise
Throws:
MetadataException - on any failures while perfoming this operation

***  This interface is subject to change.  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.