java类javax.xml.bind.annotation.XmlMimeType的实例源码

Util.java 文件源码 项目:OpenJSharp 阅读 17 收藏 0 点赞 0 评论 0
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;
    }
}
Util.java 文件源码 项目:openjdk-jdk10 阅读 17 收藏 0 点赞 0 评论 0
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;
    }
}
Util.java 文件源码 项目:openjdk9 阅读 22 收藏 0 点赞 0 评论 0
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;
    }
}
DocumentService.java 文件源码 项目:document-management-system 阅读 28 收藏 0 点赞 0 评论 0
@WebMethod
public Document createSimple(@WebParam(name = "token") String token, @WebParam(name = "docPath") String docPath,
                             @WebParam(name = "content") @XmlMimeType("application/octet-stream") DataHandler content) throws IOException,
        UnsupportedMimeTypeException, FileSizeExceededException, UserQuotaExceededException, VirusDetectedException,
        ItemExistsException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException, ExtensionException,
        AutomationException {
    log.debug("createSimple({})", docPath);
    DocumentModule dm = ModuleManager.getDocumentModule();
    InputStream bais = content.getInputStream();
    Document doc = new Document();
    doc.setPath(docPath);
    Document newDocument = dm.create(token, doc, bais);
    bais.close();
    log.debug("createSimple: {}", newDocument);
    return newDocument;
}
Util.java 文件源码 项目:lookaside_java-1.8.0-openjdk 阅读 18 收藏 0 点赞 0 评论 0
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;
    }
}
EndpointBean.java 文件源码 项目:jbossws-cxf 阅读 16 收藏 0 点赞 0 评论 0
@XmlMimeType("text/plain")
public DataHandler namespace(@XmlMimeType("text/plain") DataHandler data)
{
   try
   {
      String name = (String)getContent(data);
      String type = (String)data.getContentType();
      log.info("User " + name + " requested namespace with content type ["+ type +"]");

      return new DataHandler("Hello " + name, "text/plain");
   }
   catch (IOException e)
   {
      throw new WebServiceException(e);
   }
}
SOAP12EndpointBean.java 文件源码 项目:jbossws-cxf 阅读 16 收藏 0 点赞 0 评论 0
@XmlMimeType("text/plain")
public DataHandler namespace(@XmlMimeType("text/plain") DataHandler data)
{
   try
   {
      String name = (String)getContent(data);
      String type = (String)data.getContentType();
      log.info("User " + name + " requested namespace with content type ["+ type +"]");

      return new DataHandler("Hello " + name, "text/plain");
   }
   catch (IOException e)
   {
      throw new WebServiceException(e);
   }
}
SOAP11EndpointBean.java 文件源码 项目:jbossws-cxf 阅读 18 收藏 0 点赞 0 评论 0
@XmlMimeType("text/plain")
public DataHandler namespace(@XmlMimeType("text/plain") DataHandler data)
{
   try
   {
      String name = (String)getContent(data);
      String type = (String)data.getContentType();
      log.info("User " + name + " requested namespace with content type ["+ type +"]");

      return new DataHandler("Hello " + name, "text/plain");
   }
   catch (IOException e)
   {
      throw new WebServiceException(e);
   }
}
WrappedEndpointImpl.java 文件源码 项目:jbossws-cxf 阅读 29 收藏 0 点赞 0 评论 0
@WebMethod
@XmlMimeType("text/plain")
public DataHandler parameterAnnotation(@XmlMimeType("text/plain") DataHandler data)
{
   try
   {
      System.out.println("Recv " + data.getContentType());
      Object dataContent = data.getContent();
      System.out.println("Got " + dataContent);
      if ( dataContent instanceof InputStream )
      {
         ((InputStream)dataContent).close();
      }
      return new DataHandler("Server data", "text/plain");
   }
   catch (IOException e)
   {
      throw new WebServiceException(e);
   }
}
Util.java 文件源码 项目:infobip-open-jdk-8 阅读 25 收藏 0 点赞 0 评论 0
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;
    }
}
Util.java 文件源码 项目:cxf-plus 阅读 27 收藏 0 点赞 0 评论 0
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;
    }
}
PlusWrapperClassGenerator.java 文件源码 项目:cxf-plus 阅读 26 收藏 0 点赞 0 评论 0
private List<Annotation> getJaxbAnnos(MessagePartInfo mpi) {
    List<Annotation> list = new java.util.concurrent.CopyOnWriteArrayList<Annotation>();
    Annotation[] anns = getMethodParameterAnnotations(mpi);
    if (anns != null) {
        for (Annotation anno : anns) {
            if (anno.annotationType() == XmlList.class 
                || anno.annotationType() == XmlAttachmentRef.class
                || anno.annotationType() == XmlJavaTypeAdapter.class
                || anno.annotationType() == XmlMimeType.class
                || anno.annotationType() == XmlElement.class
                || anno.annotationType() == XmlElementWrapper.class) {
                list.add(anno);
            }
        }
    }
    return list;
}
Util.java 文件源码 项目:OLD-OpenJDK8 阅读 23 收藏 0 点赞 0 评论 0
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;
    }
}
Util.java 文件源码 项目:openjdk-icedtea7 阅读 21 收藏 0 点赞 0 评论 0
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;
    }
}
DocumentService.java 文件源码 项目:document-management-system 阅读 28 收藏 0 点赞 0 评论 0
@WebMethod
public Document create(@WebParam(name = "token") String token, @WebParam(name = "doc") Document doc,
                       @WebParam(name = "content") @XmlMimeType("application/octet-stream") DataHandler content) throws IOException,
        UnsupportedMimeTypeException, FileSizeExceededException, UserQuotaExceededException, VirusDetectedException,
        ItemExistsException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException, ExtensionException,
        AutomationException {
    log.debug("create({})", doc);
    DocumentModule dm = ModuleManager.getDocumentModule();
    InputStream bais = content.getInputStream();
    Document newDocument = dm.create(token, doc, bais);
    bais.close();
    log.debug("create: {}", newDocument);
    return newDocument;
}
DocumentService.java 文件源码 项目:document-management-system 阅读 23 收藏 0 点赞 0 评论 0
@WebMethod
public
@XmlMimeType("application/octet-stream")
DataHandler getContent(@WebParam(name = "token") String token, @WebParam(name = "docPath") String docPath,
                       @WebParam(name = "checkout") boolean checkout) throws RepositoryException, IOException, PathNotFoundException,
        AccessDeniedException, DatabaseException {
    log.debug("getContent({}, {}, {})", new Object[]{token, docPath, checkout});
    DocumentModule dm = ModuleManager.getDocumentModule();
    InputStream is = dm.getContent(token, docPath, checkout);
    DataHandler data = new DataHandler(new DhDatasource(is, null, docPath));
    log.debug("getContent: {}", data);
    return data;
}
DocumentService.java 文件源码 项目:document-management-system 阅读 28 收藏 0 点赞 0 评论 0
@WebMethod
public
@XmlMimeType("application/octet-stream")
DataHandler getContentByVersion(@WebParam(name = "token") String token, @WebParam(name = "docPath") String docPath,
                                @WebParam(name = "versionId") String versionId) throws RepositoryException, IOException, AccessDeniedException,
        PathNotFoundException, DatabaseException {
    log.debug("getContentByVersion({}, {}, {})", new Object[]{token, docPath, versionId});
    DocumentModule dm = ModuleManager.getDocumentModule();
    InputStream is = dm.getContentByVersion(token, docPath, versionId);
    DataHandler data = new DataHandler(new DhDatasource(is, null, docPath));
    log.debug("getContentByVersion: {}", data);
    return data;
}
DocumentService.java 文件源码 项目:document-management-system 阅读 36 收藏 0 点赞 0 评论 0
@WebMethod
public Version checkin(@WebParam(name = "token") String token, @WebParam(name = "docPath") String docPath,
                       @WebParam(name = "content") @XmlMimeType("application/octet-stream") DataHandler content,
                       @WebParam(name = "comment") String comment) throws FileSizeExceededException, UserQuotaExceededException,
        VirusDetectedException, LockException, VersionException, PathNotFoundException, AccessDeniedException, RepositoryException,
        IOException, DatabaseException, ExtensionException, AutomationException {
    log.debug("checkin({}, {} ,{})", new Object[]{token, docPath, comment});
    DocumentModule dm = ModuleManager.getDocumentModule();
    InputStream bais = content.getInputStream();
    Version version = dm.checkin(token, docPath, bais, comment);
    log.debug("checkin: {}", version);
    return version;
}
IOmrGerenatorAsync.java 文件源码 项目:omr 阅读 16 收藏 0 点赞 0 评论 0
public @WebResult(name = "protocoloCorrecaoProva") String corrigirProvasAsyncRequest(
@XmlMimeType("application/xml")
@WebParam(name="arquivoGabarito")
DataHandler arquivoGabarito, 

@WebParam(name="paginasDigitalizadas")
List<PageImageVO> paginasDigitalizadas);
IOmrGenerator.java 文件源码 项目:omr 阅读 18 收藏 0 点赞 0 评论 0
public List<QuestionResultVO> corrigirProvas(
@XmlMimeType("application/xml")
@WebParam(name="arquivoGabarito")
DataHandler arquivoGabarito, 

@WebParam(name="paginasDigitalizadas")
List<PageImageVO> paginasDigitalizadas);
OmrGenerator.java 文件源码 项目:omr 阅读 16 收藏 0 点赞 0 评论 0
/**
 * 
 */
