Class QNameFilterImpl

  • All Implemented Interfaces:
    QNameFilter

    public class QNameFilterImpl
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      QNameFilterImpl()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Collection<QName> filterQName​(java.util.Collection<QName> typesToFilter)
      Filters out any QName defined in the "excludedModels" property
      void initFilter()  
      boolean isExcluded​(QName typeQName)
      Indicates that this QName should be excluded.
      static java.util.List<java.lang.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​(java.util.List<java.lang.String> excludeTypeNames)
      Processes the user-defined list of types into valid QNames and models, it validates them against the dictionary and also supports wildcards
      void setExcluded​(QName typeQName, boolean excluded)
      Exclude the type
      void setExcludedTypes​(java.util.List<java.lang.String> excludedTypes)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • QNameFilterImpl

        public QNameFilterImpl()
    • Method Detail

      • filterQName

        public java.util.Collection<QName> filterQName​(java.util.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​(java.util.List<java.lang.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
      • setExcludedTypes

        public void setExcludedTypes​(java.util.List<java.lang.String> excludedTypes)
      • listOfHardCodedExcludedTypes

        public static java.util.List<java.lang.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