Example #1
0
 /**
  * Creates a new child Metadata object with this object as its parent, including provided parent
  * ID.
  *
  * @return a new child Metadata object
  */
 public DocumentMetadata asParent(String id, ParentType parentType) {
   setProperty("id", id);
   FlexibleParameters newParameters = new FlexibleParameters();
   for (String key : parameters.getKeys()) {
     newParameters.setParameter("parent_" + key, parameters.getParameterValues(key));
   }
   newParameters.setParameter("parentType", parentType.name().toLowerCase());
   return new DocumentMetadata(newParameters);
 }
Example #2
0
 public void setPubDates(String[] values) {
   setProperty("pubDate", values);
 }
Example #3
0
 public void setPubDate(String value) {
   setProperty("pubDate", value);
 }
Example #4
0
 public void setAuthor(String value) {
   setProperty("author", value);
 }
Example #5
0
 public void setTypesCountStdDev(TokenType tokenType, float mean) {
   setProperty("typesCountStdDev-" + tokenType.name(), String.valueOf(mean));
 }
Example #6
0
 public void setTitles(String[] values) {
   setProperty("title", values);
 }
Example #7
0
 /**
  * Set the {@link Source}.
  *
  * @param source the {@link Source}
  */
 public void setSource(Source source) {
   setProperty("source", source.name().toLowerCase());
 }
Example #8
0
 public void setPubPlace(String value) {
   setProperty("pubPlace", value);
 }
Example #9
0
 public void setKeywords(String value) {
   setProperty("keywords", value);
 }
Example #10
0
 public void setIndex(int index) {
   setProperty("index", String.valueOf(index));
   this.index = index;
 }
Example #11
0
 public void setExtras(String key, String[] values) {
   setProperty("extra." + key, values);
 }
Example #12
0
 public void setExtra(String key, String value) {
   setProperty("extra." + key, value);
 }
Example #13
0
 /**
  * Get the {@link DocumentFormat} of the metadata (or {@link DocumentFormat#UNKNOWN} if unknown).
  * If this hasn't been set explicitly (using {@link #setDocumentFormat}) then an attempt is made
  * to guess at the format using other heuristics (especially file names and URIs where
  * applicable).
  *
  * @param documentFormat the {@link DocumentFormat} of the metadata
  */
 public void setDocumentFormat(DocumentFormat documentFormat) {
   setProperty("format", documentFormat.name().toLowerCase());
 }
Example #14
0
 /**
  * Set the {@link DocumentFormat} of the metadata
  *
  * @param format the {@link DocumentFormat} of the metadata
  */
 public void setDefaultFormat(DocumentFormat format) {
   setProperty("defaultFormat", format.name().toLowerCase());
 }
Example #15
0
 public void setAuthors(String[] values) {
   setProperty("author", values);
 }
Example #16
0
 public void setPublisher(String value) {
   setProperty("publisher", value);
 }
Example #17
0
 public void setPublishers(String[] values) {
   setProperty("publisher", values);
 }
Example #18
0
 public void setLanguageCode(String lang) {
   setProperty("language", lang);
 }
Example #19
0
 public void setPubPlaces(String[] values) {
   setProperty("pubPlace", values);
 }
Example #20
0
 public void setLastTokenOffsetIndex(TokenType tokenType, int lastOffset) {
   setProperty("lastTokenStartOffset-" + tokenType.name(), String.valueOf(lastOffset));
 }
Example #21
0
 public void setTitle(String value) {
   setProperty("title", value);
 }
Example #22
0
 public void setLastTokenPositionIndex(TokenType tokenType, int lastPosition) {
   setProperty("lastTokenPositionIndex-" + tokenType.name(), String.valueOf(lastPosition));
 }
Example #23
0
 public void setTypesCount(TokenType tokenType, int totalTypes) {
   setProperty("typesCount-" + tokenType.name(), String.valueOf(totalTypes));
 }
Example #24
0
 /**
  * Set the location of the source. This is a String representation that will depend on the {@link
  * Source} but may include a file name, a URI, "memory" (for a String or transient InputStream).
  *
  * @param location the location of the source
  */
 public void setLocation(String location) {
   setProperty("location", location);
 }
Example #25
0
 public void setQueryParameters(FlexibleParameters storedparams)
     throws UnsupportedEncodingException {
   setProperty("queryParameters", storedparams.getAsQueryString());
 }
Example #26
0
 /**
  * Set the last modified timestamp (milliseconds since January 1, 1970 GMT)
  *
  * @param modified timestamp (milliseconds since January 1, 1970 GMT)
  */
 public void setModified(long modified) {
   setProperty("modified", String.valueOf(modified));
 }