public java.util.List<QuestionResultVO> corrigirProvas(
        @XmlMimeType("application/xml")
        @WebParam
        DataHandler arquivoGabarito,
        @WebParam(name="pageImages")
        List<PageImageVO> pageImages) {

    EventVO eventVO  = getEventoVO(arquivoGabarito);

    List<BufferedImage> images = new ArrayList<BufferedImage>(pageImages.size());

    for (PageImageVO pageImageVO2 : pageImages) {
        images.add(pageImageVO2.getPageImage());
    }


    List<QuestionResultVO> questionResults;
    try {
        questionResults = jazzOMRImageParser.parseImage(images, eventVO);
    } catch (JazzOMRException e) {
        throw new JazzOMRRuntimeException("Erro ao tentar processar as imagens enviadas! "+e.getMessage(),e);
    }

    return questionResults ;

}
ServiceInterface.java 文件源码 项目:BIMserver 阅读 18 收藏 0 点赞 0 评论 0
@WebMethod(action = "checkinInitiated")
Long checkinInitiated(
    @WebParam(name = "topicId", partName = "checkinInitiated.topicId") Long topicId,
    @WebParam(name = "poid", partName = "checkinInitiated.poid") Long poid,
    @WebParam(name = "comment", partName = "checkinInitiated.comment") String comment,
    @WebParam(name = "deserializerOid", partName = "checkinInitiated.deserializerOid") Long deserializerOid,
    @WebParam(name = "fileSize", partName = "checkinInitiated.fileSize") Long fileSize,
    @WebParam(name = "fileName", partName = "checkinInitiated.fileName") String fileName,
    @WebParam(name = "data", partName = "checkinInitiated.data") @XmlMimeType("application/octet-stream") DataHandler data,
    @WebParam(name = "merge", partName = "checkinInitiated.merge") Boolean merge,
    @WebParam(name = "sync", partName = "checkinInitiated.sync") Boolean sync) throws ServerException, UserException;
