Class ParsedSubtype

java.lang.Object
de.hybris.platform.persistence.flexiblesearch.ParsedSubtype

public class ParsedSubtype extends Object
subtype of a parsed type. is is used for getting all subtype restrictions and building UNION queries if the actual parsed type is abstract.
  • Field Details

  • Method Details

    • createParsedSubtypesAndRestrictionClauses

      protected void createParsedSubtypesAndRestrictionClauses()
    • checkType

      protected void checkType() throws FlexibleSearchException
      no-op since subtypes dont need to be checked
      Throws:
      FlexibleSearchException
    • getApplicableRestrictions

      protected Collection getApplicableRestrictions() throws FlexibleSearchException
      includes its supertype restrictions too.
      Returns:
      all restrictions which apply to this type
      Throws:
      FlexibleSearchException
    • getSuperTypeRealRestrictions

      protected final Collection getSuperTypeRealRestrictions()
      subtypes must not include their supertype restrictions - so this method always returns an empty collection.
    • getSpecialFieldsTable

      protected de.hybris.platform.persistence.flexiblesearch.Table getSpecialFieldsTable()
      Delegated to supertype since all tables are handled there.
    • setSpecialFieldsTable

      protected void setSpecialFieldsTable(de.hybris.platform.persistence.flexiblesearch.Table sft)
      Delegated to supertype since all tables are handled there.
    • getCustomLocTables

      protected Map<PK,de.hybris.platform.persistence.flexiblesearch.Table> getCustomLocTables()
      Delegated to supertype since all tables are handled there.
    • setCustomLocTables

      protected void setCustomLocTables(Map<PK,de.hybris.platform.persistence.flexiblesearch.Table> map)
      Delegated to supertype since all tables are handled there.
    • getDumpTables

      protected Map getDumpTables()
      Delegated to supertype since all tables are handled there.
    • setDumpTables

      protected void setDumpTables(Map map)
      Delegated to supertype since all tables are handled there.
    • getCoreTable

      protected de.hybris.platform.persistence.flexiblesearch.Table getCoreTable()
      Delegated to supertype since all tables are handled there.
    • setCoreTable

      protected void setCoreTable(de.hybris.platform.persistence.flexiblesearch.Table table)
      Delegated to supertype since all tables are handled there.
    • getUnlocTable

      protected de.hybris.platform.persistence.flexiblesearch.Table getUnlocTable()
      Delegated to supertype since all tables are handled there.
    • setUnlocTable

      protected void setUnlocTable(de.hybris.platform.persistence.flexiblesearch.Table table)
      Delegated to supertype since all tables are handled there.
    • getDefaultLocTable

      protected de.hybris.platform.persistence.flexiblesearch.Table getDefaultLocTable()
      Delegated to supertype since all tables are handled there.
    • setDefaultLocTable

      protected void setDefaultLocTable(de.hybris.platform.persistence.flexiblesearch.Table table)
      Delegated to supertype since all tables are handled there.
    • getIgnoreLocTable

      protected de.hybris.platform.persistence.flexiblesearch.Table getIgnoreLocTable()
      Delegated to supertype since all tables are handled there.
    • setIgnoreLocTable

      protected void setIgnoreLocTable(de.hybris.platform.persistence.flexiblesearch.Table table)
      Delegated to supertype since all tables are handled there.
    • getOrCreateCoreTable

      protected de.hybris.platform.persistence.flexiblesearch.Table getOrCreateCoreTable()
      Delegated to supertype since all tables are handled there.
      Returns:
      the core table of this type. if it not existed before it will be created.
    • getOrCreateDumpTable

      protected de.hybris.platform.persistence.flexiblesearch.Table getOrCreateDumpTable(de.hybris.platform.persistence.flexiblesearch.TableField field) throws FlexibleSearchException
      Delegated to supertype since all tables are handled there.
      Parameters:
      field - the field to create the dump table for
      Returns:
      the dump table for the given arguments of this type. if it not existed before it will be created.
      Throws:
      FlexibleSearchException
    • getOrCreateLocalizedTable

      protected de.hybris.platform.persistence.flexiblesearch.Table getOrCreateLocalizedTable(de.hybris.platform.persistence.flexiblesearch.TableField field) throws FlexibleSearchException
      Delegated to supertype since all tables are handled there.
      Parameters:
      field - the field to create a LP table for
      Returns:
      the localized table for the given arguments of this type. if it not existed before it will be created.
      Throws:
      FlexibleSearchException
    • getPlaceholderType

      protected de.hybris.platform.persistence.flexiblesearch.ParsedType getPlaceholderType()
    • translate

      protected void translate() throws FlexibleSearchException
      type only does a single pass !
      Throws:
      FlexibleSearchException
    • checkRestrictions

      protected Collection<AbstractQueryFilter> checkRestrictions(ComposedType myType, Collection<AbstractQueryFilter> res)
    • getExcludedSubtypesFromRestriction

      protected Set<ComposedType> getExcludedSubtypesFromRestriction(AbstractQueryFilter abstractQueryFilter, Collection<AbstractQueryFilter> all)
    • getSameCodeRestrictions

      protected Set<AbstractQueryFilter> getSameCodeRestrictions(AbstractQueryFilter filter, Collection<AbstractQueryFilter> all)
    • filterOverloadedRestrictions

      protected Collection<AbstractQueryFilter> filterOverloadedRestrictions(Map<PK,Collection<AbstractQueryFilter>> typeToRestrictionsMap)
    • setRestrictions

      protected void setRestrictions(Collection<RestrictionClause> restrictionClauses)
    • setSubtypes

      protected void setSubtypes(Collection<ParsedSubtype> subtypes)
    • getOwnRestrictions

      protected Collection getOwnRestrictions() throws FlexibleSearchException
      Returns:
      this types restrictions
      Throws:
      FlexibleSearchException
    • splitTypeExpression

      public static String[] splitTypeExpression(String expr)
      Splits a type expression with this structure:
              typeCode + ('!'|'*'|'^')? + ( ' AS ' + alias )?
       
      Parameters:
      expr - the type expression to split
      Returns:
      [ typeCode, MATCH_TYPE_EXACT|MATCH_SUBTYPES|MATCH_ALL_TYPES|MATCH_DEPLOYMENT_TYPES, alias|null ]
    • hashCode

      public int hashCode()
    • equals

      public boolean equals(Object object)
    • toString

      public String toString()
    • translateRestrictionsAndSubtypes

      protected void translateRestrictionsAndSubtypes() throws FlexibleSearchException
      Throws:
      FlexibleSearchException
    • getOrCreateUnlocalizedTable

      protected de.hybris.platform.persistence.flexiblesearch.Table getOrCreateUnlocalizedTable(de.hybris.platform.persistence.flexiblesearch.TableField field)
      Returns:
      the unlocalized table of this type. if it not existed before it will be created.
    • translateNested

      protected de.hybris.platform.persistence.flexiblesearch.ParsedText translateNested(int resultInsertPos, String selectedText) throws FlexibleSearchException
      just returns this field now. override for you own handling of these texts.
      Parameters:
      resultInsertPos - the position where the result of this method is placed in the translated text
      selectedText - the selected text from source
      Throws:
      FlexibleSearchException
    • disableTypeChecks

      protected boolean disableTypeChecks()
    • getFSTypeCacheProvider

      protected FlexibleSearchTypeCacheProvider getFSTypeCacheProvider()
    • getWholeWordTokenPosition

      protected static final int getWholeWordTokenPosition(String src, String token)
    • getWholeWordTokenPosition

      protected static final int getWholeWordTokenPosition(String src, String token, int startFrom)
    • setSource

      protected void setSource(String source)
    • getEnclosingText

      protected de.hybris.platform.persistence.flexiblesearch.ParsedText getEnclosingText()
    • getNestedTexts

      protected List<? extends de.hybris.platform.persistence.flexiblesearch.ParsedText> getNestedTexts()
    • hasNestedTexts

      protected boolean hasNestedTexts()
    • getBuffer

      protected StringBuilder getBuffer()
    • setBuffer

      protected StringBuilder setBuffer(StringBuilder buffer)
    • getStartDelimiter

      protected String getStartDelimiter()
    • getEndDelimiter

      protected String getEndDelimiter()
    • replaceInTranslated

      protected void replaceInTranslated(String old, String text)
    • insertIntoTranslated

      protected void insertIntoTranslated(int pos, String text)
    • replaceInTranslated

      protected void replaceInTranslated(de.hybris.platform.persistence.flexiblesearch.TableField field, String text)
      Replaces a substring of this parsed text by a new text.
      Parameters:
      text - the new text to insert
    • registerParsedText

      protected void registerParsedText(de.hybris.platform.persistence.flexiblesearch.ParsedText parsed)
    • getCleanSource

      protected String getCleanSource()