/** * 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); }
public void setPubDates(String[] values) { setProperty("pubDate", values); }
public void setPubDate(String value) { setProperty("pubDate", value); }
public void setAuthor(String value) { setProperty("author", value); }
public void setTypesCountStdDev(TokenType tokenType, float mean) { setProperty("typesCountStdDev-" + tokenType.name(), String.valueOf(mean)); }
public void setTitles(String[] values) { setProperty("title", values); }
/** * Set the {@link Source}. * * @param source the {@link Source} */ public void setSource(Source source) { setProperty("source", source.name().toLowerCase()); }
public void setPubPlace(String value) { setProperty("pubPlace", value); }
public void setKeywords(String value) { setProperty("keywords", value); }
public void setIndex(int index) { setProperty("index", String.valueOf(index)); this.index = index; }
public void setExtras(String key, String[] values) { setProperty("extra." + key, values); }
public void setExtra(String key, String value) { setProperty("extra." + key, value); }
/** * 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()); }
/** * 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()); }
public void setAuthors(String[] values) { setProperty("author", values); }
public void setPublisher(String value) { setProperty("publisher", value); }
public void setPublishers(String[] values) { setProperty("publisher", values); }
public void setLanguageCode(String lang) { setProperty("language", lang); }
public void setPubPlaces(String[] values) { setProperty("pubPlace", values); }
public void setLastTokenOffsetIndex(TokenType tokenType, int lastOffset) { setProperty("lastTokenStartOffset-" + tokenType.name(), String.valueOf(lastOffset)); }
public void setTitle(String value) { setProperty("title", value); }
public void setLastTokenPositionIndex(TokenType tokenType, int lastPosition) { setProperty("lastTokenPositionIndex-" + tokenType.name(), String.valueOf(lastPosition)); }
public void setTypesCount(TokenType tokenType, int totalTypes) { setProperty("typesCount-" + tokenType.name(), String.valueOf(totalTypes)); }
/** * 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); }
public void setQueryParameters(FlexibleParameters storedparams) throws UnsupportedEncodingException { setProperty("queryParameters", storedparams.getAsQueryString()); }
/** * 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)); }