Class ParsedSubtype


  • public class ParsedSubtype
    extends java.lang.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 Detail

      • AS

        public static final java.lang.String AS
      • MATCH_TYPE_EXACT

        public static final java.lang.String MATCH_TYPE_EXACT
        See Also:
        Constant Field Values
      • MATCH_DEPLOYMENT_TYPES

        public static final java.lang.String MATCH_DEPLOYMENT_TYPES
        See Also:
        Constant Field Values
    • Method Detail

      • createParsedSubtypesAndRestrictionClauses

        protected void createParsedSubtypesAndRestrictionClauses()
      • getApplicableRestrictions

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

        protected final java.util.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 java.util.Map<PK,​de.hybris.platform.persistence.flexiblesearch.Table> getCustomLocTables()
        Delegated to supertype since all tables are handled there.
      • setCustomLocTables

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

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

        protected void setDumpTables​(java.util.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()
      • filterOverloadedRestrictions

        protected java.util.Collection<AbstractQueryFilter> filterOverloadedRestrictions​(java.util.Map<PK,​java.util.Collection<AbstractQueryFilter>> typeToRestrictionsMap)
      • setRestrictions

        protected void setRestrictions​(java.util.Collection<RestrictionClause> restrictionClauses)
      • setSubtypes

        protected void setSubtypes​(java.util.Collection<ParsedSubtype> subtypes)
      • splitTypeExpression

        public static java.lang.String[] splitTypeExpression​(java.lang.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​(java.lang.Object object)
      • toString

        public java.lang.String toString()
      • 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,
                                                                                           java.lang.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()
      • getWholeWordTokenPosition

        protected static final int getWholeWordTokenPosition​(java.lang.String src,
                                                             java.lang.String token)
      • getWholeWordTokenPosition

        protected static final int getWholeWordTokenPosition​(java.lang.String src,
                                                             java.lang.String token,
                                                             int startFrom)
      • setSource

        protected void setSource​(java.lang.String source)
      • getEnclosingText

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

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

        protected boolean hasNestedTexts()
      • getBuffer

        protected java.lang.StringBuilder getBuffer()
      • setBuffer

        protected java.lang.StringBuilder setBuffer​(java.lang.StringBuilder buffer)
      • getStartDelimiter

        protected java.lang.String getStartDelimiter()
      • getEndDelimiter

        protected java.lang.String getEndDelimiter()
      • replaceInTranslated

        protected void replaceInTranslated​(java.lang.String old,
                                           java.lang.String text)
      • insertIntoTranslated

        protected void insertIntoTranslated​(int pos,
                                            java.lang.String text)
      • replaceInTranslated

        protected void replaceInTranslated​(de.hybris.platform.persistence.flexiblesearch.TableField field,
                                           java.lang.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 java.lang.String getCleanSource()