Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2008, Red Hat, Inc., and individual contributors
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package org.jboss.weld.metadata.cache;
 
 import static java.lang.annotation.ElementType.FIELD;
 import static java.lang.annotation.ElementType.METHOD;
 import static java.lang.annotation.ElementType.TYPE;
 
 import java.util.Set;
 
 
Model of a scope

Author(s):
Pete Muir
 
 public class ScopeModel<T extends Annotationextends AnnotationModel<T> {
 
     private static final Set<Class<? extends Annotation>> META_ANNOTATIONS = Arrays2.asSet(Scope.classNormalScope.class);
 
     private final boolean normal;
     private final boolean passivating;

    
Constructor

Parameters:
scope The scope type
 
     public ScopeModel(EnhancedAnnotation<T> enhancedAnnotatedAnnotation) {
         super(enhancedAnnotatedAnnotation);
         if (isValid()) {
             if (enhancedAnnotatedAnnotation.isAnnotationPresent(NormalScope.class)) {
                 this. = enhancedAnnotatedAnnotation.getAnnotation(NormalScope.class).passivating();
                 this. = true;
             } else {
                 this. = false;
                 this. = false;
             }
         } else {
             this. = false;
             this. = false;
         }
     }
 
     @Override
     protected void check(EnhancedAnnotation<T> annotatedAnnotation) {
         super.check(annotatedAnnotation);
         if (isValid()) {
             if (!annotatedAnnotation.isAnnotationPresent(Target.class)) {
                 ..missingTarget(annotatedAnnotation);
             } else if (!Arrays2.unorderedEquals(annotatedAnnotation.getAnnotation(Target.class).value(), )) {
                 ..missingTargetMethodFieldType(annotatedAnnotation);
             }
         }
     }

    
Indicates if the scope is "normal"

Returns:
True if normal, false otherwise
 
     public boolean isNormal() {
         return ;
     }

    
Indicates if the scope is "passivating"

Returns:
True if passivating, false otherwise
 
     public boolean isPassivating() {
         return ;
     }

    
Gets the corresponding meta-annotation type class

Returns:
The ScopeType class
    @Override
    protected Set<Class<? extends Annotation>> getMetaAnnotationTypes() {
        return ;
    }

    
Gets a string representation of the scope model

Returns:
The string representation
    @Override
    public String toString() {
        String valid = isValid() ? "Valid " : "Invalid";
        String normal = isNormal() ? "normal " : "non-normal ";
        String passivating = isPassivating() ? "passivating " : "pon-passivating ";
        return valid + normal + passivating + " scope model for " + getRawType();
    }
New to GrepCode? Check out our FAQ X