Package org.exoplatform.container.context

Examples of org.exoplatform.container.context.DefinitionException


            && (annotationType.isAnnotationPresent(Scope.class) || annotationType
               .isAnnotationPresent(NormalScope.class)))
         {
            if (scope != null)
            {
               throw new DefinitionException("You cannot set several scopes to the class " + clazz.getName());
            }
            scope = annotationType;
         }
         else if (annotationType.isAnnotationPresent(Stereotype.class))
         {
            hasStereotype = true;
            Annotation[] stereotypeAnnotations = annotationType.getAnnotations();
            for (int j = 0; j < stereotypeAnnotations.length; j++)
            {
               Annotation stereotypeAnnotation = stereotypeAnnotations[j];
               Class<? extends Annotation> stereotypeAnnotationType = stereotypeAnnotation.annotationType();
               if (stereotypeAnnotationType.isAnnotationPresent(Scope.class)
                  || stereotypeAnnotationType.isAnnotationPresent(NormalScope.class))
               {
                  if (defaultScope != null && !defaultScope.equals(stereotypeAnnotationType))
                  {
                     throw new DefinitionException("The class " + clazz.getName()
                        + " has stereotypes with different default scope");
                  }
                  defaultScope = stereotypeAnnotationType;
               }
            }
         }
      }
      if (scope != null)
         return scope;
      if (defaultScope != null)
         return defaultScope;
      if (hasStereotype)
      {
         throw new DefinitionException("The class " + clazz.getName()
            + " has at least one stereotype but doesn't have any scope, please set an explicit scope");
      }
      return null;
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.container.context.DefinitionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.