use of org.apache.sis.metadata.iso.lineage.DefaultProcessing in project sis by apache.
the class TreeTableFormatTest method testProcessing.
/**
* Tests the formatting of a {@link DefaultProcessing} object.
*/
@Test
public void testProcessing() {
final DefaultCitation titled = new DefaultCitation("Some specification");
final DefaultCitation coded = new DefaultCitation();
final DefaultCitation untitled = new DefaultCitation();
titled.setPresentationForms(singleton(PresentationForm.DOCUMENT_HARDCOPY));
coded.setPresentationForms(singleton(PresentationForm.IMAGE_HARDCOPY));
untitled.setCitedResponsibleParties(singleton(new DefaultResponsibleParty(Role.AUTHOR)));
final DefaultProcessing processing = new DefaultProcessing();
processing.setDocumentations(asList(titled, coded, untitled));
final String text = format.format(processing.asTreeTable());
assertMultilinesEquals("Processing\n" + " ├─Documentation (1 of 3)…………… Some specification\n" + " │ └─Presentation form……………… Document hardcopy\n" + " ├─Documentation (2 of 3)\n" + " │ └─Presentation form……………… Image hardcopy\n" + " └─Documentation (3 of 3)\n" + " └─Cited responsible party\n" + " └─Role……………………………………… Author\n", text);
}
use of org.apache.sis.metadata.iso.lineage.DefaultProcessing in project sis by apache.
the class MetadataBuilder method addHostComputer.
/**
* Adds information about the computer and/or operating system in use at the processing time.
* This is added to the processing identified by last call to {@link #addProcessing(CharSequence, String)}.
* Storage location is:
*
* <ul>
* <li>{@code metadata/resourceLineage/processStep/processingInformation/procedureDescription}</li>
* </ul>
*
* @param platform name of the system on which the processing has been executed, or {@code null} for no-operation.
*/
public final void addHostComputer(final CharSequence platform) {
InternationalString i18n = trim(platform);
if (i18n != null) {
i18n = Resources.formatInternational(Resources.Keys.ProcessingExecutedOn_1, i18n);
final DefaultProcessing p = processing();
p.setProcedureDescription(append(p.getProcedureDescription(), i18n));
}
}
Aggregations