|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.document.Format
public abstract class Format
Used to gain information about the format that a given document class supports.
Field Summary | |
---|---|
protected static ProductInformation.Artifact |
BASE_FORMAT_VERSION
The format version artifact of this abstract base format. |
protected static int |
DEFAULT_PRIORITY
|
protected static int |
MAX_PRIORITY
|
protected static int |
MIN_PRIORITY
|
Constructor Summary | |
---|---|
protected |
Format()
Default-constructor. |
Method Summary | |
---|---|
boolean |
canRead()
Return whether this Format can be read, i.e. |
boolean |
canWrite()
Return whether this Format can be written, i.e. |
Format |
create(MimeType type)
Create an instance of this format corresponding to the given MIME type. |
FormatReader |
createReader()
Instantiate a new FormatReader for this format. |
FormatWriter |
createWriter()
Instantiate a new FormatWriter for this format. |
boolean |
equals(Object obj)
The default equality implementation for formats is based on class equality. |
abstract String[] |
getDefaultExtensions()
The default file-extension for the format. |
abstract String |
getDescription()
Describes the format represented by this instance. |
abstract MimeType |
getMimeType()
Return the string-encoded MIME-Type of the format. |
abstract String |
getName()
Return the format's name. |
int |
getPriority()
Return the priority with which this format will be selected, if there are multiple eligible ones. |
abstract String |
getVersion()
The version of the format support. |
int |
hashCode()
The default hash-code implementation for formats is based on the class hash-code. |
boolean |
isSecondary()
Return whether this format is a secondary format. |
boolean |
isSupported(MimeType type)
Determine whether this format supports the given MIME type. |
abstract boolean |
matches(SeekableInputStream stream)
Within the read process this method is called to auto-determine the format of the data passed. |
String |
toString()
A String-representation of this Format |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final ProductInformation.Artifact BASE_FORMAT_VERSION
protected static final int MIN_PRIORITY
protected static final int MAX_PRIORITY
protected static final int DEFAULT_PRIORITY
Constructor Detail |
---|
protected Format()
Method Detail |
---|
public String toString()
toString
in class Object
public abstract String[] getDefaultExtensions()
public abstract String getDescription()
public abstract String getName()
public abstract String getVersion()
public abstract MimeType getMimeType()
public abstract boolean matches(SeekableInputStream stream) throws IOException
stream
- contains the data to be tested.
IOException
- if an io error occurspublic int getPriority()
MIN_PRIORITY
,
DEFAULT_PRIORITY
,
MAX_PRIORITY
public boolean canRead()
createReader()
is able to create
a reader.
true
if we can.public FormatReader createReader()
FormatReader
for this format.
FormatReader
for this format
UnsupportedOperationException
- if this format does not support readingpublic boolean canWrite()
createWriter()
is able to
create a writer.
true
if we can.public FormatWriter createWriter()
FormatWriter
for this format.
FormatWriter
for this format
UnsupportedOperationException
- if this format does not support writingpublic boolean isSecondary()
true
if this format is a secondary formatpublic int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public boolean isSupported(MimeType type)
type
-
public Format create(MimeType type)
type
-
IllegalArgumentException
- if the given type is not supported by this format.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |