当前位置: 首页>>代码示例>>Java>>正文


Java ActivationDataFlavor类代码示例

本文整理汇总了Java中javax.activation.ActivationDataFlavor的典型用法代码示例。如果您正苦于以下问题:Java ActivationDataFlavor类的具体用法?Java ActivationDataFlavor怎么用?Java ActivationDataFlavor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ActivationDataFlavor类属于javax.activation包,在下文中一共展示了ActivationDataFlavor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: marshal

import javax.activation.ActivationDataFlavor; //导入依赖的package包/类
@Override
public void marshal(final Object source, final HierarchicalStreamWriter writer, final MarshallingContext context) {
    final ActivationDataFlavor dataFlavor = ActivationDataFlavor.class.cast(source);
    final String mimeType = dataFlavor.getMimeType();
    if (mimeType != null) {
        writer.startNode("mimeType");
        writer.setValue(mimeType);
        writer.endNode();
    }
    final String name = dataFlavor.getHumanPresentableName();
    if (name != null) {
        writer.startNode("humanRepresentableName");
        writer.setValue(name);
        writer.endNode();
    }
    final Class<?> representationClass = dataFlavor.getRepresentationClass();
    if (representationClass != null) {
        writer.startNode("representationClass");
        context.convertAnother(representationClass);
        writer.endNode();
    }
}
 
开发者ID:x-stream,项目名称:xstream,代码行数:23,代码来源:ActivationDataFlavorConverter.java

示例2: ImageDataContentHandler

