Package org.alfresco.util
Class TypeConstraint
java.lang.Object
org.alfresco.util.TypeConstraint
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit()booleanReturns true if the nodeRef matches the constraints, false otherwise.protected voidpreprocessExcludedTypes(List<String> typeNames) Processes the user-defined list of types into valid QNames & models, it validates them against the dictionary and also supports wildcardsprotected voidpreprocessExpectedTypes(List<String> typeNames) Processes the user-defined list of types into valid QNames & models, it validates them against the dictionary and also supports wildcardsvoidsetDictionaryService(DictionaryService dictionaryService) voidsetExcludedTypes(List<String> excludedTypes) voidsetExpectedTypes(List<String> expectedTypes) voidsetNodeService(NodeService nodeService)
-
Field Details
-
WILDCARD
- See Also:
-
-
Constructor Details
-
TypeConstraint
public TypeConstraint()
-
-
Method Details
-
setExpectedTypes
-
setNodeService
-
setDictionaryService
-
setExcludedTypes
-
init
public void init() -
preprocessExcludedTypes
Processes the user-defined list of types into valid QNames & models, it validates them against the dictionary and also supports wildcards -
preprocessExpectedTypes
Processes the user-defined list of types into valid QNames & models, it validates them against the dictionary and also supports wildcards -
matches
Returns true if the nodeRef matches the constraints, false otherwise.- Parameters:
nodeRef- NodeRef- Returns:
- returns true if the nodeRef matches the constraints, false otherwise.
-