Package org.alfresco.opencmis.dictionary
Class QNameFilterImpl
- java.lang.Object
-
- org.alfresco.opencmis.dictionary.QNameFilterImpl
-
- All Implemented Interfaces:
QNameFilter
public class QNameFilterImpl extends Object implements QNameFilter
Filters a QName and excludes any that are defined using the excludedTypes parameter. The list of types can either be defined using a property name such as "cm:name" or with a wildcard: "cm:*" It validates the definitions against the DataDictionary.- Author:
- steveglover, Gethin James
-
-
Field Summary
-
Fields inherited from interface org.alfresco.opencmis.dictionary.QNameFilter
WILDCARD
-
-
Constructor Summary
Constructors Constructor Description QNameFilterImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<QName>
filterQName(Collection<QName> typesToFilter)
Filters out any QName defined in the "excludedModels" propertyvoid
initFilter()
boolean
isExcluded(QName typeQName)
Indicates that this QName should be excluded.static List<String>
listOfHardCodedExcludedTypes()
I don't like hard code values, but have been persuaded its less pain than having to keep a config file in sync with both sides of SOLR.protected void
preprocessExcludedTypes(List<String> excludeTypeNames)
Processes the user-defined list of types into valid QNames and models, it validates them against the dictionary and also supports wildcardsvoid
setExcluded(QName typeQName, boolean excluded)
Exclude the typevoid
setExcludedTypes(List<String> excludedTypes)
-
-
-
Method Detail
-
filterQName
public Collection<QName> filterQName(Collection<QName> typesToFilter)
Filters out any QName defined in the "excludedModels" property- Specified by:
filterQName
in interfaceQNameFilter
- Parameters:
typesToFilter
- - original list- Returns:
- the filtered list
-
preprocessExcludedTypes
protected void preprocessExcludedTypes(List<String> excludeTypeNames)
Processes the user-defined list of types into valid QNames and models, it validates them against the dictionary and also supports wildcards
-
isExcluded
public boolean isExcluded(QName typeQName)
Indicates that this QName should be excluded.- Specified by:
isExcluded
in interfaceQNameFilter
- Parameters:
typeQName
- QName- Returns:
- boolean true if it is excluded
-
initFilter
public void initFilter()
- Specified by:
initFilter
in interfaceQNameFilter
-
listOfHardCodedExcludedTypes
public static List<String> listOfHardCodedExcludedTypes()
I don't like hard code values, but have been persuaded its less pain than having to keep a config file in sync with both sides of SOLR.
-
setExcluded
public void setExcluded(QName typeQName, boolean excluded)
Description copied from interface:QNameFilter
Exclude the type- Specified by:
setExcluded
in interfaceQNameFilter
- Parameters:
typeQName
- the type to exclude
-
-