Package javax.xml.bind.annotation

Examples of javax.xml.bind.annotation.XmlMimeType


    // XXX respect the type from the XmlElement annotation

    XmlElement element = accessor.getAnnotation(XmlElement.class);
    boolean xmlList = (accessor.getAnnotation(XmlList.class) != null);

    XmlMimeType xmlMimeType = accessor.getAnnotation(XmlMimeType.class);
    String mimeType = null;
   
    if (xmlMimeType != null)
      mimeType = xmlMimeType.value();

    _property = _context.createProperty(accessor.getGenericType(), false,
                                        mimeType, xmlList);

    if (element != null) {
View Full Code Here


      }

      out.writeAttribute("type", typeName);
      out.writeAttribute("name", _qname.getLocalPart());

      XmlMimeType xmlMimeType = _accessor.getAnnotation(XmlMimeType.class);

      if (xmlMimeType != null) {
        out.writeAttribute(XML_MIME_NS, "expectedContentTypes",
                           xmlMimeType.value());
      }
    }
  }
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;
                                        if (!this.hasSwaRef) {
                                            this.hasSwaRef = true;
                                        }
View Full Code Here

                declaration.setJavaType(helper.getJavaClass(declJavaType));
                declaration.setAdaptedJavaType(type);
            }
            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);
            }
            HashMap<QName, ElementDeclaration> elements = getElementDeclarationsForScope(scopeClass.getName());
View Full Code Here

    super(context, accessor);

    // XXX
    _qname = new QName(accessor.getName());

    XmlMimeType xmlMimeType = accessor.getAnnotation(XmlMimeType.class);
    String mimeType = null;
   
    if (xmlMimeType != null)
      mimeType = xmlMimeType.value();

    _property = _context.createProperty(accessor.getGenericType(), false,
                                        mimeType, true, true);

    if (! _property.isXmlPrimitiveType() &&
View Full Code Here

    if (namespace == null)
      _qname = new QName(name);
    else
      _qname = new QName(namespace, name);

    XmlMimeType xmlMimeType = accessor.getAnnotation(XmlMimeType.class);
    String mimeType = null;
   
    if (xmlMimeType != null)
      mimeType = xmlMimeType.value();

    // XXX XmlList value?
    _property =
      _context.createProperty(accessor.getGenericType(), false, mimeType, true);
View Full Code Here

            }

            // Scan for XOP field annotations
            else if(field.isAnnotationPresent(XmlMimeType.class))
            {
               XmlMimeType mimeTypeDecl = field.getAnnotation(XmlMimeType.class);
               result = new AttachmentScanResult(mimeTypeDecl.value(), AttachmentScanResult.Type.XOP);
            }

            if(null == result) // try getter methods
            {
               result = scanGetterAnnotation(xmlRoot, field);
View Full Code Here

         {
            result = new AttachmentScanResult("application/octet-stream", AttachmentScanResult.Type.SWA_REF);
         }
         else if (method.isAnnotationPresent(XmlMimeType.class))
         {
            XmlMimeType mimeTypeDecl = method.getAnnotation(XmlMimeType.class);
            result = new AttachmentScanResult(mimeTypeDecl.value(), AttachmentScanResult.Type.XOP);
         }

         if(result!=null)
         {
            result.setIndex(-1); // default for return values
            results.add(result);
         }

      }

      // method parameter
      int index = 0;
      for (Annotation[] parameterAnnotations : method.getParameterAnnotations())
      {
         if (parameterAnnotations!=null)
         {
            for (Annotation annotation : parameterAnnotations)
            {
               AttachmentScanResult paramResult = null;

               if(XmlAttachmentRef.class == annotation.annotationType())
               {
                  paramResult = new AttachmentScanResult("application/octet-stream", AttachmentScanResult.Type.SWA_REF);
               }
               else if(XmlMimeType.class == annotation.annotationType())
               {
                  XmlMimeType mimeTypeDecl = ((XmlMimeType)annotation);
                  paramResult = new AttachmentScanResult(mimeTypeDecl.value(), AttachmentScanResult.Type.XOP);
               }

               if(paramResult!=null)
               {
                  paramResult.setIndex(index);                 
View Full Code Here

      {
         if(method.getName().equalsIgnoreCase(getterMethodName))
         {
            if(method.isAnnotationPresent(XmlMimeType.class))
            {
               XmlMimeType mimeTypeDecl = method.getAnnotation(XmlMimeType.class);
               return new AttachmentScanResult(mimeTypeDecl.value(), AttachmentScanResult.Type.XOP);
            }
            else if(method.isAnnotationPresent(XmlAttachmentRef.class))
            {
               return new AttachmentScanResult("application/octet-stream", AttachmentScanResult.Type.SWA_REF);
            }
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.