***  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 data items have an aggregation in their expression text.
 java.util.List<DataItem> getLeafDataItems()
          Return a list of leaf data items.
 
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

getLeafDataItems

@Nonnull
java.util.List<DataItem> getLeafDataItems()
Return a list of leaf data items. A leaf data item is a data item which does not contain measure data items as part of their expression.

The typical usage is to get those data items which can return detail information by ignoring their aggregate function.

The returned list does not contain duplicates. If the same leaf data item appears more than once in the expression, the returned list will contain the data item only once.

A data item 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 data items. The list may be empty, but is never null. The list does not contain duplicate data items.

containsUserTypedAggregation

boolean containsUserTypedAggregation()
                                     throws MetadataException
Return true if this expression or any of its data items 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 performing this operation

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.