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 (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(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);
            }
            HashMap<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

        return null;
    }

    static MimeType calcExpectedMediaType(AnnotationSource primarySource,
                        ModelBuilder builder ) {
        XmlMimeType xmt = primarySource.readAnnotation(XmlMimeType.class);
        if(xmt==null)
            return null;

        try {
            return new MimeType(xmt.value());
        } catch (MimeTypeParseException e) {
            builder.reportError(new IllegalAnnotationException(
                Messages.ILLEGAL_MIME_TYPE.format(xmt.value(),e.getMessage()),
                xmt
            ));
            return null;
        }
    }
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

    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

    // 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

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.