Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2013, 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 static org.jboss.weld.serialization.spi.BeanIdentifier.BEAN_ID_SEPARATOR;
 
 
 
 public class BeanIdentifiers {
 
     private BeanIdentifiers() {
     }
 
     public static final String PREFIX = "WELD" + ;
 
     private static StringBuilder getPrefix(Class<?> beanType) {
         return new StringBuilder().append(beanType.getSimpleName()).append();
     }
 
     public static String forManagedBean(EnhancedAnnotatedType<?> type) {
         return forManagedBean(type.slim().getIdentifier());
     }
 
     public static String forManagedBean(AnnotatedTypeIdentifier identifier) {
         return getPrefix(ManagedBean.class).append(identifier.asString()).toString();
     }
 
     public static String forDecorator(EnhancedAnnotatedType<?> type) {
         return getPrefix(DecoratorImpl.class).append(type.slim().getIdentifier().asString()).toString();
     }
 
     public static String forInterceptor(EnhancedAnnotatedType<?> type) {
         return getPrefix(InterceptorImpl.class).append(type.slim().getIdentifier().asString()).toString();
     }
 
     public static String forNewManagedBean(EnhancedAnnotatedType<?> type) {
         return getPrefix(NewManagedBean.class).append(type.slim().getIdentifier().asString()).toString();
     }
 
     public static String forSessionBean(EnhancedAnnotatedType<?> typeEjbDescriptor<?> descriptor) {
         StringBuilder builder = getPrefix(SessionBean.class);
         appendEjbNameAndClass(builderdescriptor);
         if (!type.isDiscovered()) {
             builder.append().append(type.slim().getIdentifier().asString());
         }
         return builder.toString();
     }
 
     public static String forNewSessionBean(EjbDescriptor<?> descriptor) {
         StringBuilder builder = getPrefix(NewSessionBean.class);
         return appendEjbNameAndClass(builderdescriptor).toString();
     }
 
     private static StringBuilder appendEjbNameAndClass(StringBuilder builderEjbDescriptor<?> descriptor) {
         return builder.append(descriptor.getEjbName()).append().append(descriptor.getBeanClass().getName());
     }
 
     public static String forProducerField(EnhancedAnnotatedField<?, ?> fieldAbstractClassBean<?> declaringBean) {
         StringBuilder sb = getPrefix(ProducerField.class).append(declaringBean.getAnnotated().getIdentifier().asString())
                 .append();
         if (declaringBean.getEnhancedAnnotated().isDiscovered()) {
             sb.append(field.getName());
         } else {
             sb.append(AnnotatedTypes.createFieldId(field));
         }
         return sb.toString();
     }
 
     public static String forProducerMethod(EnhancedAnnotatedMethod<?, ?> methodAbstractClassBean<?> declaringBean) {
         if (declaringBean.getEnhancedAnnotated().isDiscovered()) {
             return forProducerMethod(declaringBean.getAnnotated().getIdentifier(), DeclaredMemberIndexer.getIndexForMethod(method.getJavaMember()));
         }
         return getPrefix(ProducerMethod.class).append(method.getDeclaringType().slim().getIdentifier()).append(AnnotatedTypes.createCallableId(method)).toString();
     }
    public static String forProducerMethod(AnnotatedTypeIdentifier identifierint memberIndex) {
        return getPrefix(ProducerMethod.class).append(identifier.asString()).append().append(memberIndex).toString();
    }
    public static String forSyntheticBean(BeanAttributes<?> attributesClass<?> beanClass) {
        return getPrefix(AbstractSyntheticBean.class).append(beanClass.getName()).append()
                .append(Beans.createBeanAttributesId(attributes)).toString();
    }
    public static String forBuiltInBean(BeanManagerImpl managerClass<?> typeString suffix) {
        if (suffix != null) {
            builder.append().append(suffix);
        }
        return builder.toString();
    }
    public static String forExtension(EnhancedAnnotatedType<?> type) {
        return getPrefix(Extension.class).append(type.slim().getIdentifier().asString()).toString();
    }
New to GrepCode? Check out our FAQ X