Class TypeConstraint


  • public class TypeConstraint
    extends java.lang.Object
    Stores a set of expected and excluded types, by full type name. The localName can be a wildcard (*) to indicate that the whole namespace should be expected/excluded. A node is tested to ensure that its type is in the expected list and not in the excluded list. Its aspects are also tested to ensure that they are in the expected list and not in the excluded list. Adapted some code from QNameFilter.
    Author:
    steveglover
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String WILDCARD  
    • Constructor Summary

      Constructors 
      Constructor Description
      TypeConstraint()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void init()  
      boolean matches​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Returns true if the nodeRef matches the constraints, false otherwise.
      protected void preprocessExcludedTypes​(java.util.List<java.lang.String> typeNames)
      Processes the user-defined list of types into valid QNames & models, it validates them against the dictionary and also supports wildcards
      protected void preprocessExpectedTypes​(java.util.List<java.lang.String> typeNames)
      Processes the user-defined list of types into valid QNames & models, it validates them against the dictionary and also supports wildcards
      void setDictionaryService​(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)  
      void setExcludedTypes​(java.util.List<java.lang.String> excludedTypes)  
      void setExpectedTypes​(java.util.List<java.lang.String> expectedTypes)  
      void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)  
      • Methods inherited from class java.lang.Object

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

      • TypeConstraint

        public TypeConstraint()
    • Method Detail

      • setExpectedTypes

        public void setExpectedTypes​(java.util.List<java.lang.String> expectedTypes)
      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
      • setDictionaryService

        public void setDictionaryService​(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
      • setExcludedTypes

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

        public void init()
      • preprocessExcludedTypes

        protected void preprocessExcludedTypes​(java.util.List<java.lang.String> typeNames)
        Processes the user-defined list of types into valid QNames & models, it validates them against the dictionary and also supports wildcards
      • preprocessExpectedTypes

        protected void preprocessExpectedTypes​(java.util.List<java.lang.String> typeNames)
        Processes the user-defined list of types into valid QNames & models, it validates them against the dictionary and also supports wildcards
      • matches

        public boolean matches​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Returns true if the nodeRef matches the constraints, false otherwise.
        Parameters:
        nodeRef - NodeRef
        Returns:
        returns true if the nodeRef matches the constraints, false otherwise.