Class TypeConstraint

java.lang.Object
org.alfresco.util.TypeConstraint

public class TypeConstraint extends 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 Details

  • Constructor Details

    • TypeConstraint

      public TypeConstraint()
  • Method Details

    • setExpectedTypes

      public void setExpectedTypes(List<String> expectedTypes)
    • setNodeService

      public void setNodeService(NodeService nodeService)
    • setDictionaryService

      public void setDictionaryService(DictionaryService dictionaryService)
    • setExcludedTypes

      public void setExcludedTypes(List<String> excludedTypes)
    • init

      public void init()
    • preprocessExcludedTypes

      protected void preprocessExcludedTypes(List<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(List<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(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.