Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2009, Red Hat, Inc. and/or its affiliates, 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.interceptor.builder;
 
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
This builder shouldn't be reused.

Author(s):
Marius Bogoevici
Marko Luksa
Martin Kouba
 
 public class InterceptionModelBuilder {
 
     private boolean isModelBuilt = false;
 
     private boolean hasExternalNonConstructorInterceptors;
 
     private final Set<MethodmethodsIgnoringGlobalInterceptors = new HashSet<Method>();
 
 
 
 
 
     public InterceptionModel build() {
         checkModelNotBuilt();
          = true;
         return new InterceptionModelImpl(this);
     }
 
     public void intercept(javax.enterprise.inject.spi.InterceptionType interceptionTypeMethod methodCollection<InterceptorClassMetadata<?>> interceptors) {
         checkModelNotBuilt();
         InterceptionType weldInterceptionType = InterceptionType.valueOf(interceptionType);
         if (weldInterceptionType.isLifecycleCallback()) {
             throw new IllegalArgumentException("Illegal interception type: " + interceptionType);
         }
 
         if (null == .get(weldInterceptionType)) {
             .put(weldInterceptionTypenew HashMap<MethodList<InterceptorClassMetadata<?>>>());
         }
         List<InterceptorClassMetadata<?>> interceptorsList = .get(weldInterceptionType).get(method);
         if (interceptorsList == null) {
             interceptorsList = new ArrayList<InterceptorClassMetadata<?>>();
             .get(weldInterceptionType).put(methodinterceptorsList);
         }
         interceptorsList.addAll(interceptors);
         intercept(weldInterceptionTypeinterceptorsList);
     }
 
     public void intercept(javax.enterprise.inject.spi.InterceptionType interceptionTypeCollection<InterceptorClassMetadata<?>> interceptors) {
         checkModelNotBuilt();
         InterceptionType weldInterceptionType = InterceptionType.valueOf(interceptionType);
 
         List<InterceptorClassMetadata<?>> interceptorsList = .get(weldInterceptionType);
         if (interceptorsList == null) {
             interceptorsList = new ArrayList<InterceptorClassMetadata<?>>();
             .put(weldInterceptionTypeinterceptorsList);
         }
         interceptorsList.addAll(interceptors);
         intercept(weldInterceptionTypeinterceptorsList);
     }
    private void intercept(InterceptionType interceptionTypeCollection<InterceptorClassMetadata<?>> interceptors) {
        if (interceptionType != .) {
             = true;
        }
        .addAll(interceptors);
    }
    public void addMethodIgnoringGlobalInterceptors(Method method) {
        checkModelNotBuilt();
        this..add(method);
    }
    }
        return ;
    }
        return ;
    }
        return ;
    }
        return ;
    }
    private void checkModelNotBuilt() {
        if() {
            throw new IllegalStateException("InterceptionModelBuilder cannot be reused");
        }
    }
        return ;
    }
    public void setTargetClassInterceptorMetadata(TargetClassInterceptorMetadata targetClassInterceptorMetadata) {
        this. = targetClassInterceptorMetadata;
    }
New to GrepCode? Check out our FAQ X