DocumentFormatBase
Leave feedback
On this page
Inheritance: java.lang.Object, com.groupdocs.editor.formats.abstraction.FormatFamilyBase
All Implemented Interfaces: com.groupdocs.editor.formats.abstraction.IDocumentFormat
public abstract class DocumentFormatBase extends FormatFamilyBase implements IDocumentFormat
Represents the base class for document formats, providing common functionality for format instances.
| Method | Description |
|---|---|
| getMime() | Gets the MIME type of the document format. |
| getExtension() | Gets the file extension of the document format. |
| getFormatFamily() | Gets the format family to which the document format belongs. |
| Retrieves an instance of the specified type | |
| T | |
| that has the specified MIME type. | |
| hashCode() | Returns a hash code for the current object. |
| equals(IDocumentFormat other) | Determines whether this instance is equal to the specified IDocumentFormat instance. |
| equals(Object obj) | Determines whether this instance is equal to the specified DocumentFormatBase instance. |
| toString(DocumentFormatBase extension) | Converts a DocumentFormatBase instance to a string implicitly. |
public final String getMime()
Gets the MIME type of the document format.
Returns: java.lang.String
public final String getExtension()
Gets the file extension of the document format.
Returns: java.lang.String
public final FormatFamilies getFormatFamily()
Gets the format family to which the document format belongs.
Returns: FormatFamilies
public static T <T>fromMime(Class<T> clazz, String mime)
Retrieves an instance of the specified type T that has the specified MIME type.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| clazz | java.lang.Class |
|
| mime | java.lang.String | The MIME type of the document format. |
- T
- The type of document format. |
Returns: T - An instance of the specified type T with the specified MIME type.
public int hashCode()
Returns a hash code for the current object.
Returns: int - A hash code for the current object, combining the hash codes of the base object, MIME type, file extension, and format family.
public final boolean equals(IDocumentFormat other)
Determines whether this instance is equal to the specified IDocumentFormat instance.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IDocumentFormat | The IDocumentFormat instance to compare with the current instance. |
Returns: boolean - true if the specified IDocumentFormat is equal to the current instance; otherwise, false .
public boolean equals(Object obj)
Determines whether this instance is equal to the specified DocumentFormatBase instance.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| obj | java.lang.Object | The DocumentFormatBase instance to compare with the current instance. |
Returns: boolean - true if the specified DocumentFormatBase is equal to the current instance; otherwise, false .
public static String toString(DocumentFormatBase extension)
Converts a DocumentFormatBase instance to a string implicitly.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| extension | DocumentFormatBase | The DocumentFormatBase instance to convert. |
Returns: java.lang.String - The file extension of the DocumentFormatBase instance.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.