Java 8 UnsupportedFlavorException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 UnsupportedFlavorException class.

This code example shows how to use the following methods:
         
        if (this.imageFlavor.equals(flavor)) {
            return this.chart.createBufferedImage(width, height);
        } 
        else { 
            throw new UnsupportedFlavorException(flavor);
        } 
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:
    } 
 
    @Override 
    public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
        if(!isDataFlavorSupported(flavor)) {
            throw new UnsupportedFlavorException(flavor);
        } 
        if(data != null) {
            ObjectInput ois = null;
            try { 
                ois = new ObjectInputStream(new ByteArrayInputStream(data));
                JMeterTreeNode[] nodes = (JMeterTreeNode[]) ois.readObject();
                return nodes;
            } catch (ClassNotFoundException cnfe) {
                throw new IOException("Failed to read object stream.", cnfe);
            } finally { 
                if(ois != null) {
                    try { 
                        ois.close();
                    } catch (Exception e) {
5
CodeRank
This code example shows how to use the following methods:
	@Override 
	public EquipmentFacade[] getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
	{ 
		if (!isDataFlavorSupported(flavor))
		{ 
			throw new UnsupportedFlavorException(flavor);
		} 
		return equipment;
	} 
 
} 
4
CodeRank
This code example shows how to use the following methods:
        public Object getTransferData(DataFlavor df)
                throws UnsupportedFlavorException, IOException {
            if (isDataFlavorSupported(df))
                return object; 
            else 
                throw new UnsupportedFlavorException(df);
        } 
 
        public boolean isDataFlavorSupported(DataFlavor df) {
            return (df.equals(localObjectFlavor));
        } 
 
        public DataFlavor[] getTransferDataFlavors() {
            return supportedFlavors;
        } 
    } 
 
} 
4
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
	} 
 
	public Object getTransferData(DataFlavor f)
			throws UnsupportedFlavorException, IOException {
		if(f.equals(DataFlavor.imageFlavor)==false)
			throw new UnsupportedFlavorException(f);
		return img;
	} 
 
	public DataFlavor[] getTransferDataFlavors() {
		return new DataFlavor[] {DataFlavor.imageFlavor};
	} 
 
	public boolean isDataFlavorSupported(DataFlavor flavor) {
		return(flavor.equals(DataFlavor.imageFlavor));
	} 
	 
} 
4
CodeRank
This code example shows how to use the following methods:
      String name = getOrganism().getCommonName();
      if(name == null || name.equals(""))
        name = getOrganism().getGenus() + "." + getOrganism().getSpecies();
      return name+":featureId="+getFeatureId();
    } 
    else throw new UnsupportedFlavorException(d);
  } 
 
  public String getFeatureId()
  { 
    return featureId;
  } 
   
  public String getFeatureType()
  { 
    return featureType;
  } 
 
  protected void setDbDoc(DatabaseDocument dbDoc)
  { 
4
CodeRank
This code example shows how to use the following methods:
			return htmlContent;
		} 
		if (flavor.equals(MindMapNodesSelection.mindMapNodeObjectsFlavor)) {
			return nodes;
		} 
		throw new UnsupportedFlavorException(flavor);
	} 
 
	public DataFlavor[] getTransferDataFlavors() {
		return new DataFlavor[] { DataFlavor.stringFlavor, MindMapNodesSelection.mindMapNodesFlavor,
		        MindMapNodesSelection.rtfFlavor, MindMapNodesSelection.htmlFlavor,
		        MindMapNodesSelection.dropActionFlavor, MindMapNodesSelection.mindMapNodeObjectsFlavor };
	} 
 
	public boolean isDataFlavorSupported(final DataFlavor flavor) {
		if (flavor.equals(DataFlavor.stringFlavor) && stringContent != null) {
			return true; 
		} 
		if (flavor.equals(MindMapNodesSelection.mindMapNodesFlavor) && nodesContent != null) {
			return true; 
4
CodeRank
This code example shows how to use the following methods:
        } 
 
        @Override 
        public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
            if (!flavor.equals(layerFlavor)) {
                throw new UnsupportedFlavorException(flavor);
            } 
            return layerContainer;
        } 
 
    } 
 
    private static class LayerContainer { 
 
        private final Layer draggedLayer;
        private final Layer oldParentLayer;
        private final int oldChildIndex;
 
        private LayerContainer(Layer draggedLayer, Layer oldParentLayer, int oldChildIndex) {
 
5
CodeRank
This code example shows how to use the following methods:
		 
		if(flavor.equals(TRACK_FLAVOR)){
			return this.track;
		} 
		 
		throw new UnsupportedFlavorException(flavor);
	} 
	 
	public DataFlavor[] getTransferDataFlavors(){
		return new DataFlavor[]{DataFlavor.stringFlavor, TRACK_FLAVOR};
	} 
	 
	public boolean isDataFlavorSupported(DataFlavor flavor){
		return flavor.equals(TRACK_FLAVOR) || flavor.equals(DataFlavor.stringFlavor);
	} 
} 
5
CodeRank
See Code Examples for Java 8 UnsupportedFlavorException Methods: