本文整理汇总了Java中javax.xml.bind.annotation.XmlMimeType类的典型用法代码示例。如果您正苦于以下问题:Java XmlMimeType类的具体用法?Java XmlMimeType怎么用?Java XmlMimeType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlMimeType类属于javax.xml.bind.annotation包,在下文中一共展示了XmlMimeType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: calcExpectedMediaType
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
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;
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:Util.java
示例2: createSimple
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
@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;
}
开发者ID:openkm,项目名称:document-management-system,代码行数:17,代码来源:DocumentService.java
示例3: namespace
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
@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);
}
}
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:17,代码来源:EndpointBean.java
示例4: parameterAnnotation
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
@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);
}
}
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:21,代码来源:WrappedEndpointImpl.java
示例5: calcExpectedMediaType
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
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;
}
}
开发者ID:GeeQuery,项目名称:cxf-plus,代码行数:17,代码来源:Util.java
示例6: getJaxbAnnos
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
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;
}
开发者ID:GeeQuery,项目名称:cxf-plus,代码行数:18,代码来源:PlusWrapperClassGenerator.java
示例7: create
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
@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;
}
开发者ID:openkm,项目名称:document-management-system,代码行数:15,代码来源:DocumentService.java
示例8: getContent
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
@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;
}
开发者ID:openkm,项目名称:document-management-system,代码行数:14,代码来源:DocumentService.java
示例9: getContentByVersion
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
@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;
}
开发者ID:openkm,项目名称:document-management-system,代码行数:14,代码来源:DocumentService.java
示例10: checkin
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
@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;
}
开发者ID:openkm,项目名称:document-management-system,代码行数:14,代码来源:DocumentService.java
示例11: corrigirProvasAsyncRequest
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
public @WebResult(name = "protocoloCorrecaoProva") String corrigirProvasAsyncRequest(
@XmlMimeType("application/xml")
@WebParam(name="arquivoGabarito")
DataHandler arquivoGabarito,
@WebParam(name="paginasDigitalizadas")
List<PageImageVO> paginasDigitalizadas);
开发者ID:darciopacifico,项目名称:omr,代码行数:8,代码来源:IOmrGerenatorAsync.java
示例12: corrigirProvas
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
public List<QuestionResultVO> corrigirProvas(
@XmlMimeType("application/xml")
@WebParam(name="arquivoGabarito")
DataHandler arquivoGabarito,
@WebParam(name="paginasDigitalizadas")
List<PageImageVO> paginasDigitalizadas);
开发者ID:darciopacifico,项目名称:omr,代码行数:8,代码来源:IOmrGenerator.java
示例13: corrigirProvas
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
/**
*
*/
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 ;
}
开发者ID:darciopacifico,项目名称:omr,代码行数:30,代码来源:OmrGenerator.java
示例14: checkinInitiated
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
@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;
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:12,代码来源:ServiceInterface.java
示例15: PropertyInfoImpl
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
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);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:70,代码来源:PropertyInfoImpl.java
示例16: simulate
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
@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);
开发者ID:itesla,项目名称:ipst,代码行数:4,代码来源:SimulatorServer.java
示例17: getDataHandler
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
@XmlMimeType("text/plain")
public DataHandler getDataHandler() {
return dataHandler;
}
开发者ID:jbossws,项目名称:jaxws-undertow-httpspi,代码行数:5,代码来源:DHRequest.java
示例18: namespace
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
@XmlMimeType("text/plain")
public DataHandler namespace(@XmlMimeType("text/plain") DataHandler data);
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:3,代码来源:Endpoint.java
示例19: getImage
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
@XmlMimeType("*/*")
public DataHandler getImage()
{
return image;
}
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:6,代码来源:Photo.java
示例20: transferFile
import javax.xml.bind.annotation.XmlMimeType; //导入依赖的package包/类
@WebMethod
boolean transferFile(String fileName, @XmlMimeType("application/octet-stream") DataHandler contents);
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:3,代码来源:FileTransferService.java
注:本文中的javax.xml.bind.annotation.XmlMimeType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论