Java 类javax.activation.ActivationDataFlavor 实例源码

项目:xstream    文件:ActivationDataFlavorConverter.java   
@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();
    }
}
项目:OpenJSharp    文件:ImageDataContentHandler.java   
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");
    }
}
项目:openjdk-jdk10    文件:ImageDataContentHandler.java   
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");
    }
}
项目:openjdk9    文件:ImageDataContentHandler.java   
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");
    }
}
项目:ph-as4    文件:DataContentHandlerSoap12.java   
@Override
@Nonnull
@ReturnsMutableObject ("design")
protected ActivationDataFlavor [] getDataFlavors ()
{
  return FLAVORS;
}
项目:ph-as4    文件:DataContentHandlerSoap12.java   
@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);
}
项目:hermes    文件:SFRMDataContentHandler.java   
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")};
}
项目:lookaside_java-1.8.0-openjdk    文件:ImageDataContentHandler.java   
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");
    }
}
项目:xstream    文件:ActivationDataFlavorConverterTest.java   
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);
}
项目:xstream    文件:ActivationDataFlavorConverterTest.java   
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);
}
项目:xstream    文件:ActivationDataFlavorConverterTest.java   
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);
}
项目:infobip-open-jdk-8    文件:ImageDataContentHandler.java   
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");
    }
}
项目:OLD-OpenJDK8    文件:ImageDataContentHandler.java   
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");
    }
}
项目:openjdk-icedtea7    文件:ImageDataContentHandler.java   
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");
    }
}
项目:irma_future_id    文件:PKCS7ContentHandler.java   
PKCS7ContentHandler(
    ActivationDataFlavor adf,
    DataFlavor[]         dfs)
{
    _adf = adf;
    _dfs = dfs;
}
项目:bc-java    文件:PKCS7ContentHandler.java   
PKCS7ContentHandler(
    ActivationDataFlavor adf,
    DataFlavor[]         dfs)
{
    _adf = adf;
    _dfs = dfs;
}
项目:OpenJSharp    文件:XmlDataContentHandler.java   
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");
}
项目:OpenJSharp    文件:StringDataContentHandler.java   
protected ActivationDataFlavor getDF() {
    return myDF;
}
项目:openjdk-jdk10    文件:XmlDataContentHandler.java   
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");
}
项目:openjdk-jdk10    文件:StringDataContentHandler.java   
protected ActivationDataFlavor getDF() {
    return myDF;
}
项目:openjdk9    文件:XmlDataContentHandler.java   
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");
}
项目:openjdk9    文件:StringDataContentHandler.java   
protected ActivationDataFlavor getDF() {
    return myDF;
}
项目:megan-ce    文件:CompareWindow.java   
public ListItemTransferHandler() {
    localObjectFlavor = new ActivationDataFlavor(
            Object[].class, DataFlavor.javaJVMLocalObjectMimeType, "Array of items");
}
项目:lookaside_java-1.8.0-openjdk    文件:XmlDataContentHandler.java   
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");
}
项目:lookaside_java-1.8.0-openjdk    文件:StringDataContentHandler.java   
protected ActivationDataFlavor getDF() {
    return myDF;
}
项目:fhaes    文件:CustomizeDialog.java   
/**
 * Constructs a new handler.
 */
public ListItemTransferHandler() {

    super();
    localObjectFlavor = new ActivationDataFlavor(Object[].class, DataFlavor.javaJVMLocalObjectMimeType, "Array of items");
}
项目:quest-pages    文件:ListItemTransferHandler.java   
public ListItemTransferHandler(ResortListener resortListener) {
    this.resortListener = resortListener;
    localObjectFlavor = new ActivationDataFlavor(Object[].class, DataFlavor.javaJVMLocalObjectMimeType, "Array of items");
}
项目:xstream    文件:ActivationDataFlavorConverter.java   
@Override
public boolean canConvert(final Class<?> type) {
    return type == ActivationDataFlavor.class;
}
项目:infobip-open-jdk-8    文件:XmlDataContentHandler.java   
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");
}
项目:infobip-open-jdk-8    文件:StringDataContentHandler.java   
protected ActivationDataFlavor getDF() {
    return myDF;
}
项目:OLD-OpenJDK8    文件:XmlDataContentHandler.java   
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");
}
项目:OLD-OpenJDK8    文件:StringDataContentHandler.java   
protected ActivationDataFlavor getDF() {
    return myDF;
}
项目:PhotMan    文件:PhotManListItemTransferHandler.java   
/**
 * Class constructor.
 */
public PhotManListItemTransferHandler() {
    m_localObjectFlavor = new ActivationDataFlavor(
            Object[].class,DataFlavor.javaJVMLocalObjectMimeType,"Array of items");
}
项目:openjdk-icedtea7    文件:XmlDataContentHandler.java   
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");
}
项目:openjdk-icedtea7    文件:StringDataContentHandler.java   
protected ActivationDataFlavor getDF() {
    return myDF;
}