Package org.alfresco.util
Class TypeConstraint
- java.lang.Object
-
- org.alfresco.util.TypeConstraint
-
public class TypeConstraint extends java.lang.ObjectStores 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.StringWILDCARD
-
Constructor Summary
Constructors Constructor Description TypeConstraint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit()booleanmatches(org.alfresco.service.cmr.repository.NodeRef nodeRef)Returns true if the nodeRef matches the constraints, false otherwise.protected voidpreprocessExcludedTypes(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 wildcardsprotected voidpreprocessExpectedTypes(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 wildcardsvoidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)voidsetExcludedTypes(java.util.List<java.lang.String> excludedTypes)voidsetExpectedTypes(java.util.List<java.lang.String> expectedTypes)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
-
-
-
Field Detail
-
WILDCARD
public static final java.lang.String WILDCARD
- See Also:
- Constant Field Values
-
-
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.
-
-