Class OdfOfficeMeta
- java.lang.Object
-
- org.odftoolkit.odfdom.incubator.meta.OdfOfficeMeta
-
public class OdfOfficeMeta extends Object
OdfOfficeMetarepresent the meta data feature in the ODF document.It provides convenient method to get meta data info.
-
-
Constructor Summary
Constructors Constructor Description OdfOfficeMeta(OdfFileDom metaDom)Constructor ofOdfOfficeMetafeature.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddKeyword(String keyword)Add the keyword to the current document.OdfMetaAutoReloadgetAutoReload()Receives the OdfMetaAutoReload feature.CalendargetCreationDate()Deprecated.usegetCreationInstant()instead.InstantgetCreationInstant()Receives the value of the ODFDOM element representationMetaCreationDateElement, See <meta:creation-date>StringgetCreator()Receives the value of the ODFDOM element representationDcCreatorElement, See <dc:creator>CalendargetDate()Receives the value of the ODFDOM element representationDcDateElement, See <dc:date>.StringgetDescription()Receives the value of the ODFDOM element representationDcDescriptionElement, See <dc:description>.OdfMetaDocumentStatisticgetDocumentStatistic()Receives the sub feature of OdfMetaDocumentStatistic.IntegergetEditingCycles()Receives the value of the ODFDOM element representationMetaEditingCyclesElement, See <meta:editing-cycles>.DurationgetEditingDuration()Receives the value of the ODFDOM element representationMetaEditingDurationElement, See <meta:editing-duration>.StringgetGenerator()Receives the value of the ODFDOM element representationMetaGeneratorElement, See <meta:generator>.OdfMetaHyperlinkBehaviourgetHyperlinkBehaviour()Receives the OdfMetaHyperlinkBehaviour feature.StringgetInitialCreator()Receives the value of the ODFDOM element representationMetaInitialCreatorElement, See <meta:initial-creator>.InstantgetInstant()Receives the value of the ODFDOM element representationDcDateElement, See <dc:date>.List<String>getKeywords()Receives the list value of the ODFDOM element representationMetaKeywordElement, See <meta:keyword>.StringgetLanguage()Receives the value of the ODFDOM element representationDcLanguageElement, See <dc:language>.OfficeMetaElementgetOfficeMetaElement()Get the instance ofOfficeMetaElementwhich represents this feature.CalendargetPrintDate()Deprecated.usegetPrintInstant()insteadStringgetPrintedBy()Receives the value of the ODFDOM element representationMetaPrintedByElement, See <meta:printed-by>InstantgetPrintInstant()Receives the value of the ODFDOM element representationMetaPrintDateElement, See <meta:print-date>.StringgetSubject()Receives the value of the ODFDOM element representationDcSubjectElement, See <dc:subject>.OdfMetaTemplategetTemplate()Receives the OdfMetaTemplate feature.StringgetTitle()Receives the value of the ODFDOM element representationDcTitleElement, See <dc:title>.List<String>getUserDefinedDataNames()Receives the list value of the ODFDOM element representationMetaUserDefinedElement, See <meta:user-defined>.StringgetUserDefinedDataType(String name)Receives the data type of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.StringgetUserDefinedDataValue(String name)Receives the value of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.MetaUserDefinedElementgetUserDefinedElementByAttributeName(String name)Receives the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.booleanhasAutomaticUpdate()voidremoveUserDefinedDataByName(String name)Remove the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.voidsetAutomaticUpdate(boolean enableAutomaticUpdate)voidsetCreationDate(Calendar creationDate)Deprecated.UsesetCreationInstant(Instant)instead.voidsetCreationInstant(Instant creationDate)Sets the value of the ODFDOM element representationMetaCreationDateElement, See <meta:creation-date>.voidsetCreator(String creator)Sets the value of the ODFDOM element representationDcCreatorElement, See <dc:creator>.voidsetDate(Calendar date)Sets the value of the ODFDOM element representationDcDateElement, See <dc:date>.voidsetDescription(String description)Sets the value of the ODFDOM element representationDcDescriptionElement, See <dc:description>.voidsetEditingCycles(Integer editingCycles)Sets the value of the ODFDOM element representationMetaEditingCyclesElement, See <meta:editing-cycles>.voidsetEditingDuration(Duration editingDuration)Sets the value of the ODFDOM element representationMetaEditingDurationElement, See <meta:editing-duration>.voidsetGenerator(String generator)Sets the value of the ODFDOM element representationMetaGeneratorElement, See <meta:generator>.voidsetInitialCreator(String initialCreator)Sets the value of the ODFDOM element representationMetaInitialCreatorElement, See <meta:initial-creator>.voidsetInstant(Instant instant)Sets the value of the ODFDOM element representationDcDateElement, See <dc:date>.voidsetKeywords(List<String> keyList)Sets the list value of the ODFDOM element representationMetaKeywordElement, See <meta:keyword>.voidsetLanguage(String language)Sets the value of the ODFDOM element representationDcLanguageElement, See <dc:language>.voidsetPrintDate(Calendar printDate)Deprecated.usesetPrintInstant(Instant)insteadvoidsetPrintedBy(String printedBy)Sets the value of the ODFDOM element representationMetaPrintedByElement, See <meta:printed-by>.voidsetPrintInstant(Instant printInstant)Sets the value of the ODFDOM element representationMetaPrintDateElement, See <meta:print-date>.voidsetSubject(String subject)Sets the value of the ODFDOM element representationDcSubjectElement, See <dc:subject>.voidsetTitle(String title)Sets the value of the ODFDOM element representationDcTitleElement, See <dc:title>.voidsetUserDefinedData(String name, String type, String value)Sets the ODFDOM element representationMetaUserDefinedElement, See <meta:user-defined> if the element with the attribute name exists,then update;or create a new element if type or value is null,the original will not be updated.voidsetUserDefinedDataType(String name, String value)Sets the data type of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.voidsetUserDefinedDataValue(String name, String value)Sets the value of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.StringtoString()
-
-
-
Constructor Detail
-
OdfOfficeMeta
public OdfOfficeMeta(OdfFileDom metaDom)
Constructor ofOdfOfficeMetafeature.- Parameters:
metaDom- the file DOM element of meta.xml
-
-
Method Detail
-
getOfficeMetaElement
public OfficeMetaElement getOfficeMetaElement()
Get the instance ofOfficeMetaElementwhich represents this feature.- Returns:
- the instance of OfficeMetaElement
-
getGenerator
public String getGenerator()
Receives the value of the ODFDOM element representationMetaGeneratorElement, See <meta:generator>.- Returns:
- the generator info of the current document;
null, if the element is not set.
-
setGenerator
public void setGenerator(String generator)
Sets the value of the ODFDOM element representationMetaGeneratorElement, See <meta:generator>.- Parameters:
generator- set the specified document generator. NULL will remove the element from the meta.xml.
-
getTitle
public String getTitle()
Receives the value of the ODFDOM element representationDcTitleElement, See <dc:title>.- Returns:
- the title of the current document;
null, if the element is not set.
-
setTitle
public void setTitle(String title)
Sets the value of the ODFDOM element representationDcTitleElement, See <dc:title>.- Parameters:
title- set the specified document title. NULL will remove the element from the meta.xml.
-
getDescription
public String getDescription()
Receives the value of the ODFDOM element representationDcDescriptionElement, See <dc:description>.- Returns:
- the description of the current document;
null, if the element is not set.
-
setDescription
public void setDescription(String description)
Sets the value of the ODFDOM element representationDcDescriptionElement, See <dc:description>.- Parameters:
description- set the specified document description. NULL will remove the element from the meta.xml.
-
getSubject
public String getSubject()
Receives the value of the ODFDOM element representationDcSubjectElement, See <dc:subject>.- Returns:
- the subject of the current document;
null, if the element is not set.
-
setSubject
public void setSubject(String subject)
Sets the value of the ODFDOM element representationDcSubjectElement, See <dc:subject>.- Parameters:
subject- set the specified document subject. NULL will remove the element from the meta.xml.
-
getKeywords
public List<String> getKeywords()
Receives the list value of the ODFDOM element representationMetaKeywordElement, See <meta:keyword>.- Returns:
- the keywords of the current document;
null, if the element is not set.
-
setKeywords
public void setKeywords(List<String> keyList)
Sets the list value of the ODFDOM element representationMetaKeywordElement, See <meta:keyword>.- Parameters:
keyList- set the specified list of keywords
-
addKeyword
public void addKeyword(String keyword)
Add the keyword to the current document. Create child element <meta:keyword>.- Parameters:
keyword- the value of child element <meta:keyword>.
-
getUserDefinedDataNames
public List<String> getUserDefinedDataNames()
Receives the list value of the ODFDOM element representationMetaUserDefinedElement, See <meta:user-defined>.- Returns:
- get the list of user-defined metadata names;
null, if the element is not set.
-
getUserDefinedElementByAttributeName
public MetaUserDefinedElement getUserDefinedElementByAttributeName(String name)
Receives the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.- Parameters:
name- the name of the user-defined metadata- Returns:
- the
MetaUserDefinedElementwhich is identified by the specified name;null, if the element is not set.
-
getUserDefinedDataValue
public String getUserDefinedDataValue(String name)
Receives the value of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.- Parameters:
name- the name of the user-defined metadata- Returns:
- the value of the user-defined metadata with the specified name;
null, if the element is not set.
-
getUserDefinedDataType
public String getUserDefinedDataType(String name)
Receives the data type of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.- Parameters:
name- the name of the user-defined metadata- Returns:
- the data type of the user-defined metadata with the specified name;
null, if the element is not set.
-
removeUserDefinedDataByName
public void removeUserDefinedDataByName(String name)
Remove the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.- Parameters:
name- the name of the user-defined metadata
-
setUserDefinedDataValue
public void setUserDefinedDataValue(String name, String value)
Sets the value of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.- Parameters:
name- the name need to set for the user-defined metadatavalue- the value need to set for the user-defined metadata
-
setUserDefinedDataType
public void setUserDefinedDataType(String name, String value)
Sets the data type of the ODFDOM element representationMetaUserDefinedElementby attribute name, See <meta:user-defined>.- Parameters:
name- the name need to set for the user-defined metadatavalue- the value need to set for the user-defined metadata
-
setUserDefinedData
public void setUserDefinedData(String name, String type, String value)
Sets the ODFDOM element representationMetaUserDefinedElement, See <meta:user-defined> if the element with the attribute name exists,then update;or create a new element if type or value is null,the original will not be updated.- Parameters:
name- the name need to set for the user-defined metadatatype- the data type need to set for the user-defined metadatavalue- the value need to set for the user-defined metadata
-
getInitialCreator
public String getInitialCreator()
Receives the value of the ODFDOM element representationMetaInitialCreatorElement, See <meta:initial-creator>.- Returns:
- get the initial creator of the current document;
null, if the element is not set.
-
setInitialCreator
public void setInitialCreator(String initialCreator)
Sets the value of the ODFDOM element representationMetaInitialCreatorElement, See <meta:initial-creator>.- Parameters:
initialCreator- set the specified initial creator. NULL will remove the element from the meta.xml.
-
getCreator
public String getCreator()
Receives the value of the ODFDOM element representationDcCreatorElement, See <dc:creator>- Returns:
- the creator of the current document;
null, if the element is not set.
-
setCreator
public void setCreator(String creator)
Sets the value of the ODFDOM element representationDcCreatorElement, See <dc:creator>.- Parameters:
creator- set the specified creator. NULL will remove the element from the meta.xml.
-
getPrintedBy
public String getPrintedBy()
Receives the value of the ODFDOM element representationMetaPrintedByElement, See <meta:printed-by>- Returns:
- the name of the last person who printed the current document;
null, if element is not set
-
setPrintedBy
public void setPrintedBy(String printedBy)
Sets the value of the ODFDOM element representationMetaPrintedByElement, See <meta:printed-by>.- Parameters:
printedBy- the name need to set for the last person who printed the current document. NULL will remove the element from the meta.xml.
-
getCreationDate
@Deprecated public Calendar getCreationDate()
Deprecated.usegetCreationInstant()instead.Receives the value of the ODFDOM element representationMetaCreationDateElement, See <meta:creation-date>- Returns:
- the date and time when the document was created initially;
null, if element is not set
-
getCreationInstant
public Instant getCreationInstant()
Receives the value of the ODFDOM element representationMetaCreationDateElement, See <meta:creation-date>- Returns:
- the date and time when the document was created initially;
null, if element is not set
-
setCreationDate
@Deprecated public void setCreationDate(Calendar creationDate)
Deprecated.UsesetCreationInstant(Instant)instead.Sets the value of the ODFDOM element representationMetaCreationDateElement, See <meta:creation-date>.- Parameters:
creationDate- the date and time need to set. NULL will remove the element from the meta.xml.
-
setCreationInstant
public void setCreationInstant(Instant creationDate)
Sets the value of the ODFDOM element representationMetaCreationDateElement, See <meta:creation-date>.- Parameters:
creationDate- the date and time need to set.nullwill remove the element from the meta.xml.
-
getDate
public Calendar getDate()
Receives the value of the ODFDOM element representationDcDateElement, See <dc:date>.- Returns:
- the date and time when the document was last modified;
null, if the element is not set.
-
setDate
public void setDate(Calendar date)
Sets the value of the ODFDOM element representationDcDateElement, See <dc:date>.- Parameters:
date- the date and time need to set. NULL will remove the element from the meta.xml.
-
getInstant
public Instant getInstant()
Receives the value of the ODFDOM element representationDcDateElement, See <dc:date>.- Returns:
- the date and time when the document was last modified;
null, if the element is not set.
-
setInstant
public void setInstant(Instant instant)
Sets the value of the ODFDOM element representationDcDateElement, See <dc:date>.- Parameters:
instant- the date and time need to set. NULL will remove the element from the meta.xml.
-
getPrintDate
@Deprecated public Calendar getPrintDate()
Deprecated.usegetPrintInstant()insteadReceives the value of the ODFDOM element representationMetaPrintDateElement, See <meta:print-date>.- Returns:
- the date and time when the document was last printed;
null, if the element is not set.
-
setPrintDate
@Deprecated public void setPrintDate(Calendar printDate)
Deprecated.usesetPrintInstant(Instant)insteadSets the value of the ODFDOM element representationMetaPrintDateElement, See <meta:print-date>.- Parameters:
printDate- the date and time need to set. NULL will remove the element from the meta.xml.
-
getPrintInstant
public Instant getPrintInstant()
Receives the value of the ODFDOM element representationMetaPrintDateElement, See <meta:print-date>.- Returns:
- the date and time when the document was last printed;
null, if the element is not set.
-
setPrintInstant
public void setPrintInstant(Instant printInstant)
Sets the value of the ODFDOM element representationMetaPrintDateElement, See <meta:print-date>.- Parameters:
printInstant- the date and time need to set. NULL will remove the element from the meta.xml.
-
getLanguage
public String getLanguage()
Receives the value of the ODFDOM element representationDcLanguageElement, See <dc:language>.- Returns:
- the default language of the document;
null, if the element is not set.
-
setLanguage
public void setLanguage(String language)
Sets the value of the ODFDOM element representationDcLanguageElement, See <dc:language>.- Parameters:
language- the default language need to set fo the current document. NULL will remove the element from the meta.xml.
-
getEditingCycles
public Integer getEditingCycles()
Receives the value of the ODFDOM element representationMetaEditingCyclesElement, See <meta:editing-cycles>.- Returns:
- the number of times that the document has been edited;
null, if the element is not set.
-
setEditingCycles
public void setEditingCycles(Integer editingCycles)
Sets the value of the ODFDOM element representationMetaEditingCyclesElement, See <meta:editing-cycles>.- Parameters:
editingCycles- set the specified edit times. NULL will remove the element from the meta.xml.
-
getEditingDuration
public Duration getEditingDuration()
Receives the value of the ODFDOM element representationMetaEditingDurationElement, See <meta:editing-duration>.- Returns:
- the total time spent editing the document;
null, if the element is not set.
-
setEditingDuration
public void setEditingDuration(Duration editingDuration)
Sets the value of the ODFDOM element representationMetaEditingDurationElement, See <meta:editing-duration>.- Parameters:
editingDuration- the time need to set. NULL will remove the element from the meta.xml.
-
getDocumentStatistic
public OdfMetaDocumentStatistic getDocumentStatistic()
Receives the sub feature of OdfMetaDocumentStatistic.- Returns:
- the statistics about the document which can be represented by
OdfMetaDocumentStatisticfeature;null, if the feature is not exist.
-
getHyperlinkBehaviour
public OdfMetaHyperlinkBehaviour getHyperlinkBehaviour()
Receives the OdfMetaHyperlinkBehaviour feature.- Returns:
- the default behavior of hyperlinks in the current document which can be represented by
OdfMetaHyperlinkBehaviourfeature;null, if the feature is not exist.
-
getAutoReload
public OdfMetaAutoReload getAutoReload()
Receives the OdfMetaAutoReload feature.- Returns:
- the information whether the document is reloaded or replaced by another document after
a certain period of time has elapsed.
It can be represented by
OdfMetaAutoReloadfeature;null, if the feature is not exist.
-
getTemplate
public OdfMetaTemplate getTemplate()
Receives the OdfMetaTemplate feature.- Returns:
- the information specified the URL for the document that was used to create a document.
It can be represented by
OdfMetaTemplatefeature;null, if the feature is not exist.
-
setAutomaticUpdate
public void setAutomaticUpdate(boolean enableAutomaticUpdate)
- Parameters:
enableAutomaticUpdate- If the automatic update of metadata is enabled, metadata such as last modified data is set during saving the document. The default istrue, disabling the default allows to load and save a document without changing any data.
-
hasAutomaticUpdate
public boolean hasAutomaticUpdate()
- Returns:
- If the automatic update of metadata is enabled, metadata such as last modified data is
set during saving the document. The default is
true, disabling the default allows to load and save a document without changing any data.
-
-