***  This class is subject to change.  ***

com.sas.iquery.metadata.expr
Class StringExpressionUtil

com.sas.iquery.metadata.expr.StringExpressionUtil

public abstract class StringExpressionUtil

Generates the resource-aware ExpressionInterface from string text. The ExpressionInterface thus generated is intended to be used only in a resource aware expression context. This class generates resource aware string representations for various ExpressionInterface implementations. Note: a special "ResourceIdentification" syntax is used to represent Resources in expression strings. See the package.html for more details on how this feature works.


Constructor Summary
StringExpressionUtil()
           
 
Method Summary
static StringExpressionUtil getInstance()
          Get an StringExpressionUtil instance
abstract  java.lang.String getText(ExpressionInterface expr, ResourceScope scope, BusinessModel businessModel)
          Get the Expression String
abstract  ExpressionInterface newExpression(BusinessModel businessModel, java.lang.String expr, int expressionType, ResourceScope scope)
          Create a new ExpressionInterface.
 

Constructor Detail

StringExpressionUtil

public StringExpressionUtil()
Method Detail

getInstance

public static StringExpressionUtil getInstance()
Get an StringExpressionUtil instance

Returns:
StringExpressionUtil

newExpression

public abstract ExpressionInterface newExpression(BusinessModel businessModel,
                                                  java.lang.String expr,
                                                  int expressionType,
                                                  ResourceScope scope)
                                           throws MetadataException
Create a new ExpressionInterface. If the string contains Resources, Resource Identification is performed.

Parameters:
businessModel - the BusinessModel which will be used as the context to do resource identification
expr - the String expression
expressionType - a valid expression type
scope - the ResourceScope
Returns:
ExpressionInterface specific subtype ResourceAwareStringExpression
Throws:
MetadataException - on errors Note: In additon to MetadataException the thrown exception may be one of the following subtypes
See Also:
ExpressionTypes, ResourceScope, ResourceIdentificationException, ParseExpressionException

getText

public abstract java.lang.String getText(ExpressionInterface expr,
                                         ResourceScope scope,
                                         BusinessModel businessModel)
                                  throws MetadataException
Get the Expression String

Parameters:
scope - the ResourceScope if the scope is both business and physical, physical resources will be qualified fully if there are potential name conflicts with business items for example, physical::<>
businessModel - the BusinessModel (may be null) if BusinessModel is null and scope is both physical and business physical items will always be qualified with physical::
Returns:
a String representation for this Expression (If a null expr is passed in null will be returned)
Throws:
MetadataException - on metadata errors - Note: in additon to MetadataException, the thrown exception may be a ResourceIdentificationException subtype.
ResourceIdentificationException - Note: if the scope is BUSINESS and a physical expression is passed or if the scope is PHYSICAL and a business expression is passed in, this exception is thrown. This exception is also thrown if an unsupported expression is passed in to this method.

***  This class is subject to change.  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.