Class ParsedSubtype
- java.lang.Object
-
- de.hybris.platform.persistence.flexiblesearch.ParsedSubtype
-
public class ParsedSubtype extends java.lang.Objectsubtype of a parsed type. is is used for getting all subtype restrictions and building UNION queries if the actual parsed type is abstract.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringASstatic java.lang.StringMATCH_ALL_TYPESstatic java.lang.StringMATCH_DEPLOYMENT_TYPESstatic java.lang.StringMATCH_SUBTYPESstatic java.lang.StringMATCH_TYPE_EXACT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Collection<AbstractQueryFilter>checkRestrictions(ComposedType myType, java.util.Collection<AbstractQueryFilter> res)protected voidcheckType()no-op since subtypes dont need to be checkedprotected voidcreateParsedSubtypesAndRestrictionClauses()protected booleandisableTypeChecks()booleanequals(java.lang.Object object)protected java.util.Collection<AbstractQueryFilter>filterOverloadedRestrictions(java.util.Map<PK,java.util.Collection<AbstractQueryFilter>> typeToRestrictionsMap)protected java.util.CollectiongetApplicableRestrictions()includes its supertype restrictions too.protected java.lang.StringBuildergetBuffer()protected java.lang.StringgetCleanSource()protected de.hybris.platform.persistence.flexiblesearch.TablegetCoreTable()Delegated to supertype since all tables are handled there.protected java.util.Map<PK,de.hybris.platform.persistence.flexiblesearch.Table>getCustomLocTables()Delegated to supertype since all tables are handled there.protected de.hybris.platform.persistence.flexiblesearch.TablegetDefaultLocTable()Delegated to supertype since all tables are handled there.protected java.util.MapgetDumpTables()Delegated to supertype since all tables are handled there.protected de.hybris.platform.persistence.flexiblesearch.ParsedTextgetEnclosingText()protected java.lang.StringgetEndDelimiter()protected java.util.Set<ComposedType>getExcludedSubtypesFromRestriction(AbstractQueryFilter abstractQueryFilter, java.util.Collection<AbstractQueryFilter> all)protected FlexibleSearchTypeCacheProvidergetFSTypeCacheProvider()protected de.hybris.platform.persistence.flexiblesearch.TablegetIgnoreLocTable()Delegated to supertype since all tables are handled there.protected java.util.List<? extends de.hybris.platform.persistence.flexiblesearch.ParsedText>getNestedTexts()protected de.hybris.platform.persistence.flexiblesearch.TablegetOrCreateCoreTable()Delegated to supertype since all tables are handled there.protected de.hybris.platform.persistence.flexiblesearch.TablegetOrCreateDumpTable(de.hybris.platform.persistence.flexiblesearch.TableField field)Delegated to supertype since all tables are handled there.protected de.hybris.platform.persistence.flexiblesearch.TablegetOrCreateLocalizedTable(de.hybris.platform.persistence.flexiblesearch.TableField field)Delegated to supertype since all tables are handled there.protected de.hybris.platform.persistence.flexiblesearch.TablegetOrCreateUnlocalizedTable(de.hybris.platform.persistence.flexiblesearch.TableField field)protected java.util.CollectiongetOwnRestrictions()protected de.hybris.platform.persistence.flexiblesearch.ParsedTypegetPlaceholderType()protected java.util.Set<AbstractQueryFilter>getSameCodeRestrictions(AbstractQueryFilter filter, java.util.Collection<AbstractQueryFilter> all)protected de.hybris.platform.persistence.flexiblesearch.TablegetSpecialFieldsTable()Delegated to supertype since all tables are handled there.protected java.lang.StringgetStartDelimiter()protected java.util.CollectiongetSuperTypeRealRestrictions()subtypes must not include their supertype restrictions - so this method always returns an empty collection.protected de.hybris.platform.persistence.flexiblesearch.TablegetUnlocTable()Delegated to supertype since all tables are handled there.protected static intgetWholeWordTokenPosition(java.lang.String src, java.lang.String token)protected static intgetWholeWordTokenPosition(java.lang.String src, java.lang.String token, int startFrom)inthashCode()protected booleanhasNestedTexts()protected voidinsertIntoTranslated(int pos, java.lang.String text)protected voidregisterParsedText(de.hybris.platform.persistence.flexiblesearch.ParsedText parsed)protected voidreplaceInTranslated(de.hybris.platform.persistence.flexiblesearch.TableField field, java.lang.String text)Replaces a substring of this parsed text by a new text.protected voidreplaceInTranslated(java.lang.String old, java.lang.String text)protected java.lang.StringBuildersetBuffer(java.lang.StringBuilder buffer)protected voidsetCoreTable(de.hybris.platform.persistence.flexiblesearch.Table table)Delegated to supertype since all tables are handled there.protected voidsetCustomLocTables(java.util.Map<PK,de.hybris.platform.persistence.flexiblesearch.Table> map)Delegated to supertype since all tables are handled there.protected voidsetDefaultLocTable(de.hybris.platform.persistence.flexiblesearch.Table table)Delegated to supertype since all tables are handled there.protected voidsetDumpTables(java.util.Map map)Delegated to supertype since all tables are handled there.protected voidsetIgnoreLocTable(de.hybris.platform.persistence.flexiblesearch.Table table)Delegated to supertype since all tables are handled there.protected voidsetRestrictions(java.util.Collection<RestrictionClause> restrictionClauses)protected voidsetSource(java.lang.String source)protected voidsetSpecialFieldsTable(de.hybris.platform.persistence.flexiblesearch.Table sft)Delegated to supertype since all tables are handled there.protected voidsetSubtypes(java.util.Collection<ParsedSubtype> subtypes)protected voidsetUnlocTable(de.hybris.platform.persistence.flexiblesearch.Table table)Delegated to supertype since all tables are handled there.static java.lang.String[]splitTypeExpression(java.lang.String expr)Splits a type expression with this structure:java.lang.StringtoString()protected voidtranslate()type only does a single pass !protected de.hybris.platform.persistence.flexiblesearch.ParsedTexttranslateNested(int resultInsertPos, java.lang.String selectedText)just returns this field now.protected voidtranslateRestrictionsAndSubtypes()
-
-
-
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_SUBTYPES
public static final java.lang.String MATCH_SUBTYPES
- See Also:
- Constant Field Values
-
MATCH_ALL_TYPES
public static final java.lang.String MATCH_ALL_TYPES
- 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()
-
checkType
protected void checkType() throws FlexibleSearchExceptionno-op since subtypes dont need to be checked- Throws:
FlexibleSearchException
-
getApplicableRestrictions
protected java.util.Collection getApplicableRestrictions() throws FlexibleSearchExceptionincludes 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 FlexibleSearchExceptionDelegated 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 FlexibleSearchExceptionDelegated 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 FlexibleSearchExceptiontype only does a single pass !- Throws:
FlexibleSearchException
-
checkRestrictions
protected java.util.Collection<AbstractQueryFilter> checkRestrictions(ComposedType myType, java.util.Collection<AbstractQueryFilter> res)
-
getExcludedSubtypesFromRestriction
protected java.util.Set<ComposedType> getExcludedSubtypesFromRestriction(AbstractQueryFilter abstractQueryFilter, java.util.Collection<AbstractQueryFilter> all)
-
getSameCodeRestrictions
protected java.util.Set<AbstractQueryFilter> getSameCodeRestrictions(AbstractQueryFilter filter, java.util.Collection<AbstractQueryFilter> all)
-
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)
-
getOwnRestrictions
protected java.util.Collection getOwnRestrictions() throws FlexibleSearchException- Returns:
- this types restrictions
- Throws:
FlexibleSearchException
-
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()
-
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, java.lang.String selectedText) throws FlexibleSearchExceptionjust 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 textselectedText- the selected text from source- Throws:
FlexibleSearchException
-
disableTypeChecks
protected boolean disableTypeChecks()
-
getFSTypeCacheProvider
protected FlexibleSearchTypeCacheProvider getFSTypeCacheProvider()
-
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()
-
-