public class DefaultDocument extends AbstractDocument
Document interface.ACCESSED_DATE_FIELD_NAME, AUTHOR_FIELD_NAME, BODY_FIELD_NAME, fieldMap, LAST_MODIFIED_DATE_FIELD_NAME, reference, TITLE_FIELD_NAMEname| Constructor and Description |
|---|
DefaultDocument()
Creates a new
DefaultDocument. |
| Modifier and Type | Method and Description |
|---|---|
void |
addField(Field field)
Adds a field to the document.
|
void |
readMetaData(java.net.URLConnection connection)
Reads the file name and title from the given URL.
|
void |
removeField(java.lang.String fieldName)
Removes a field of the given name from the document.
|
void |
setAccessedDate(java.util.Date date)
Sets the last accessed date of the document.
|
void |
setAccessedDate(long time)
Sets the last accessed date of the document.
|
void |
setAuthor(java.lang.String author)
Sets the author field of the document to the given string.
|
void |
setBody(java.lang.String body)
Sets the body field of the document to the given string.
|
void |
setLastModifiedDate(java.util.Date date)
Sets the last modified date of the document.
|
void |
setLastModifiedDate(long time)
Sets the last modified date of the document.
|
void |
setTitle(java.lang.String title)
Sets the title field of the document to the given string.
|
getAccessedDateField, getAuthorField, getBodyField, getField, getFieldMap, getFields, getLastModifiedDateField, getReference, getReferenceURI, getTitleField, hasField, setFieldMap, setReferenceclone, getName, setName, toStringpublic void addField(Field field)
AbstractDocumentaddField in class AbstractDocumentfield - The field to add.public void removeField(java.lang.String fieldName)
AbstractDocumentremoveField in class AbstractDocumentfieldName - The name of the field to remove.public void setTitle(java.lang.String title)
title - The title of the document.public void setLastModifiedDate(long time)
time - The last modified date in milliseconds.public void setLastModifiedDate(java.util.Date date)
date - The last modified date.public void setAccessedDate(long time)
time - The last accessed date in milliseconds.public void setAccessedDate(java.util.Date date)
date - The last accessed date.public void setAuthor(java.lang.String author)
author - The author of the document.public void setBody(java.lang.String body)
body - The body text of the document.public void readMetaData(java.net.URLConnection connection)
connection - The connection to read the metadata from.