com.fatwire.assetapi.query
Class ConditionParser

java.lang.Object
  extended by com.fatwire.assetapi.query.ConditionParser

public class ConditionParser
extends java.lang.Object

The parsing utilities to parse the conditions from query into Baisc search ics variables or flex search conditon - SearchState


Method Summary
static java.util.List<java.lang.String> parseBasicCondition(ICS ics, AssetTypeDef atd, Condition c, java.lang.String prefix, FTValList attributes)
          This method is used to convert a condition to an asset search format.
static ISearchState parseFlexCondition(ICS ics, AssetTypeDef atd, java.lang.String attributeType, Condition c)
           
static java.lang.String validAttributes(ICS ics, AssetTypeDef atd, java.util.List<java.lang.String> attributes)
          validate whether any of the attribute specified in the list does not belong to the specified assettype/subtype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseFlexCondition

public static ISearchState parseFlexCondition(ICS ics,
                                              AssetTypeDef atd,
                                              java.lang.String attributeType,
                                              Condition c)
                                       throws AssetAccessException
Parameters:
attributeType - The flex asset attribute type
c - The condition to parse
Returns:
ISearchState The searchstate equivilant of the Condtion
Throws:
AssetAccessException

parseBasicCondition

public static java.util.List<java.lang.String> parseBasicCondition(ICS ics,
                                                                   AssetTypeDef atd,
                                                                   Condition c,
                                                                   java.lang.String prefix,
                                                                   FTValList attributes)
                                                            throws AssetAccessException
This method is used to convert a condition to an asset search format. In particular, asset search has the following restriction 1. for same attribute, the only operation allowed is OR 2. for different attribute, the only operation allowed is AND

Parameters:
ics -
c -
prefix -
attributes -
Throws:
AssetAccessException

validAttributes

public static java.lang.String validAttributes(ICS ics,
                                               AssetTypeDef atd,
                                               java.util.List<java.lang.String> attributes)
validate whether any of the attribute specified in the list does not belong to the specified assettype/subtype

Parameters:
atd - the asset type definition object
attributes - list of string names to validate
Returns:
true if all are valid attributes, false if any is not