public final class SummaryInformation extends PropertySet
DocumentSummaryInformation
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_STREAM_NAME
The document name a summary information stream usually has in a POIFS filesystem.
(摘要信息流通常在 POIFS 文件系统中具有的文档名称。)
|
static ClassID |
FORMAT_ID
The SummaryInformation's section's format ID.
(SummaryInformation 部分的格式 ID。)
|
OS_MACINTOSH, OS_WIN16, OS_WIN32
Constructor and Description |
---|
SummaryInformation()
Creates an empty
SummaryInformation .
|
SummaryInformation(java.io.InputStream stream)
Creates a
SummaryInformation instance from an
InputStream in the Horrible Property Set Format.
|
SummaryInformation(PropertySet ps)
Creates a
SummaryInformation from a given
PropertySet .
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getApplicationName()
Returns the application name (or
null ).
(返回应用程序名称(或 null)。)
|
java.lang.String |
getAuthor()
Returns the author (or
null ).
(返回作者(或 null)。)
|
int |
getCharCount()
Returns the character count or 0 if the
SummaryInformation does not contain a char count.
(如果 SummaryInformation 不包含字符数,则返回字符数或 0。)
|
java.lang.String |
getComments()
Returns the comments (or
null ).
(返回注释(或 null)。)
|
java.util.Date |
getCreateDateTime()
Returns the creation time (or
null ).
(返回创建时间(或 null)。)
|
long |
getEditTime()
Returns the total time spent in editing the document (or
0 ).
(返回编辑文档所花费的总时间(或 0)。)
|
java.lang.String |
getKeywords()
Returns the keywords (or
null ).
(返回关键字(或 null)。)
|
java.lang.String |
getLastAuthor()
Returns the last author (or
null ).
(返回最后一位作者(或 null)。)
|
java.util.Date |
getLastPrinted()
Returns the last printed time (or
null ).
(返回上次打印时间(或 null)。)
|
java.util.Date |
getLastSaveDateTime()
Returns the last save time (or
null ).
(返回上次保存时间(或 null)。)
|
int |
getPageCount()
Returns the page count or 0 if the
SummaryInformation does not contain a page count.
(如果 SummaryInformation 不包含页数,则返回页数或 0。)
|
PropertyIDMap |
getPropertySetIDMap()
The id to name mapping of the properties in this set.
(此集中属性的 id 到名称映射。)
|
java.lang.String |
getRevNumber()
Returns the revision number (or
null ).
(返回修订号(或 null)。)
|
int |
getSecurity()
Returns a security code which is one of the following values: 0 if the
SummaryInformation does not contain a security field or if there is no security on the document.
(返回一个安全代码,它是下列值之一: 如果 SummaryInformation 不包含安全字段或文档没有安全性,则返回 0。)
|
java.lang.String |
getSubject()
Returns the subject (or
null ).
(返回主题(或 null)。)
|
java.lang.String |
getTemplate()
Returns the template (or
null ).
(返回模板(或 null)。)
|
byte[] |
getThumbnail()
Returns the thumbnail (or
null )
when this method is implemented.
(实现此方法时返回缩略图(或 null)。)
|
Thumbnail |
getThumbnailThumbnail()
Returns the thumbnail (or
null ), processed as an object which is (largely) able to unpack the thumbnail image data.
(返回缩略图(或 null),作为一个对象处理,该对象(很大程度上)能够解压缩缩略图图像数据。)
|
java.lang.String |
getTitle() |
int |
getWordCount()
Returns the word count or 0 if the
SummaryInformation does not contain a word count.
(如果 SummaryInformation 不包含字数,则返回字数或 0。)
|
void |
removeApplicationName()
Removes the application name.
(删除应用程序名称。)
|
void |
removeAuthor()
Removes the author.
(删除作者。)
|
void |
removeCharCount()
Removes the character count.
(删除字符数。)
|
void |
removeComments()
Removes the comments.
(删除评论。)
|
void |
removeCreateDateTime()
Removes the creation time.
(删除创建时间。)
|
void |
removeEditTime()
Remove the total time spent in editing the document.
(删除编辑文档所花费的总时间。)
|
void |
removeKeywords()
Removes the keywords.
(删除关键字。)
|
void |
removeLastAuthor()
Removes the last author.
(删除最后一位作者。)
|
void |
removeLastPrinted()
Removes the lastPrinted.
(删除 lastPrinted。)
|
void |
removeLastSaveDateTime()
Remove the total time spent in editing the document.
(删除编辑文档所花费的总时间。)
|
void |
removePageCount()
Removes the page count.
(删除页数。)
|
void |
removeRevNumber()
Removes the revision number.
(删除修订号。)
|
void |
removeSecurity()
Removes the security code.
(删除安全代码。)
|
void |
removeSubject()
Removes the subject.
(删除主题。)
|
void |
removeTemplate()
Removes the template.
(删除模板。)
|
void |
removeThumbnail()
Removes the thumbnail.
(删除缩略图。)
|
void |
removeTitle()
Removes the title.
(删除标题。)
|
void |
removeWordCount()
Removes the word count.
(删除字数。)
|
void |
setApplicationName(java.lang.String applicationName)
Sets the application name.
(设置应用程序名称。)
|
void |
setAuthor(java.lang.String author)
Sets the author.
(设置作者。)
|
void |
setCharCount(int charCount)
Sets the character count.
(设置字符数。)
|
void |
setComments(java.lang.String comments)
Sets the comments.
(设置评论。)
|
void |
setCreateDateTime(java.util.Date createDateTime)
Sets the creation time.
(设置创建时间。)
|
void |
setEditTime(long time)
Sets the total time spent in editing the document.
(设置编辑文档所花费的总时间。)
|
void |
setKeywords(java.lang.String keywords)
Sets the keywords.
(设置关键字。)
|
void |
setLastAuthor(java.lang.String lastAuthor)
Sets the last author.
(设置最后一位作者。)
|
void |
setLastPrinted(java.util.Date lastPrinted)
Sets the lastPrinted.
(设置 lastPrinted。)
|
void |
setLastSaveDateTime(java.util.Date time)
Sets the total time spent in editing the document.
(设置编辑文档所花费的总时间。)
|
void |
setPageCount(int pageCount)
Sets the page count.
(设置页数。)
|
void |
setRevNumber(java.lang.String revNumber)
Sets the revision number.
(设置修订号。)
|
void |
setSecurity(int security)
Sets the security code.
(设置安全代码。)
|
void |
setSubject(java.lang.String subject)
Sets the subject.
(设置主题。)
|
void |
setTemplate(java.lang.String template)
Sets the template.
(设置模板。)
|
void |
setThumbnail(byte[] thumbnail)
Sets the thumbnail.
(设置缩略图。)
|
void |
setTitle(java.lang.String title)
Sets the title.
(设置标题。)
|
void |
setWordCount(int wordCount)
Sets the word count.
(设置字数。)
|
addSection, clearSections, equals, getByteOrder, getClassID, getFirstSection, getFormat, getOSVersion, getProperties, getProperty, getPropertyStringValue, getSectionCount, getSections, hashCode, isDocumentSummaryInformation, isPropertySetStream, isPropertySetStream, isSummaryInformation, setByteOrder, setClassID, setFormat, setOSVersion, toInputStream, toString, wasNull, write, write
public static final java.lang.String DEFAULT_STREAM_NAME
public static final ClassID FORMAT_ID
public SummaryInformation()
SummaryInformation
.
(创建一个空的 SummaryInformation。)
public SummaryInformation(PropertySet ps) throws UnexpectedPropertySetTypeException
ps
- A property set which should be created from a summary information stream.
(ps - 应从摘要信息流创建的属性集。)
UnexpectedPropertySetTypeException
- if
ps
does not contain a summary information stream.
(UnexpectedPropertySetTypeException - 如果 ps 不包含摘要信息流。)
public SummaryInformation(java.io.InputStream stream) throws NoPropertySetStreamException, MarkUnsupportedException, java.io.IOException, java.io.UnsupportedEncodingException
SummaryInformation
instance from an
InputStream
in the Horrible Property Set Format.
The constructor reads the first few bytes from the stream and determines whether it is really a property set stream. If it is, it parses the rest of the stream. If it is not, it resets the stream to its beginning in order to let other components mess around with the data and throws an exception.
(从 Horrible 属性集格式的 InputStream 创建一个 SummaryInformation 实例。构造函数从流中读取前几个字节并确定它是否真的是属性集流。如果是,它会解析流的其余部分。如果不是,它会将流重置为其开头,以便让其他组件弄乱数据并引发异常。)stream
- Holds the data making out the property set stream.
(流 - 保存生成属性集流的数据。)
MarkUnsupportedException
- if the stream does not support the
InputStream.markSupported()
method.
(MarkUnsupportedException - 如果流不支持 InputStream.markSupported() 方法。)
java.io.IOException
- if the
InputStream
cannot be accessed as needed.
(java.io.IOException - 如果无法根据需要访问 InputStream。)
NoPropertySetStreamException
- if the input stream does not contain a property set.
(NoPropertySetStreamException - 如果输入流不包含属性集。)
java.io.UnsupportedEncodingException
- if a character encoding is not supported.
(java.io.UnsupportedEncodingException - 如果不支持字符编码。)
public PropertyIDMap getPropertySetIDMap()
PropertySet
getPropertySetIDMap
in class
PropertySet
null
if not applicable
(此集合中属性的 ID 到名称映射,如果不适用,则为 null)
public java.lang.String getTitle()
null
(标题或空)
public void setTitle(java.lang.String title)
title
- The title to set.
(title - 要设置的标题。)
public void removeTitle()
public java.lang.String getSubject()
null
).
(返回主题(或 null)。)
null
(主题或空)
public void setSubject(java.lang.String subject)
subject
- The subject to set.
(subject - 要设置的主题。)
public void removeSubject()
public java.lang.String getAuthor()
null
).
(返回作者(或 null)。)
null
(作者或空)
public void setAuthor(java.lang.String author)
author
- The author to set.
(author - 要设置的作者。)
public void removeAuthor()
public java.lang.String getKeywords()
null
).
(返回关键字(或 null)。)
null
(关键字或空)
public void setKeywords(java.lang.String keywords)
keywords
- The keywords to set.
(关键字 - 要设置的关键字。)
public void removeKeywords()
public java.lang.String getComments()
null
).
(返回注释(或 null)。)
null
(评论或空)
public void setComments(java.lang.String comments)
comments
- The comments to set.
(评论 - 要设置的评论。)
public void removeComments()
public java.lang.String getTemplate()
null
).
(返回模板(或 null)。)
null
(模板或空)
public void setTemplate(java.lang.String template)
template
- The template to set.
(template - 要设置的模板。)
public void removeTemplate()
public java.lang.String getLastAuthor()
null
).
(返回最后一位作者(或 null)。)
null
(最后作者或空)
public void setLastAuthor(java.lang.String lastAuthor)
lastAuthor
- The last author to set.
(lastAuthor - 要设置的最后一个作者。)
public void removeLastAuthor()
public java.lang.String getRevNumber()
null
).
(返回修订号(或 null)。)
null
(修订号或空)
public void setRevNumber(java.lang.String revNumber)
revNumber
- The revision number to set.
(revNumber - 要设置的修订号。)
public void removeRevNumber()
public long getEditTime()
0
).
(返回编辑文档所花费的总时间(或 0)。)
SummaryInformation
does not contain this information.
(编辑文档所花费的总时间,如果 SummaryInformation 不包含此信息,则为 0。)
public void setEditTime(long time)
time
- The time to set.
(time - 设置的时间。)
public void removeEditTime()
public java.util.Date getLastPrinted()
null
).
(返回上次打印时间(或 null)。)
null
(上次打印时间或 null)
public void setLastPrinted(java.util.Date lastPrinted)
lastPrinted
- The lastPrinted to set.
(lastPrinted - 要设置的 lastPrinted。)
public void removeLastPrinted()
public java.util.Date getCreateDateTime()
null
).
(返回创建时间(或 null)。)
null
(创建时间或null)
public void setCreateDateTime(java.util.Date createDateTime)
createDateTime
- The creation time to set.
(createDateTime - 要设置的创建时间。)
public void removeCreateDateTime()
public java.util.Date getLastSaveDateTime()
null
).
(返回上次保存时间(或 null)。)
null
(最后保存时间或空)
public void setLastSaveDateTime(java.util.Date time)
time
- The time to set.
(time - 设置的时间。)
public void removeLastSaveDateTime()
public int getPageCount()
SummaryInformation
does not contain a page count.
(如果 SummaryInformation 不包含页数,则返回页数或 0。)
SummaryInformation
does not contain a page count.
(页数;如果 SummaryInformation 不包含页数,则为 0。)
public void setPageCount(int pageCount)
pageCount
- The page count to set.
(pageCount - 要设置的页数。)
public void removePageCount()
public int getWordCount()
SummaryInformation
does not contain a word count.
(如果 SummaryInformation 不包含字数,则返回字数或 0。)
null
(字数或空)
public void setWordCount(int wordCount)
wordCount
- The word count to set.
(wordCount - 要设置的字数。)
public void removeWordCount()
public int getCharCount()
SummaryInformation
does not contain a char count.
(如果 SummaryInformation 不包含字符数,则返回字符数或 0。)
null
(字符数或 null)
public void setCharCount(int charCount)
charCount
- The character count to set.
(charCount - 要设置的字符数。)
public void removeCharCount()
public byte[] getThumbnail()
null
)
when this method is implemented. Please note that the return type is likely to change!
To process this data, you may wish to make use of the Thumbnail
class. The raw data is generally an image in WMF or Clipboard (BMP?) format
null
(缩略图或空)
public Thumbnail getThumbnailThumbnail()
null
), processed as an object which is (largely) able to unpack the thumbnail image data.
(返回缩略图(或 null),作为一个对象处理,该对象(很大程度上)能够解压缩缩略图图像数据。)
null
(缩略图或空)
public void setThumbnail(byte[] thumbnail)
thumbnail
- The thumbnail to set.
(thumbnail - 要设置的缩略图。)
public void removeThumbnail()
public java.lang.String getApplicationName()
null
).
(返回应用程序名称(或 null)。)
null
(应用程序名称或 null)
public void setApplicationName(java.lang.String applicationName)
applicationName
- The application name to set.
(applicationName - 要设置的应用程序名称。)
public void removeApplicationName()
public int getSecurity()
SummaryInformation
does not contain a security field or if there is no security on the document. Use PropertySet.wasNull()
to distinguish between the two cases! null
(安全码或空)
public void setSecurity(int security)
security
- The security code to set.
(security - 要设置的安全代码。)
public void removeSecurity()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.