Class DublinCoreAdapter
- java.lang.Object
-
- org.apache.xmlgraphics.xmp.XMPSchemaAdapter
-
- org.apache.xmlgraphics.xmp.schemas.DublinCoreAdapter
-
public class DublinCoreAdapter extends XMPSchemaAdapter
Schema adapter implementation for the Dublin Core schema.Note: In Adobe's XMP specification dc:subject is defined as "bag Text", but in PDF/A-1 it is defined as "Text". Here it is implemented as "bag Text".
-
-
Field Summary
-
Fields inherited from class org.apache.xmlgraphics.xmp.XMPSchemaAdapter
meta
-
-
Constructor Summary
Constructors Constructor Description DublinCoreAdapter(Metadata meta)Constructs a new adapter for Dublin Core around the given metadata object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddContributor(java.lang.String value)Adds a new entry to the list of contributors (other than the authors).voidaddCreator(java.lang.String value)Adds a new entry to the list of creators (authors of the resource).voidaddDate(java.util.Date value)Adds a new entry to the list of dates indicating points in time something interesting happened to the resource.voidaddLanguage(java.lang.String value)Adds a new entry to the list of languages (RFC 3066).voidaddPublisher(java.lang.String value)Adds a new entry to the list of publishers.voidaddRelation(java.lang.String value)Adds a new entry to the list of relationships to other documents.voidaddSubject(java.lang.String value)Adds a new entry to the list of subjects (descriptive phrases or keywords that specify the topic of the content of the resource).voidaddType(java.lang.String value)Adds a new entry to the list of document types (for example: novel, poem or working paper).java.lang.String[]getContributors()Returns an array of all contributors.java.lang.StringgetCoverage()Returns the extent or scope of the resource.java.lang.String[]getCreators()Returns an array of all creators.java.util.DategetDate()Returns a latest date indicating point in time something interesting happened to the resource.java.util.Date[]getDates()Returns a list of dates indicating point in time something interesting happened to the resource.java.lang.StringgetDescription()Returns the description of the content of the resource (in the default language).java.lang.StringgetDescription(java.lang.String lang)Returns the description of the content of the resource in a language-dependant way.java.lang.StringgetFormat()Returns the file format used when saving this resource.java.lang.StringgetIdentifier()Returns the unique identifier of the resource.java.lang.String[]getLanguages()Returns an array of languages.java.lang.String[]getPublisher()Returns an array of publishers.java.lang.String[]getRelations()Returns an array of all relationship to other documents.java.lang.StringgetRights()Returns the informal rights statement.java.lang.StringgetRights(java.lang.String lang)Returns the informal rights statement in a language-dependant way.java.lang.StringgetSource()Returns unique identifier of the work from which this resource was derived.java.lang.String[]getSubjects()Returns an array of all subjects.java.lang.StringgetTitle()Returns the title of the resource (in the default language).java.lang.StringgetTitle(java.lang.String lang)Returns the title of the resource in a language-dependant way.java.lang.String[]getTypes()Returns an array of all document types.booleanremoveContributor(java.lang.String value)Removes an entry from the list of contributors.booleanremoveCreator(java.lang.String value)Removes an entry from the list of creators (authors of the resource).java.lang.StringremoveTitle(java.lang.String lang)Removes a title of the resource.voidsetCoverage(java.lang.String value)Sets the extent or scope of the resource.voidsetDescription(java.lang.String lang, java.lang.String value)Sets the description of the content of the resource.voidsetFormat(java.lang.String value)Sets the file format used when saving the resource.voidsetIdentifier(java.lang.String value)Sets the unique identifier of the resource.voidsetRights(java.lang.String lang, java.lang.String value)Sets the informal rights statement.voidsetSource(java.lang.String value)Sets the unique identifier of the work from which this resource was derived.voidsetTitle(java.lang.String value)Sets the title of the resource (in the default language).voidsetTitle(java.lang.String lang, java.lang.String value)Sets the title of the resource.-
Methods inherited from class org.apache.xmlgraphics.xmp.XMPSchemaAdapter
addDateToSeq, addObjectToArray, addStringToBag, addStringToSeq, findQualifiedStructure, findQualifiedValue, formatISO8601Date, formatISO8601Date, getDateArray, getDateValue, getLangAlt, getObjectArray, getQName, getSchema, getStringArray, getValue, removeLangAlt, removeStringFromArray, setCompact, setDateValue, setLangAlt, setValue
-
-
-
-
Constructor Detail
-
DublinCoreAdapter
public DublinCoreAdapter(Metadata meta)
Constructs a new adapter for Dublin Core around the given metadata object.- Parameters:
meta- the underlying metadata
-
-
Method Detail
-
addContributor
public void addContributor(java.lang.String value)
Adds a new entry to the list of contributors (other than the authors).- Parameters:
value- the new value
-
removeContributor
public boolean removeContributor(java.lang.String value)
Removes an entry from the list of contributors.- Parameters:
value- the value to be removed- Returns:
- the removed entry
-
getContributors
public java.lang.String[] getContributors()
Returns an array of all contributors.- Returns:
- a String array of all contributors (or null if not set)
-
setCoverage
public void setCoverage(java.lang.String value)
Sets the extent or scope of the resource.- Parameters:
value- the new value.
-
getCoverage
public java.lang.String getCoverage()
Returns the extent or scope of the resource.- Returns:
- the property value (or null if not set)
-
addCreator
public void addCreator(java.lang.String value)
Adds a new entry to the list of creators (authors of the resource).- Parameters:
value- the new value
-
removeCreator
public boolean removeCreator(java.lang.String value)
Removes an entry from the list of creators (authors of the resource).- Parameters:
value- the value to be removed- Returns:
- the removed entry
-
getCreators
public java.lang.String[] getCreators()
Returns an array of all creators.- Returns:
- a String array of all creators (or null if not set)
-
addDate
public void addDate(java.util.Date value)
Adds a new entry to the list of dates indicating points in time something interesting happened to the resource.- Parameters:
value- the date value
-
getDates
public java.util.Date[] getDates()
Returns a list of dates indicating point in time something interesting happened to the resource.- Returns:
- the list of dates or null if no dates are set
-
getDate
public java.util.Date getDate()
Returns a latest date indicating point in time something interesting happened to the resource.- Returns:
- the last date or null
-
setDescription
public void setDescription(java.lang.String lang, java.lang.String value)Sets the description of the content of the resource.- Parameters:
lang- the language of the value ("x-default" or null for the default language)value- the new value
-
getDescription
public java.lang.String getDescription()
Returns the description of the content of the resource (in the default language).- Returns:
- the description of the content of the resource (or null if not set)
-
getDescription
public java.lang.String getDescription(java.lang.String lang)
Returns the description of the content of the resource in a language-dependant way.- Parameters:
lang- the language ("x-default" or null for the default language)- Returns:
- the language-dependent value (or null if not set)
-
setFormat
public void setFormat(java.lang.String value)
Sets the file format used when saving the resource. Tools and applications should set this property to the save format of the data. It may include appropriate qualifiers.- Parameters:
value- a MIME type
-
getFormat
public java.lang.String getFormat()
Returns the file format used when saving this resource.- Returns:
- the MIME type of the file format (or null if not set)
-
setIdentifier
public void setIdentifier(java.lang.String value)
Sets the unique identifier of the resource.- Parameters:
value- the new value
-
getIdentifier
public java.lang.String getIdentifier()
Returns the unique identifier of the resource.- Returns:
- the unique identifier (or null if not set)
-
addLanguage
public void addLanguage(java.lang.String value)
Adds a new entry to the list of languages (RFC 3066).- Parameters:
value- the new value
-
getLanguages
public java.lang.String[] getLanguages()
Returns an array of languages.- Returns:
- a String array of all languages (or null if not set)
-
addPublisher
public void addPublisher(java.lang.String value)
Adds a new entry to the list of publishers.- Parameters:
value- the new value
-
getPublisher
public java.lang.String[] getPublisher()
Returns an array of publishers.- Returns:
- a String array of all publishers (or null if not set)
-
addRelation
public void addRelation(java.lang.String value)
Adds a new entry to the list of relationships to other documents.- Parameters:
value- the new value
-
getRelations
public java.lang.String[] getRelations()
Returns an array of all relationship to other documents.- Returns:
- a String array of all relationships (or null if none are set)
-
setRights
public void setRights(java.lang.String lang, java.lang.String value)Sets the informal rights statement.- Parameters:
lang- the language of the value ("x-default" or null for the default language)value- the new value
-
getRights
public java.lang.String getRights()
Returns the informal rights statement.- Returns:
- the informal right statement (or null if not set)
-
getRights
public java.lang.String getRights(java.lang.String lang)
Returns the informal rights statement in a language-dependant way.- Parameters:
lang- the language ("x-default" or null for the default language)- Returns:
- the language-dependent value (or null if not set)
-
setSource
public void setSource(java.lang.String value)
Sets the unique identifier of the work from which this resource was derived.- Parameters:
value- the new value
-
getSource
public java.lang.String getSource()
Returns unique identifier of the work from which this resource was derived.- Returns:
- the source (or null if not set)
-
addSubject
public void addSubject(java.lang.String value)
Adds a new entry to the list of subjects (descriptive phrases or keywords that specify the topic of the content of the resource).- Parameters:
value- the new value
-
getSubjects
public java.lang.String[] getSubjects()
Returns an array of all subjects.- Returns:
- a String array of all subjects
-
setTitle
public void setTitle(java.lang.String value)
Sets the title of the resource (in the default language).- Parameters:
value- the new value
-
setTitle
public void setTitle(java.lang.String lang, java.lang.String value)Sets the title of the resource.- Parameters:
lang- the language of the value ("x-default" or null for the default language)value- the new value
-
getTitle
public java.lang.String getTitle()
Returns the title of the resource (in the default language).- Returns:
- the title of the resource (in the default language)
-
getTitle
public java.lang.String getTitle(java.lang.String lang)
Returns the title of the resource in a language-dependant way.- Parameters:
lang- the language ("x-default" or null for the default language)- Returns:
- the language-dependent value (or null if not set)
-
removeTitle
public java.lang.String removeTitle(java.lang.String lang)
Removes a title of the resource.- Parameters:
lang- the language variant to be removed- Returns:
- the previously set value or null if this language variant wasn't set
-
addType
public void addType(java.lang.String value)
Adds a new entry to the list of document types (for example: novel, poem or working paper).- Parameters:
value- the new value
-
getTypes
public java.lang.String[] getTypes()
Returns an array of all document types.- Returns:
- a String array of all document types (or null if not set)
-
-