import javax.activation.ActivationDataFlavor; //导入依赖的package包/类
public ImageDataContentHandler() {
    String[] mimeTypes = ImageIO.getReaderMIMETypes();
    flavor = new DataFlavor[mimeTypes.length];
    for(int i=0; i < mimeTypes.length; i++) {
        flavor[i] = new ActivationDataFlavor(Image.class, mimeTypes[i], "Image");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:ImageDataContentHandler.java

示例3: getDataFlavors

import javax.activation.ActivationDataFlavor; //导入依赖的package包/类
@Override
@Nonnull
@ReturnsMutableObject ("design")
protected ActivationDataFlavor [] getDataFlavors ()
{
  return FLAVORS;
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:8,代码来源:DataContentHandlerSoap12.java

示例4: getData

import javax.activation.ActivationDataFlavor; //导入依赖的package包/类
@Override
@Nonnull
protected Object getData (@Nonnull final ActivationDataFlavor aFlavor,
                          @Nonnull final DataSource ds) throws IOException
{
  if (aFlavor.getRepresentationClass () == StreamSource.class)
    return new StreamSource (ds.getInputStream ());
  throw new IOException ("Unsupported flavor " + aFlavor + " on DS " + ds);
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:10,代码来源:DataContentHandlerSoap12.java

示例5: getTransferDataFlavors

import javax.activation.ActivationDataFlavor; //导入依赖的package包/类
public DataFlavor[] getTransferDataFlavors() {
	return new DataFlavor[] {
			new ActivationDataFlavor(InputStream.class, "application/octet-stream", "SFRM Data Stream"),
			new ActivationDataFlavor(FileRegionDataSource.class, "application/octet-stream", "SFRM Data Stream"),
			new ActivationDataFlavor(EmptyDataSource.class, "application/octet-stream", "SFRM Data Stream"),
			new ActivationDataFlavor(String.class, "application/octet-stream", "SFRM Data Stream")};
}
 
开发者ID:cecid,项目名称:hermes,代码行数:8,代码来源:SFRMDataContentHandler.java

示例6: testMimeTypeOnly

import javax.activation.ActivationDataFlavor; //导入依赖的package包/类
public void testMimeTypeOnly() {
    final String expected = ""
        + "<activation-data-flavor>\n"
        + "  <mimeType>application/x-junit</mimeType>\n"
        + "  <representationClass>java.io.InputStream</representationClass>\n"
        + "</activation-data-flavor>";
    assertBothWays(new ActivationDataFlavor("application/x-junit", null), expected);
}
 
开发者ID:x-stream,项目名称:xstream,代码行数:9,代码来源:ActivationDataFlavorConverterTest.java

示例7: testMimeTypeAndRepresentation

import javax.activation.ActivationDataFlavor; //导入依赖的package包/类
public void testMimeTypeAndRepresentation() {
    final String expected = ""
        + "<activation-data-flavor>\n"
        + "  <mimeType>application/x-junit</mimeType>\n"
        + "  <humanRepresentableName>JUnit</humanRepresentableName>\n"
        + "  <representationClass>java.io.InputStream</representationClass>\n"
        + "</activation-data-flavor>";
    assertBothWays(new ActivationDataFlavor("application/x-junit", "JUnit"), expected);
}
 
开发者ID:x-stream,项目名称:xstream,代码行数:10,代码来源:ActivationDataFlavorConverterTest.java

示例8: testWithAllArguments

import javax.activation.ActivationDataFlavor; //导入依赖的package包/类
public void testWithAllArguments() {
    final String expected = ""
        + "<activation-data-flavor>\n"
        + "  <mimeType>application/x-junit</mimeType>\n"
        + "  <humanRepresentableName>JUnit</humanRepresentableName>\n"
        + "  <representationClass>com.thoughtworks.xstream.converters.extended.ActivationDataFlavorConverterTest</representationClass>\n"
        + "</activation-data-flavor>";
    assertBothWays(new ActivationDataFlavor(ActivationDataFlavorConverterTest.class, "application/x-junit", "JUnit"), expected);
}
 
开发者ID:x-stream,项目名称:xstream,代码行数:10,代码来源:ActivationDataFlavorConverterTest.java

示例9: PKCS7ContentHandler

import javax.activation.ActivationDataFlavor; //导入依赖的package包/类
PKCS7ContentHandler(
    ActivationDataFlavor adf,
    DataFlavor[]         dfs)
{
    _adf = adf;
    _dfs = dfs;
}
 
开发者ID:credentials,项目名称:irma_future_id,代码行数:8,代码来源:PKCS7ContentHandler.java

示例10: XmlDataContentHandler

import javax.activation.ActivationDataFlavor; //导入依赖的package包/类
public XmlDataContentHandler() throws ClassNotFoundException {
    flavors = new DataFlavor[3];
    flavors[0] = new ActivationDataFlavor(StreamSource.class, "text/xml", "XML");
    flavors[1] = new ActivationDataFlavor(StreamSource.class, "application/xml", "XML");
    flavors[2] = new ActivationDataFlavor(String.class, "text/xml", "XML String");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:XmlDataContentHandler.java

示例11: getDF

import javax.activation.ActivationDataFlavor; //导入依赖的package包/类
protected ActivationDataFlavor getDF() {
    return myDF;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:StringDataContentHandler.java

示例12: ListItemTransferHandler

import javax.activation.ActivationDataFlavor; //导入依赖的package包/类
public ListItemTransferHandler() {
    localObjectFlavor = new ActivationDataFlavor(
            Object[].class, DataFlavor.javaJVMLocalObjectMimeType, "Array of items");
}
 
开发者ID:danielhuson,项目名称:megan-ce,代码行数:5,代码来源:CompareWindow.java

示例13: ListItemTransferHandler

import javax.activation.ActivationDataFlavor; //导入依赖的package包/类
/**
 * Constructs a new handler.
 */
public ListItemTransferHandler() {
	
	super();
	localObjectFlavor = new ActivationDataFlavor(Object[].class, DataFlavor.javaJVMLocalObjectMimeType, "Array of items");
}
 
开发者ID:petebrew,项目名称:fhaes,代码行数:9,代码来源:CustomizeDialog.java

示例14: ListItemTransferHandler

import javax.activation.ActivationDataFlavor; //导入依赖的package包/类
public ListItemTransferHandler(ResortListener resortListener) {
    this.resortListener = resortListener;
    localObjectFlavor = new ActivationDataFlavor(Object[].class, DataFlavor.javaJVMLocalObjectMimeType, "Array of items");
}
 
开发者ID:sk89q,项目名称:quest-pages,代码行数:5,代码来源:ListItemTransferHandler.java

示例15: canConvert

import javax.activation.ActivationDataFlavor; //导入依赖的package包/类
@Override
public boolean canConvert(final Class<?> type) {
    return type == ActivationDataFlavor.class;
}
 
开发者ID:x-stream,项目名称:xstream,代码行数:5,代码来源:ActivationDataFlavorConverter.java


注:本文中的javax.activation.ActivationDataFlavor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。