Package org.jboss.metadata.javaee.spec

Examples of org.jboss.metadata.javaee.spec.DescriptionGroupMetaData


/* 61 */       metaData.setEjbName(annotation.name());
/*    */     else
/* 63 */       metaData.setEjbName(beanClass.getSimpleName());
/* 64 */     if (annotation.description().length() > 0)
/*    */     {
/* 66 */       DescriptionGroupMetaData dg = ProcessorUtils.getDescriptionGroup(annotation.description());
/* 67 */       metaData.setDescriptionGroup(dg);
/*    */     }
/* 69 */     if (annotation.mappedName().length() > 0)
/* 70 */       metaData.setMappedName(annotation.mappedName());
/* 71 */     if (annotation.messageListenerInterface() != Object.class)
View Full Code Here


/* 311 */       name = getName(element);
/* 312 */     ref.setServiceRefName(name);
/* 313 */     if (annotation.mappedName().length() > 0)
/* 314 */       ref.setMappedName(annotation.mappedName());
/* 315 */     ref.setAnnotatedElement(element);
/* 316 */     DescriptionGroupMetaData dg = ProcessorUtils.getDescriptionGroup(annotation.description());
/* 317 */     if (dg != null)
/* 318 */       ref.setDescriptionGroup(dg);
/* 319 */     if (annotation.type() != Object.class)
/* 320 */       ref.setServiceRefType(annotation.type().getName());
/*     */     else
View Full Code Here

/*  80 */     bean.setEjbName(ejbName);
/*  81 */     if ((mappedName != null) && (mappedName.length() > 0))
/*  82 */       bean.setMappedName(mappedName);
/*  83 */     if ((description != null) && (description.length() > 0))
/*     */     {
/*  85 */       DescriptionGroupMetaData descriptionGroup = new DescriptionGroupMetaData();
/*  86 */       DescriptionsImpl descriptions = new DescriptionsImpl();
/*  87 */       DescriptionImpl descriptionImpl = new DescriptionImpl();
/*  88 */       descriptionImpl.setDescription(description);
/*  89 */       descriptions.add(descriptionImpl);
/*  90 */       descriptionGroup.setDescriptions(descriptions);
/*  91 */       bean.setDescriptionGroup(descriptionGroup);
/*     */     }
/*     */
/*  94 */     TransactionManagement txMgmt = (TransactionManagement)this.finder.getAnnotation(beanClass, TransactionManagement.class);
/*  95 */     TransactionManagementType txType = TransactionManagementType.CONTAINER;
View Full Code Here

/*     */     }
/* 131 */     return descriptions;
/*     */   }
/*     */
/*     */   public static DescriptionGroupMetaData getDescriptionGroup(String description) {
/* 135 */     DescriptionGroupMetaData dg = null;
/* 136 */     if (description.length() > 0)
/*     */     {
/* 138 */       dg = new DescriptionGroupMetaData();
/* 139 */       Descriptions descriptions = getDescription(description);
/* 140 */       dg.setDescriptions(descriptions);
/*     */     }
/* 142 */     return dg;
/*     */   }
View Full Code Here

/*    */   private static final long serialVersionUID = 1L;
/*    */
/*    */   public String getDisplayName()
/*    */   {
/* 59 */     String name = null;
/* 60 */     DescriptionGroupMetaData group = getDescriptionGroup();
/* 61 */     if (group != null)
/*    */     {
/* 63 */       name = group.getDisplayName();
/*    */     }
/* 65 */     return name;
/*    */   }
View Full Code Here

/*    */     }
/* 65 */     return name;
/*    */   }
/*    */
/*    */   public void setDisplayName(String name) {
/* 69 */     DescriptionGroupMetaData group = getDescriptionGroup();
/* 70 */     if (group == null)
/* 71 */       group = new DescriptionGroupMetaData();
/* 72 */     DisplayNameImpl dn = new DisplayNameImpl();
/* 73 */     dn.setDisplayName(name);
/* 74 */     DisplayNamesImpl names = new DisplayNamesImpl();
/* 75 */     names.add(dn);
/* 76 */     group.setDisplayNames(names);
/* 77 */     setDescriptionGroup(group);
/*    */   }
View Full Code Here

/*    */   }
/*    */
/*    */   public String getDescription()
/*    */   {
/* 82 */     String desc = null;
/* 83 */     DescriptionGroupMetaData group = getDescriptionGroup();
/* 84 */     if (group != null)
/*    */     {
/* 86 */       desc = group.getDescription();
/*    */     }
/* 88 */     return desc;
/*    */   }
View Full Code Here

/*    */     }
/* 88 */     return desc;
/*    */   }
/*    */
/*    */   public void setDescription(String desc) {
/* 92 */     DescriptionGroupMetaData group = getDescriptionGroup();
/* 93 */     if (group == null)
/* 94 */       group = new DescriptionGroupMetaData();
/* 95 */     DescriptionsImpl descriptions = new DescriptionsImpl();
/* 96 */     DescriptionImpl di = new DescriptionImpl();
/* 97 */     di.setDescription(desc);
/* 98 */     descriptions.add(di);
/* 99 */     group.setDescriptions(descriptions);
/*    */   }
View Full Code Here

            paramValue.setParamValue(webInitParam.value());
            initParams.add(paramValue);
         }
         filter.setInitParam(initParams);
      }
      DescriptionGroupMetaData descriptionGroup =
         ProcessorUtils.getDescriptionGroup(webFilter.description(), webFilter.displayName(),
            webFilter.smallIcon(), webFilter.largeIcon());
      if (descriptionGroup != null)
         filter.setDescriptionGroup(descriptionGroup);
      filters.add(filter);
View Full Code Here

                }
                AnnotationValue descriptionValue = annotation.value("description");
                AnnotationValue displayNameValue = annotation.value("displayName");
                AnnotationValue smallIconValue = annotation.value("smallIcon");
                AnnotationValue largeIconValue = annotation.value("largeIcon");
                DescriptionGroupMetaData descriptionGroup =
                    getDescriptionGroup((descriptionValue == null) ? "" : descriptionValue.asString(),
                            (displayNameValue == null) ? "" : displayNameValue.asString(),
                            (smallIconValue == null) ? "" : smallIconValue.asString(),
                            (largeIconValue == null) ? "" : largeIconValue.asString());
                if (descriptionGroup != null) {
                    servlet.setDescriptionGroup(descriptionGroup);
                }
                ServletMappingMetaData servletMapping = new ServletMappingMetaData();
                servletMapping.setServletName(servlet.getName());
                List<String> urlPatterns = new ArrayList<String>();
                AnnotationValue urlPatternsValue = annotation.value("urlPatterns");
                if (urlPatternsValue != null) {
                    for (String urlPattern : urlPatternsValue.asStringArray()) {
                        urlPatterns.add(urlPattern);
                    }
                }
                urlPatternsValue = annotation.value();
                if (urlPatternsValue != null) {
                    for (String urlPattern : urlPatternsValue.asStringArray()) {
                        urlPatterns.add(urlPattern);
                    }
                }
                if (urlPatterns.size() > 0) {
                    servletMapping.setUrlPatterns(urlPatterns);
                    servletMappings.add(servletMapping);
                }
                servlets.add(servlet);
            }
            metaData.setServlets(servlets);
            metaData.setServletMappings(servletMappings);
        }
        // @WebFilter
        final List<AnnotationInstance> webFilterAnnotations = index.getAnnotations(webFilter);
        if (webFilterAnnotations != null && webFilterAnnotations.size() > 0) {
            FiltersMetaData filters = new FiltersMetaData();
            List<FilterMappingMetaData> filterMappings = new ArrayList<FilterMappingMetaData>();
            for (final AnnotationInstance annotation : webFilterAnnotations) {
                FilterMetaData filter = new FilterMetaData();
                AnnotationTarget target = annotation.target();
                if (!(target instanceof ClassInfo)) {
                    throw new DeploymentUnitProcessingException("@WebFilter is only allowed at class level " + target);
                }
                ClassInfo classInfo = ClassInfo.class.cast(target);
                filter.setFilterClass(classInfo.toString());
                AnnotationValue nameValue = annotation.value("filterName");
                if (nameValue == null || nameValue.asString().isEmpty()) {
                    filter.setName(classInfo.toString());
                } else {
                    filter.setName(nameValue.asString());
                }
                AnnotationValue asyncSupported = annotation.value("asyncSupported");
                if (asyncSupported != null) {
                    filter.setAsyncSupported(asyncSupported.asBoolean());
                }
                AnnotationValue initParamsValue = annotation.value("initParams");
                if (initParamsValue != null) {
                    AnnotationInstance[] initParamsAnnotations = initParamsValue.asNestedArray();
                    if (initParamsAnnotations != null && initParamsAnnotations.length > 0) {
                        List<ParamValueMetaData> initParams = new ArrayList<ParamValueMetaData>();
                        for (AnnotationInstance initParamsAnnotation : initParamsAnnotations) {
                            ParamValueMetaData initParam = new ParamValueMetaData();
                            AnnotationValue initParamName = initParamsAnnotation.value("name");
                            AnnotationValue initParamValue = initParamsAnnotation.value();
                            if (initParamName == null || initParamValue == null) {
                                throw new DeploymentUnitProcessingException("@WebInitParam requires name and value on " + target);
                            }
                            AnnotationValue initParamDescription = initParamsAnnotation.value("description");
                            initParam.setParamName(initParamName.asString());
                            initParam.setParamValue(initParamValue.asString());
                            if (initParamDescription != null) {
                                Descriptions descriptions = getDescription(initParamDescription.asString());
                                if (descriptions != null) {
                                    initParam.setDescriptions(descriptions);
                                }
                            }
                            initParams.add(initParam);
                        }
                        filter.setInitParam(initParams);
                    }
                }
                AnnotationValue descriptionValue = annotation.value("description");
                AnnotationValue displayNameValue = annotation.value("displayName");
                AnnotationValue smallIconValue = annotation.value("smallIcon");
                AnnotationValue largeIconValue = annotation.value("largeIcon");
                DescriptionGroupMetaData descriptionGroup =
                    getDescriptionGroup((descriptionValue == null) ? "" : descriptionValue.asString(),
                            (displayNameValue == null) ? "" : displayNameValue.asString(),
                            (smallIconValue == null) ? "" : smallIconValue.asString(),
                            (largeIconValue == null) ? "" : largeIconValue.asString());
                if (descriptionGroup != null) {
                    filter.setDescriptionGroup(descriptionGroup);
                }
                filters.add(filter);
                FilterMappingMetaData filterMapping = new FilterMappingMetaData();
                filterMapping.setFilterName(filter.getName());
                List<String> urlPatterns = new ArrayList<String>();
                List<String> servletNames = new ArrayList<String>();
                List<DispatcherType> dispatchers = new ArrayList<DispatcherType>();
                AnnotationValue urlPatternsValue = annotation.value("urlPatterns");
                if (urlPatternsValue != null) {
                    for (String urlPattern : urlPatternsValue.asStringArray()) {
                        urlPatterns.add(urlPattern);
                    }
                }
                urlPatternsValue = annotation.value();
                if (urlPatternsValue != null) {
                    for (String urlPattern : urlPatternsValue.asStringArray()) {
                        urlPatterns.add(urlPattern);
                    }
                }
                if (urlPatterns.size() > 0) {
                    filterMapping.setUrlPatterns(urlPatterns);
                }
                AnnotationValue servletNamesValue = annotation.value("servletNames");
                if (servletNamesValue != null) {
                    for (String servletName : servletNamesValue.asStringArray()) {
                        servletNames.add(servletName);
                    }
                }
                if (servletNames.size() > 0) {
                    filterMapping.setServletNames(servletNames);
                }
                AnnotationValue dispatcherTypesValue = annotation.value("dispatcherTypes");
                if (dispatcherTypesValue != null) {
                    for (String dispatcherValue : dispatcherTypesValue.asEnumArray()) {
                        dispatchers.add(DispatcherType.valueOf(dispatcherValue));
                    }
                }
                if (dispatchers.size() > 0) {
                    filterMapping.setDispatchers(dispatchers);
                }
                if (urlPatterns.size() > 0 || servletNames.size() > 0) {
                    filterMappings.add(filterMapping);
                }
            }
            metaData.setFilters(filters);
            metaData.setFilterMappings(filterMappings);
        }
        // @WebListener
        final List<AnnotationInstance> webListenerAnnotations = index.getAnnotations(webListener);
        if (webListenerAnnotations != null && webListenerAnnotations.size() > 0) {
            List<ListenerMetaData> listeners = new ArrayList<ListenerMetaData>();
            for (final AnnotationInstance annotation : webListenerAnnotations) {
                ListenerMetaData listener = new ListenerMetaData();
                AnnotationTarget target = annotation.target();
                if (!(target instanceof ClassInfo)) {
                    throw new DeploymentUnitProcessingException("@Weblistener is only allowed at class level " + target);
                }
                ClassInfo classInfo = ClassInfo.class.cast(target);
                listener.setListenerClass(classInfo.toString());
                AnnotationValue descriptionValue = annotation.value();
                if (descriptionValue != null) {
                    DescriptionGroupMetaData descriptionGroup = getDescriptionGroup(descriptionValue.asString());
                    if (descriptionGroup != null) {
                        listener.setDescriptionGroup(descriptionGroup);
                    }
                }
                listeners.add(listener);
View Full Code Here

TOP

Related Classes of org.jboss.metadata.javaee.spec.DescriptionGroupMetaData

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.