|
CubeTwister 2.0alpha142 2012-02-11 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.randelshofer.gui.datatransfer.MimeType
public class MimeType
A Multipurpose Internet Mail Extension (MIME) type, as defined in RFC 2045 and 2046.
Implementation taken from java.awt.datatransfer.MimeType 1.20 01/12/03
| Constructor Summary | |
|---|---|
MimeType()
Constructor for externalization; this constructor should not be called directly by an application, since the result will be an uninitialized, immutable MimeType object. |
|
MimeType(java.lang.String rawdata)
Builds a MimeType from a String. |
|
MimeType(java.lang.String primary,
java.lang.String sub)
Builds a MimeType with the given primary and sub
type but has an empty parameter list. |
|
MimeType(java.lang.String primary,
java.lang.String sub,
ch.randelshofer.gui.datatransfer.MimeTypeParameterList mtpl)
Builds a MimeType with a pre-defined
and valid (or empty) parameter list. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Returns a clone of this object. |
boolean |
equals(java.lang.Object thatObject)
MimeTypes are equal if their primary types,
subtypes, and parameters are all equal. |
java.lang.String |
getBaseType()
Return a String representation of this object without the parameter list. |
java.lang.String |
getParameter(java.lang.String name)
Retrieve the value associated with the given name, or null if there is no current association. |
ch.randelshofer.gui.datatransfer.MimeTypeParameterList |
getParameters()
Retrieve a copy of this object's parameter list. |
java.lang.String |
getPrimaryType()
Retrieve the primary type of this object. |
java.lang.String |
getSubType()
Retrieve the sub type of this object. |
int |
hashCode()
|
boolean |
match(MimeType type)
Returns true if the primary type and the
subtype of this object are the same as the specified
type; otherwise returns false. |
boolean |
match(java.lang.String rawdata)
Returns true if the primary type and the
subtype of this object are the same as the content type
described in rawdata; otherwise returns
false. |
void |
readExternal(java.io.ObjectInput in)
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. |
void |
removeParameter(java.lang.String name)
Remove any value associated with the given name. |
void |
setParameter(java.lang.String name,
java.lang.String value)
Set the value to be associated with the given name, replacing any previous association. |
java.lang.String |
toString()
Return the String representation of this object. |
void |
writeExternal(java.io.ObjectOutput out)
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings and arrays. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MimeType()
MimeType object.
public MimeType(java.lang.String rawdata)
throws MimeTypeParseException
MimeType from a String.
rawdata - text used to initialize the MimeType
MimeTypeParseException
public MimeType(java.lang.String primary,
java.lang.String sub)
throws MimeTypeParseException
MimeType with the given primary and sub
type but has an empty parameter list.
primary - the primary type of this MimeTypesub - the subtype of this MimeType
MimeTypeParseException
public MimeType(java.lang.String primary,
java.lang.String sub,
ch.randelshofer.gui.datatransfer.MimeTypeParameterList mtpl)
throws MimeTypeParseException
MimeType with a pre-defined
and valid (or empty) parameter list.
primary - the primary type of this MimeTypesub - the subtype of this MimeTypemtpl - the requested parameter list
MimeTypeParseException| Method Detail |
|---|
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object thatObject)
MimeTypes are equal if their primary types,
subtypes, and parameters are all equal. No default values
are taken into account.
equals in class java.lang.ObjectthatObject - the object to be evaluated as a
MimeType
true if thatObject is
a MimeType; otherwise returns falsepublic java.lang.String getPrimaryType()
public java.lang.String getSubType()
public ch.randelshofer.gui.datatransfer.MimeTypeParameterList getParameters()
public java.lang.String getParameter(java.lang.String name)
public void setParameter(java.lang.String name,
java.lang.String value)
java.lang.IllegalArgumentException - if parameter or value is illegalpublic void removeParameter(java.lang.String name)
IllegalArgumentExcpetion - if parameter may not be deletedpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getBaseType()
public boolean match(MimeType type)
true if the primary type and the
subtype of this object are the same as the specified
type; otherwise returns false.
type - the type to compare to this's type
true if the primary type and the
subtype of this object are the same as the
specified type; otherwise returns
false
public boolean match(java.lang.String rawdata)
throws MimeTypeParseException
true if the primary type and the
subtype of this object are the same as the content type
described in rawdata; otherwise returns
false.
rawdata - the raw data to be examined
true if the primary type and the
subtype of this object are the same as the content type
described in rawdata; otherwise returns
false; if rawdata is
null, returns false
MimeTypeParseException
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOException - Includes any I/O exceptions that may occur
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.lang.ClassNotFoundException - If the class for an object being
restored cannot be found.
java.io.IOExceptionpublic java.lang.Object clone()
clone in class java.lang.Object
|
(c) Werner Randelshofer. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||