com.semarchy.mdm.runtime.model.dataaccess
Class DataAccessSelectExpression

java.lang.Object
  extended by com.semarchy.mdm.runtime.model.dataaccess.DataAccessSelectExpression
All Implemented Interfaces:
Serializable

public class DataAccessSelectExpression
extends Object
implements Serializable

Represents a parsed DataAccess Expression obtained from a IDataAccessParser This class is immutable.

Author:
sarod
See Also:
Serialized Form

Constructor Summary
DataAccessSelectExpression(IDataAccessModel pDataAccessModel, IView view, com.semarchy.platform.language.semql.ParsingResult<com.semarchy.platform.language.semql.elements.IExpression> parsingResult)
          This should not be used directly.
 
Method Summary
static DataTypeInfo computeExpressionType(com.semarchy.platform.language.semql.elements.IExpression expression)
          Try to compute a DataTypeInfo from an IExpression.
 IDataAccessModel getDataAccessModel()
          Deprecated. you should get the IDataAccessModel by your own means
 String getExpression()
          The SemQL expression.
 LogicalDataType getLogicalType()
          Return the logical type if known or null if not known.
 com.semarchy.platform.language.semql.ParsingResult<com.semarchy.platform.language.semql.elements.IExpression> getParsingResult()
          Returns parsing details.
 SemQLViewAttribute getSemQLAttribute()
          REturn the SemQLViewAttribute for the expression when isViewOrNestedAttribute() is true, null otherwise
 String getSortExpression()
          Return the Expression to use for sort on this DataAccessSelectExpression or null if not sortable
 DataTypeInfo getTypeInfo()
          The type information if known or null if unknown
 IView getView()
          The IView for which this expression has been parsed
 IViewAttribute<? extends IAttribute> getViewAttribute()
          Return the IViewAttribute referenced by the expression when isViewOrNestedAttribute() is true, null otherwise.
 List<IManyToOneNode> getViewPath()
          Return the view path to current getViewAttribute() when attributes is nested.
 boolean isReadable(IDataAccessModelSecurityProvider dataAccessModelSecurityProvider)
          Return false if we are sure that the user represented by the securityProvider will never be authorized to read the described attribute, returns true otherwise.
 boolean isValid()
          Return true if expression is successfully parsed.
 boolean isViewAttribute()
          Returns true if expression isValid() and represents a IViewAttribute of current getView().
 boolean isViewOrNestedAttribute()
          Return true if expression isValid() and represents a view attribute or a nested view attribute.
static String toCharFunction(LogicalDataType logicalType)
          Return the function to use to wrap an expression of the given LogicalDataType
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataAccessSelectExpression

public DataAccessSelectExpression(IDataAccessModel pDataAccessModel,
                                  IView view,
                                  com.semarchy.platform.language.semql.ParsingResult<com.semarchy.platform.language.semql.elements.IExpression> parsingResult)
This should not be used directly. One should use a IDataAccessParser instead

Parameters:
pDataAccessModel -
view -
parsingResult -
Method Detail

getDataAccessModel

@Deprecated
public IDataAccessModel getDataAccessModel()
Deprecated. you should get the IDataAccessModel by your own means

Returns:

getView

public IView getView()
The IView for which this expression has been parsed

Returns:

getParsingResult

public com.semarchy.platform.language.semql.ParsingResult<com.semarchy.platform.language.semql.elements.IExpression> getParsingResult()
Returns parsing details.

Returns:

isViewAttribute

public boolean isViewAttribute()
Returns true if expression isValid() and represents a IViewAttribute of current getView(). It returns false if the expression is an attribute of a referenced view or an invalid expression.

Example based on getting started Employee Golden View

Returns:

isViewOrNestedAttribute

public boolean isViewOrNestedAttribute()
Return true if expression isValid() and represents a view attribute or a nested view attribute.

Example based on getting started Employee Golden View

Returns:

getSemQLAttribute

public SemQLViewAttribute getSemQLAttribute()
REturn the SemQLViewAttribute for the expression when isViewOrNestedAttribute() is true, null otherwise

Returns:

getViewAttribute

public IViewAttribute<? extends IAttribute> getViewAttribute()
Return the IViewAttribute referenced by the expression when isViewOrNestedAttribute() is true, null otherwise.

Returns:

getViewPath

public List<IManyToOneNode> getViewPath()
                                 throws IllegalStateException
Return the view path to current getViewAttribute() when attributes is nested.

Returns:
Throws:
IllegalStateException - if isViewOrNestedAttribute() returns false

getLogicalType

public LogicalDataType getLogicalType()
Return the logical type if known or null if not known.

Returns:

getTypeInfo

public DataTypeInfo getTypeInfo()
The type information if known or null if unknown

Returns:

computeExpressionType

public static DataTypeInfo computeExpressionType(com.semarchy.platform.language.semql.elements.IExpression expression)
Try to compute a DataTypeInfo from an IExpression. If the IExpression is a simple ISemQLAttr you should try to get this information from the semql attribute itself instead.

Parameters:
expression -
Returns:

getExpression

public String getExpression()
The SemQL expression. Like

Returns:

isValid

public boolean isValid()
Return true if expression is successfully parsed. Use   getParsingResult() for more information

Returns:

isReadable

public boolean isReadable(IDataAccessModelSecurityProvider dataAccessModelSecurityProvider)
Return false if we are sure that the user represented by the securityProvider will never be authorized to read the described attribute, returns true otherwise.

Parameters:
dataAccessModelSecurityProvider -
Returns:

toString

public String toString()
Overrides:
toString in class Object

toCharFunction

public static String toCharFunction(LogicalDataType logicalType)
Return the function to use to wrap an expression of the given LogicalDataType

Parameters:
logicalType -
Returns:

getSortExpression

public String getSortExpression()
Return the Expression to use for sort on this DataAccessSelectExpression or null if not sortable

Returns:


Copyright © 2015. All Rights Reserved.