类javax.xml.bind.annotation.XmlMimeType源码实例Demo

下面列出了怎么用javax.xml.bind.annotation.XmlMimeType的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: TencentKona-8   文件: Util.java
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;
    }
}
 
源代码2 项目: jdk8u60   文件: Util.java
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;
    }
}
 
源代码3 项目: openjdk-jdk8u   文件: Util.java
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;
    }
}
 
源代码4 项目: openjdk-jdk8u-backup   文件: Util.java
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;
    }
}
 
源代码5 项目: openjdk-jdk9   文件: Util.java
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;
    }
}
 
源代码6 项目: hottub   文件: Util.java
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;
    }
}
 
源代码7 项目: openjdk-8-source   文件: Util.java
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;
    }
}
 
源代码8 项目: openjdk-8   文件: Util.java
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;
    }
}
 
@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;
}
 
源代码10 项目: cxf   文件: WrapperUtil.java
public static List<Annotation> getJaxbAnnotations(Method method) {
    List<Annotation> jaxbAnnotation = new ArrayList<>();
    Annotation ann = method.getAnnotation(XmlAttachmentRef.class);
    if (ann != null) {
        jaxbAnnotation.add(ann);
    }
    ann = method.getAnnotation(XmlMimeType.class);
    if (ann != null) {
        jaxbAnnotation.add(ann);
    }
    ann = method.getAnnotation(XmlJavaTypeAdapter.class);
    if (ann != null) {
        jaxbAnnotation.add(ann);
    }
    ann = method.getAnnotation(XmlList.class);
    if (ann != null) {
        jaxbAnnotation.add(ann);
    }
    return jaxbAnnotation;
}
 
源代码11 项目: cxf   文件: WrapperUtil.java
public static List<Annotation> getJaxbAnnotations(Method method, int idx) {
    List<Annotation> jaxbAnnotation = new ArrayList<>();
    Annotation[][] anns = method.getParameterAnnotations();
    for (int i = 0; i < method.getParameterTypes().length; i++) {
        if (i == idx) {
            for (Annotation ann : anns[i]) {
                if (ann.annotationType() == XmlAttachmentRef.class
                    || ann.annotationType() == XmlMimeType.class
                    || ann.annotationType() == XmlJavaTypeAdapter.class
                    || ann.annotationType() == XmlList.class
                    || ann.annotationType() == XmlElement.class) {
                    jaxbAnnotation.add(ann);
                }
            }
        }
    }
    return jaxbAnnotation;
}
 
源代码12 项目: cxf   文件: WrapperClassGenerator.java
private List<Annotation> getJaxbAnnos(MessagePartInfo mpi) {
    List<Annotation> list = new java.util.concurrent.CopyOnWriteArrayList<>();
    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;
}
 
@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;
}
 
@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;
}
 
@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;
}
 
@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;
}
 
源代码17 项目: cxf   文件: ReflectionServiceFactoryBean.java
private void addMimeType(final XmlSchemaElement element, final Annotation[] annotations) {
    if (annotations != null) {
        for (Annotation annotation : annotations) {
            if (annotation instanceof XmlMimeType) {
                MimeAttribute attr = new MimeAttribute();
                attr.setValue(((XmlMimeType)annotation).value());
                element.addMetaInfo(MimeAttribute.MIME_QNAME, attr);
            }
        }
    }
}
 
源代码18 项目: BIMserver   文件: ServiceInterface.java
@WebMethod(action = "checkinAsync")
Long checkinAsync(
	@WebParam(name = "poid", partName = "checkin.poid") Long poid,
	@WebParam(name = "comment", partName = "checkin.comment") String comment,
	@WebParam(name = "deserializerOid", partName = "checkin.deserializerOid") Long deserializerOid,
	@WebParam(name = "fileSize", partName = "checkin.fileSize") Long fileSize,
	@WebParam(name = "fileName", partName = "checkin.fileName") String fileName,
	@WebParam(name = "data", partName = "checkin.data") @XmlMimeType("application/octet-stream") DataHandler data,
	@WebParam(name = "merge", partName = "checkin.merge") Boolean merge) throws ServerException, UserException;
 
源代码19 项目: BIMserver   文件: ServiceInterface.java
@WebMethod(action = "checkinInitiatedSync")
SLongCheckinActionState checkinInitiatedSync(
	@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) throws ServerException, UserException;
 
源代码20 项目: BIMserver   文件: ServiceInterface.java
@WebMethod(action = "checkinInitiatedAsync")
Long checkinInitiatedAsync(
	@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) throws ServerException, UserException;
 
源代码21 项目: fido2   文件: SKCEReturnObject.java
public @XmlMimeType("application/octet-stream")
DataHandler getOutDataHandler() {
    return outDataHandler;
}
 
源代码22 项目: TencentKona-8   文件: PropertyInfoImpl.java
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);
}
 
源代码23 项目: jdk8u60   文件: PropertyInfoImpl.java
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);
}
 
源代码24 项目: openjdk-jdk8u   文件: PropertyInfoImpl.java
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);
}
 
源代码25 项目: openjdk-jdk8u-backup   文件: PropertyInfoImpl.java
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);
}
 
源代码26 项目: openjdk-jdk9   文件: PropertyInfoImpl.java
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);
}
 
源代码27 项目: hottub   文件: PropertyInfoImpl.java
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);
}
 
源代码28 项目: openjdk-8-source   文件: PropertyInfoImpl.java
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);
}
 
源代码29 项目: ipst   文件: SimulatorServer.java
@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);
 
源代码30 项目: openjdk-8   文件: PropertyInfoImpl.java
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);
}
 
 类方法
 同包方法