All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.inteligr8.alfresco.annotations.NodeAspectConstrainable Maven / Gradle / Ivy

The newest version!
package com.inteligr8.alfresco.annotations;

import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.QNamePattern;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.springframework.beans.factory.BeanNameAware;

public interface NodeAspectConstrainable extends BeanNameAware {
	
	String getBeanName();
	
	NamespaceService getNamespaceService();
	
	default Collection constrainedPrefixedAspects() {
		return Collections.emptySet();
	}
	
	default Collection constrainedRegexedAspects() {
		return Collections.emptySet();
	}
	
	default Collection constrainedAspects() {
		Set aspects = new HashSet<>();
		
		Collection prefixedAspects = this.constrainedPrefixedAspects();
		for (String prefixedAspect : prefixedAspects)
			aspects.add(QName.createQName(prefixedAspect, this.getNamespaceService()));

		Collection regexedAspects = this.constrainedRegexedAspects();
		for (String regexedAspect : regexedAspects)
			aspects.add(new RegexQNamePattern(regexedAspect));
		
		return aspects;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy