mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
125603 rmunteanu: Merged 5.1.1 (5.1.1) to 5.1.N (5.1.2) 125484 slanglois: MNT-16155 Update source headers - remove old Copyrights from Java and JSP dource files git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@125781 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
39 lines
1.1 KiB
Java
39 lines
1.1 KiB
Java
package org.alfresco.web.config;
|
|
|
|
import java.util.Set;
|
|
|
|
import org.springframework.extensions.config.evaluator.Evaluator;
|
|
import org.alfresco.service.namespace.QName;
|
|
import org.alfresco.web.bean.repository.Node;
|
|
import org.alfresco.web.bean.repository.Repository;
|
|
|
|
/**
|
|
* Evaluator that determines whether a given object has a particular aspect applied
|
|
*
|
|
* @author gavinc
|
|
*/
|
|
public final class AspectEvaluator implements Evaluator
|
|
{
|
|
/**
|
|
* Determines whether the given aspect is applied to the given object
|
|
*
|
|
* @see org.springframework.extensions.config.evaluator.Evaluator#applies(java.lang.Object, java.lang.String)
|
|
*/
|
|
public boolean applies(Object obj, String condition)
|
|
{
|
|
boolean result = false;
|
|
|
|
if (obj instanceof Node)
|
|
{
|
|
Set aspects = ((Node)obj).getAspects();
|
|
if (aspects != null)
|
|
{
|
|
QName spaceQName = Repository.resolveToQName(condition);
|
|
result = aspects.contains(spaceQName);
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|