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
  • Constructor Details

    • QNameFilterImpl

      public QNameFilterImpl()
  • Method Details

    • filterQName

      public Collection<QName> filterQName(Collection<QName> typesToFilter)
      Filters out any QName defined in the "excludedModels" property
      Specified by:
      filterQName in interface QNameFilter
      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 interface QNameFilter
      Parameters:
      typeQName - QName
      Returns:
      boolean true if it is excluded
    • initFilter

      public void initFilter()
      Specified by:
      initFilter in interface QNameFilter
    • setExcludedTypes

      public void setExcludedTypes(List<String> excludedTypes)
    • 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 interface QNameFilter
      Parameters:
      typeQName - the type to exclude