|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.scijava.ui.dnd.MIMEType
public class MIMEType
A Multipurpose Internet Mail Extension (MIME) type, as defined in RFC 2045 and 2046.
This class is similar to e.g. java.awt.datatransfer.MimeType and
org.apache.pivot.util.MIMEType. We reinvent the wheel here since
there is no public MIME type class in core Java excluding AWT, which we could
use cross-environment in e.g. Android.
| Constructor Summary | |
|---|---|
MIMEType(String mimeType)
Constructs a new MIME type object from the given MIME type string. |
|
MIMEType(String mimeType,
Class<?> javaType)
Constructs a new MIME type object from the given MIME type string. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
String |
getBase()
Gets the MIME type with no parameter list. |
String |
getParameter(String name)
Gets the value of the parameter with the given name, or null if none. |
List<String> |
getParameters()
Gets the parameter names associated with this MIME type. |
int |
hashCode()
|
boolean |
isCompatible(Class<?> javaType)
Gets whether this MIME type represents objects of the given Java class. |
boolean |
isCompatible(MIMEType mimeType)
Gets whether this MIME type is compatible with the given one. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MIMEType(String mimeType)
mimeType - The MIME type string, which may optionally include a list
of semicolon-separated parameters.
public MIMEType(String mimeType,
Class<?> javaType)
mimeType - The MIME type string, which may optionally include a list
of semicolon-separated parameters.javaType - The associated Java class of the MIME type. If non-null, a
"class" parameter is guaranteed to exist with the MIME type
indicating compatibility with the given Java class.
IllegalArgumentException - if the mimeType includes a
different Java class parameter than the javaType.| Method Detail |
|---|
public String getBase()
public String getParameter(String name)
public List<String> getParameters()
public boolean isCompatible(MIMEType mimeType)
public boolean isCompatible(Class<?> javaType)
public int hashCode()
hashCode in class Objectpublic boolean equals(Object o)
equals in class Objectpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||