Package javax.xml.bind.annotation

Examples of javax.xml.bind.annotation.XmlMimeType


                    if (annotations != null) {
                        for (int j = 0; j < annotations.length; j++) {
                            java.lang.annotation.Annotation nextAnnotation = annotations[j];
                            if (nextAnnotation != null) {
                                if (nextAnnotation instanceof XmlMimeType) {
                                    XmlMimeType javaAnnotation = (XmlMimeType) nextAnnotation;
                                    xmlMimeType = javaAnnotation.value();
                                } else if (nextAnnotation instanceof XmlAttachmentRef) {
                                    xmlAttachmentRef = true;
                                    if (!this.hasSwaRef) {
                                        this.hasSwaRef = true;
                                    }
View Full Code Here


                        }
                        if (annotations != null) {
                            for (Annotation nextAnnotation : annotations) {
                                if (nextAnnotation != null) {
                                    if (nextAnnotation instanceof XmlMimeType) {
                                        XmlMimeType javaAnnotation = (XmlMimeType) nextAnnotation;
                                        xmlMimeType = javaAnnotation.value();
                                    } else if (nextAnnotation instanceof XmlAttachmentRef) {
                                        xmlAttachmentRef = true;
                                        if (!this.hasSwaRef) {
                                            this.hasSwaRef = true;
                                        }
View Full Code Here

                declaration.setJavaType(adaptedType);
                declaration.setAdaptedJavaType(type);
                returnType = adaptedType;
            }
            if (helper.isAnnotationPresent(next, XmlMimeType.class)) {
                XmlMimeType mimeType = (XmlMimeType)helper.getAnnotation(next, XmlMimeType.class);
                declaration.setXmlMimeType(mimeType.value());
            }
            if (helper.isAnnotationPresent(next, XmlAttachmentRef.class)) {
                declaration.setXmlAttachmentRef(true);
            }
            Map<QName, ElementDeclaration> elements = getElementDeclarationsForScope(scopeClass.getName());
View Full Code Here

                    if (annotations != null) {
                        for (int j = 0; j < annotations.length; j++) {
                            java.lang.annotation.Annotation nextAnnotation = annotations[j];
                            if (nextAnnotation != null) {
                                if (nextAnnotation instanceof XmlMimeType) {
                                    XmlMimeType javaAnnotation = (XmlMimeType) nextAnnotation;
                                    xmlMimeType = javaAnnotation.value();
                                } else if (nextAnnotation instanceof XmlAttachmentRef) {
                                    xmlAttachmentRef = true;
                                    if (!this.hasSwaRef) {
                                        this.hasSwaRef = true;
                                    }
View Full Code Here

                    if (annotations != null) {
                        for (int j = 0; j < annotations.length; j++) {
                            java.lang.annotation.Annotation nextAnnotation = annotations[j];
                            if (nextAnnotation != null) {
                                if (nextAnnotation instanceof XmlMimeType) {
                                    XmlMimeType javaAnnotation = (XmlMimeType) nextAnnotation;
                                    xmlMimeType = javaAnnotation.value();
                                } else if (nextAnnotation instanceof XmlAttachmentRef) {
                                    xmlAttachmentRef = true;
                                }
                            }
                        }
View Full Code Here

                    if (annotations != null) {
                        for (int j = 0; j < annotations.length; j++) {
                            java.lang.annotation.Annotation nextAnnotation = annotations[j];
                            if (nextAnnotation != null) {
                                if (nextAnnotation instanceof XmlMimeType) {
                                    XmlMimeType javaAnnotation = (XmlMimeType) nextAnnotation;
                                    xmlMimeType = javaAnnotation.value();
                                } else if (nextAnnotation instanceof XmlAttachmentRef) {
                                    xmlAttachmentRef = true;
                                }
                            }
                        }
View Full Code Here

/*     */       {
/*  94 */         result = new AttachmentScanResult("application/octet-stream", AttachmentScanResult.Type.SWA_REF);
/*     */       }
/*  98 */       else if (field.isAnnotationPresent(XmlMimeType.class))
/*     */       {
/* 100 */         XmlMimeType mimeTypeDecl = (XmlMimeType)field.getAnnotation(XmlMimeType.class);
/* 101 */         result = new AttachmentScanResult(mimeTypeDecl.value(), AttachmentScanResult.Type.XOP);
/*     */       }
/*     */
/* 104 */       if (null == result)
/*     */       {
/* 106 */         result = scanGetterAnnotation(xmlRoot, field);
View Full Code Here

/*     */       {
/* 136 */         result = new AttachmentScanResult("application/octet-stream", AttachmentScanResult.Type.SWA_REF);
/*     */       }
/* 138 */       else if (method.isAnnotationPresent(XmlMimeType.class))
/*     */       {
/* 140 */         XmlMimeType mimeTypeDecl = (XmlMimeType)method.getAnnotation(XmlMimeType.class);
/* 141 */         result = new AttachmentScanResult(mimeTypeDecl.value(), AttachmentScanResult.Type.XOP);
/*     */       }
/*     */
/* 144 */       if (result != null)
/*     */       {
/* 146 */         result.setIndex(-1);
/* 147 */         results.add(result);
/*     */       }
/*     */
/*     */     }
/*     */
/* 153 */     int index = 0;
/* 154 */     for (Annotation[] parameterAnnotations : method.getParameterAnnotations())
/*     */     {
/* 156 */       if (parameterAnnotations != null)
/*     */       {
/* 158 */         for (Annotation annotation : parameterAnnotations)
/*     */         {
/* 160 */           AttachmentScanResult paramResult = null;
/*     */
/* 162 */           if (XmlAttachmentRef.class == annotation.annotationType())
/*     */           {
/* 164 */             paramResult = new AttachmentScanResult("application/octet-stream", AttachmentScanResult.Type.SWA_REF);
/*     */           }
/* 166 */           else if (XmlMimeType.class == annotation.annotationType())
/*     */           {
/* 168 */             XmlMimeType mimeTypeDecl = (XmlMimeType)method.getAnnotation(XmlMimeType.class);
/* 169 */             paramResult = new AttachmentScanResult(mimeTypeDecl.value(), AttachmentScanResult.Type.XOP);
/*     */           }
/*     */
/* 172 */           if (paramResult == null)
/*     */             continue;
/* 174 */           paramResult.setIndex(index);
View Full Code Here

/*     */     {
/* 241 */       if (!method.getName().equalsIgnoreCase(getterMethodName))
/*     */         continue;
/* 243 */       if (method.isAnnotationPresent(XmlMimeType.class))
/*     */       {
/* 245 */         XmlMimeType mimeTypeDecl = (XmlMimeType)method.getAnnotation(XmlMimeType.class);
/* 246 */         return new AttachmentScanResult(mimeTypeDecl.value(), AttachmentScanResult.Type.XOP);
/*     */       }
/* 248 */       if (method.isAnnotationPresent(XmlAttachmentRef.class))
/*     */       {
/* 250 */         return new AttachmentScanResult("application/octet-stream", AttachmentScanResult.Type.SWA_REF);
/*     */       }
View Full Code Here

/*  86 */     return null;
/*     */   }
/*     */
/*     */   static MimeType calcExpectedMediaType(AnnotationSource primarySource, ModelBuilder builder)
/*     */   {
/*  91 */     XmlMimeType xmt = (XmlMimeType)primarySource.readAnnotation(XmlMimeType.class);
/*  92 */     if (xmt == null)
/*  93 */       return null;
/*     */     try
/*     */     {
/*  96 */       return new MimeType(xmt.value());
/*     */     } catch (MimeTypeParseException e) {
/*  98 */       builder.reportError(new IllegalAnnotationException(Messages.ILLEGAL_MIME_TYPE.format(new Object[] { xmt.value(), e.getMessage() }), xmt));
/*     */     }
/*     */
/* 102 */     return null;
/*     */   }
View Full Code Here

TOP

Related Classes of javax.xml.bind.annotation.XmlMimeType

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.