PropertyInfoImpl.java 文件源码 项目:OpenJSharp 阅读 23 收藏 0 点赞 0 评论 0
protected PropertyInfoImpl(ClassInfoImpl<T,C,F,M> parent, PropertySeed<T,C,F,M> spi) {
    this.seed = spi;
    this.parent = parent;

    if(parent==null)
        /*
            Various people reported a bug where this parameter is somehow null.
            In an attempt to catch the error better, let's do an explicit check here.

            http://forums.java.net/jive/thread.jspa?threadID=18479
            http://forums.java.net/jive/thread.jspa?messageID=165946
         */
        throw new AssertionError();

    MimeType mt = Util.calcExpectedMediaType(seed,parent.builder);
    if(mt!=null && !kind().canHaveXmlMimeType) {
        parent.builder.reportError(new IllegalAnnotationException(
            Messages.ILLEGAL_ANNOTATION.format(XmlMimeType.class.getName()),
            seed.readAnnotation(XmlMimeType.class)
        ));
        mt = null;
    }
    this.expectedMimeType = mt;
    this.inlineBinary = seed.hasAnnotation(XmlInlineBinaryData.class);

    T t = seed.getRawType();

    // check if there's an adapter applicable to the whole property
    XmlJavaTypeAdapter xjta = getApplicableAdapter(t);
    if(xjta!=null) {
        isCollection = false;
        adapter = new Adapter<T,C>(xjta,reader(),nav());
    } else {
        // check if the adapter is applicable to the individual item in the property

        this.isCollection = nav().isSubClassOf(t, nav().ref(Collection.class))
                         || nav().isArrayButNotByteArray(t);

        xjta = getApplicableAdapter(getIndividualType());
        if(xjta==null) {
            // ugly ugly hack, but we implement swaRef as adapter
            XmlAttachmentRef xsa = seed.readAnnotation(XmlAttachmentRef.class);
            if(xsa!=null) {
                parent.builder.hasSwaRef = true;
                adapter = new Adapter<T,C>(nav().asDecl(SwaRefAdapter.class),nav());
            } else {
                adapter = null;

                // if this field has adapter annotation but not applicable,
                // that must be an error of the user
                xjta = seed.readAnnotation(XmlJavaTypeAdapter.class);
                if(xjta!=null) {
                    T ad = reader().getClassValue(xjta,"value");
                    parent.builder.reportError(new IllegalAnnotationException(
                        Messages.UNMATCHABLE_ADAPTER.format(
                                nav().getTypeName(ad), nav().getTypeName(t)),
                        xjta
                    ));
                }
            }
        } else {
            adapter = new Adapter<T,C>(xjta,reader(),nav());
        }
    }

    this.id = calcId();
    this.schemaType = Util.calcSchemaType(reader(),seed,parent.clazz,
            getIndividualType(),this);
}
PropertyInfoImpl.java 文件源码 项目:openjdk-jdk10 阅读 22 收藏 0 点赞 0 评论 0
protected PropertyInfoImpl(ClassInfoImpl<T,C,F,M> parent, PropertySeed<T,C,F,M> spi) {
    this.seed = spi;
    this.parent = parent;

    if(parent==null)
        /*
            Various people reported a bug where this parameter is somehow null.
            In an attempt to catch the error better, let's do an explicit check here.

            http://forums.java.net/jive/thread.jspa?threadID=18479
            http://forums.java.net/jive/thread.jspa?messageID=165946
         */
        throw new AssertionError();

    MimeType mt = Util.calcExpectedMediaType(seed,parent.builder);
    if(mt!=null && !kind().canHaveXmlMimeType) {
        parent.builder.reportError(new IllegalAnnotationException(
            Messages.ILLEGAL_ANNOTATION.format(XmlMimeType.class.getName()),
            seed.readAnnotation(XmlMimeType.class)
        ));
        mt = null;
    }
    this.expectedMimeType = mt;
    this.inlineBinary = seed.hasAnnotation(XmlInlineBinaryData.class);

    T t = seed.getRawType();

    // check if there's an adapter applicable to the whole property
    XmlJavaTypeAdapter xjta = getApplicableAdapter(t);
    if(xjta!=null) {
        isCollection = false;
        adapter = new Adapter<T,C>(xjta,reader(),nav());
    } else {
        // check if the adapter is applicable to the individual item in the property

        this.isCollection = nav().isSubClassOf(t, nav().ref(Collection.class))
                         || nav().isArrayButNotByteArray(t);

        xjta = getApplicableAdapter(getIndividualType());
        if(xjta==null) {
            // ugly ugly hack, but we implement swaRef as adapter
            XmlAttachmentRef xsa = seed.readAnnotation(XmlAttachmentRef.class);
            if(xsa!=null) {
                parent.builder.hasSwaRef = true;
                adapter = new Adapter<T,C>(nav().asDecl(SwaRefAdapter.class),nav());
            } else {
                adapter = null;

                // if this field has adapter annotation but not applicable,
                // that must be an error of the user
                xjta = seed.readAnnotation(XmlJavaTypeAdapter.class);
                if(xjta!=null) {
                    T ad = reader().getClassValue(xjta,"value");
                    parent.builder.reportError(new IllegalAnnotationException(
                        Messages.UNMATCHABLE_ADAPTER.format(
                                nav().getTypeName(ad), nav().getTypeName(t)),
                        xjta
                    ));
                }
            }
        } else {
            adapter = new Adapter<T,C>(xjta,reader(),nav());
        }
    }

    this.id = calcId();
    this.schemaType = Util.calcSchemaType(reader(),seed,parent.clazz,
            getIndividualType(),this);
}
PropertyInfoImpl.java 文件源码 项目:openjdk9 阅读 18 收藏 0 点赞 0 评论 0
protected PropertyInfoImpl(ClassInfoImpl<T,C,F,M> parent, PropertySeed<T,C,F,M> spi) {
    this.seed = spi;
    this.parent = parent;

    if(parent==null)
        /*
            Various people reported a bug where this parameter is somehow null.
            In an attempt to catch the error better, let's do an explicit check here.

            http://forums.java.net/jive/thread.jspa?threadID=18479
            http://forums.java.net/jive/thread.jspa?messageID=165946
         */
        throw new AssertionError();

    MimeType mt = Util.calcExpectedMediaType(seed,parent.builder);
    if(mt!=null && !kind().canHaveXmlMimeType) {
        parent.builder.reportError(new IllegalAnnotationException(
            Messages.ILLEGAL_ANNOTATION.format(XmlMimeType.class.getName()),
            seed.readAnnotation(XmlMimeType.class)
        ));
        mt = null;
    }
    this.expectedMimeType = mt;
    this.inlineBinary = seed.hasAnnotation(XmlInlineBinaryData.class);

    T t = seed.getRawType();

    // check if there's an adapter applicable to the whole property
    XmlJavaTypeAdapter xjta = getApplicableAdapter(t);
    if(xjta!=null) {
        isCollection = false;
        adapter = new Adapter<T,C>(xjta,reader(),nav());
    } else {
        // check if the adapter is applicable to the individual item in the property

        this.isCollection = nav().isSubClassOf(t, nav().ref(Collection.class))
                         || nav().isArrayButNotByteArray(t);

        xjta = getApplicableAdapter(getIndividualType());
        if(xjta==null) {
            // ugly ugly hack, but we implement swaRef as adapter
            XmlAttachmentRef xsa = seed.readAnnotation(XmlAttachmentRef.class);
            if(xsa!=null) {
                parent.builder.hasSwaRef = true;
                adapter = new Adapter<T,C>(nav().asDecl(SwaRefAdapter.class),nav());
            } else {
                adapter = null;

                // if this field has adapter annotation but not applicable,
                // that must be an error of the user
                xjta = seed.readAnnotation(XmlJavaTypeAdapter.class);
                if(xjta!=null) {
                    T ad = reader().getClassValue(xjta,"value");
                    parent.builder.reportError(new IllegalAnnotationException(
                        Messages.UNMATCHABLE_ADAPTER.format(
                                nav().getTypeName(ad), nav().getTypeName(t)),
                        xjta
                    ));
                }
            }
        } else {
            adapter = new Adapter<T,C>(xjta,reader(),nav());
        }
    }

    this.id = calcId();
    this.schemaType = Util.calcSchemaType(reader(),seed,parent.clazz,
            getIndividualType(),this);
}
SimulatorServer.java 文件源码 项目:ipst 阅读 16 收藏 0 点赞 0 评论 0
@WebMethod
@XmlMimeType("application/octet-stream")
DataHandler simulate(String inputFileName, String problem, double startTime, double stopTime, int numberOfIntervals, double outputInterval, String method, double tolerance, double fixedstepsize, String resultsFileName, @XmlMimeType("application/octet-stream") DataHandler data);
PropertyInfoImpl.java 文件源码 项目:lookaside_java-1.8.0-openjdk 阅读 25 收藏 0 点赞 0 评论 0
protected PropertyInfoImpl(ClassInfoImpl<T,C,F,M> parent, PropertySeed<T,C,F,M> spi) {
    this.seed = spi;
    this.parent = parent;

    if(parent==null)
        /*
            Various people reported a bug where this parameter is somehow null.
            In an attempt to catch the error better, let's do an explicit check here.

            http://forums.java.net/jive/thread.jspa?threadID=18479
            http://forums.java.net/jive/thread.jspa?messageID=165946
         */
        throw new AssertionError();

    MimeType mt = Util.calcExpectedMediaType(seed,parent.builder);
    if(mt!=null && !kind().canHaveXmlMimeType) {
        parent.builder.reportError(new IllegalAnnotationException(
            Messages.ILLEGAL_ANNOTATION.format(XmlMimeType.class.getName()),
            seed.readAnnotation(XmlMimeType.class)
        ));
        mt = null;
    }
    this.expectedMimeType = mt;
    this.inlineBinary = seed.hasAnnotation(XmlInlineBinaryData.class);

    T t = seed.getRawType();

    // check if there's an adapter applicable to the whole property
    XmlJavaTypeAdapter xjta = getApplicableAdapter(t);
    if(xjta!=null) {
        isCollection = false;
        adapter = new Adapter<T,C>(xjta,reader(),nav());
    } else {
        // check if the adapter is applicable to the individual item in the property

        this.isCollection = nav().isSubClassOf(t, nav().ref(Collection.class))
                         || nav().isArrayButNotByteArray(t);

        xjta = getApplicableAdapter(getIndividualType());
        if(xjta==null) {
            // ugly ugly hack, but we implement swaRef as adapter
            XmlAttachmentRef xsa = seed.readAnnotation(XmlAttachmentRef.class);
            if(xsa!=null) {
                parent.builder.hasSwaRef = true;
                adapter = new Adapter<T,C>(nav().asDecl(SwaRefAdapter.class),nav());
            } else {
                adapter = null;

                // if this field has adapter annotation but not applicable,
                // that must be an error of the user
                xjta = seed.readAnnotation(XmlJavaTypeAdapter.class);
                if(xjta!=null) {
                    T ad = reader().getClassValue(xjta,"value");
                    parent.builder.reportError(new IllegalAnnotationException(
                        Messages.UNMATCHABLE_ADAPTER.format(
                                nav().getTypeName(ad), nav().getTypeName(t)),
                        xjta
                    ));
                }
            }
        } else {
            adapter = new Adapter<T,C>(xjta,reader(),nav());
        }
    }

    this.id = calcId();
    this.schemaType = Util.calcSchemaType(reader(),seed,parent.clazz,
            getIndividualType(),this);
}
DHRequest.java 文件源码 项目:jaxws-undertow-httpspi 阅读 21 收藏 0 点赞 0 评论 0
@XmlMimeType("text/plain")
public DataHandler getDataHandler() {
    return dataHandler;
}
DHResponse.java 文件源码 项目:jaxws-undertow-httpspi 阅读 15 收藏 0 点赞 0 评论 0
@XmlMimeType("text/plain")
public DataHandler getDataHandler() {
    return dataHandler;
}
Endpoint.java 文件源码 项目:jbossws-cxf 阅读 30 收藏 0 点赞 0 评论 0
@XmlMimeType("text/plain")
public DataHandler namespace(@XmlMimeType("text/plain") DataHandler data);


问题


面经


文章

微信
公众号

扫码关注公众号