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.bean;
 
 import java.util.Set;
 
 
Represents a producer field

Parameters:
<T>
Author(s):
Pete Muir
 
 public class ProducerField<X, T> extends AbstractProducerBean<X, T, Field> {
 
     // The underlying field
     private final AnnotatedField<? super X> annotatedField;
     private volatile EnhancedAnnotatedField<T, ? super X> enhancedAnnotatedField;
     private final boolean proxiable;

    
Creates a producer field

Parameters:
field The underlying method abstraction
declaringBean The declaring bean abstraction
beanManager the current manager
Returns:
A producer field
 
     public static <X, T> ProducerField<X, T> of(BeanAttributes<T> attributesEnhancedAnnotatedField<T, ? super X> fieldAbstractClassBean<X> declaringBeanDisposalMethod<X, ?> disposalMethodBeanManagerImpl beanManagerServiceRegistry services) {
         return new ProducerField<X, T>(attributesfielddeclaringBeandisposalMethodbeanManagerservices);
     }


    
Constructor

Parameters:
method The producer field abstraction
declaringBean The declaring bean
manager The Bean manager
 
     protected ProducerField(BeanAttributes<T> attributesEnhancedAnnotatedField<T, ? super X> fieldAbstractClassBean<X> declaringBeanDisposalMethod<X, ?> disposalMethodBeanManagerImpl managerServiceRegistry services) {
         super(attributesnew StringBeanIdentifier(BeanIdentifiers.forProducerField(fielddeclaringBean)), declaringBeanmanagerservices);
         this. = field;
         this. = field.slim();
         initType();
         this. = Proxies.isTypesProxyable(field.getTypeClosure(), .getServices());
         setProducer(new ProducerFieldProducer<X, T>(fielddisposalMethod) {
 
             @Override
             public AnnotatedField<? super X> getAnnotated() {
                 return ;
             }
 
             @Override
             public BeanManagerImpl getBeanManager() {
                 return ;
             }
 
             @Override
             public Bean<X> getDeclaringBean() {
                 return ProducerField.this.getDeclaringBean();
             }
 
             @Override
             public Bean<T> getBean() {
                 return ProducerField.this;
             }
         });
     }
 
     @Override
     public AnnotatedField<? super X> getAnnotated() {
         return ;
    }

    
Gets the annotated item representing the field

Returns:
The annotated item
    @Override
    public EnhancedAnnotatedField<T, ? super X> getEnhancedAnnotated() {
    }
    @Override
    public void cleanupAfterBoot() {
        this. = null;
    }
    @Override
    public boolean isSpecializing() {
        return false;
    }
    @Override
    public String toString() {
        return "Producer Field [" + Formats.formatType(getAnnotated().getBaseType()) + "] with qualifiers [" + Formats.formatAnnotations(getQualifiers()) + "] declared as [" + getAnnotated() + "]";
    }
    @Override
    public boolean isProxyable() {
        return ;
    }
    @Override
    public Set<AbstractBean<?, ?>> getSpecializedBeans() {
        throw new UnsupportedOperationException("Producer field may not specialize other beans " + this);
    }
New to GrepCode? Check out our FAQ X