use of nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor in project timbuctoo by HuygensING.
the class PropertyDescriptorFactoryTest method getLocalWithPrefixAndPostfixReturnsLocalPropertyDescriptor.
@Test
public void getLocalWithPrefixAndPostfixReturnsLocalPropertyDescriptor() {
PropertyParser parser = mock(PropertyParser.class);
PropertyDescriptor descriptor = instance.getLocal("propertyName", parser, "prefix", "postfix");
assertThat(descriptor, is(instanceOf(LocalPropertyDescriptor.class)));
}
use of nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor in project timbuctoo by HuygensING.
the class PropertyDescriptorFactoryTest method getDerivedWithSeparatorReturnsADerivedPropertyDescriptor.
@Test
public void getDerivedWithSeparatorReturnsADerivedPropertyDescriptor() {
PropertyParser parser = mock(PropertyParser.class);
PropertyDescriptor descriptor = instance.getDerivedWithSeparator("relationName", "propertyName", parser, "accepted", "--");
assertThat(descriptor, is(instanceOf(RelatedPropertyDescriptor.class)));
}
use of nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor in project timbuctoo by HuygensING.
the class PropertyDescriptorFactoryTest method getAppenderReturnsAnAppenderPropertyDescriptor.
@Test
public void getAppenderReturnsAnAppenderPropertyDescriptor() {
PropertyDescriptor descriptor = instance.getAppender(mock(PropertyDescriptor.class), mock(PropertyDescriptor.class), " ");
assertThat(descriptor, is(instanceOf(AppenderPropertyDescriptor.class)));
}
use of nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor in project timbuctoo by HuygensING.
the class WwDocumentAuthorDescriptor method createAuthorDescriptor.
private PropertyDescriptor createAuthorDescriptor() {
PropertyDescriptor authorNameDescriptor = propertyDescriptorFactory.getDerivedWithSeparator("isCreatedBy", "wwperson_names", propertyParserFactory.getParser(PersonNames.class), "wwrelation_accepted", "; ");
PropertyDescriptor authorTempNameDescriptor = propertyDescriptorFactory.getDerivedWithSeparator("isCreatedBy", "wwperson_tempName", propertyParserFactory.getParser(String.class), "wwrelation_accepted", "; ");
return propertyDescriptorFactory.getComposite(authorNameDescriptor, authorTempNameDescriptor);
}
use of nl.knaw.huygens.timbuctoo.search.description.PropertyDescriptor in project timbuctoo by HuygensING.
the class WwDocumentDisplayNameDescriptor method createDisplayNameDescriptor.
private PropertyDescriptor createDisplayNameDescriptor() {
PropertyDescriptor titleDescriptor = propertyDescriptorFactory.getLocal("wwdocument_title", String.class);
PropertyDescriptor dateDescriptor = propertyDescriptorFactory.getLocal("wwdocument_date", Datable.class, "(", ")");
PropertyDescriptor documentDescriptor = propertyDescriptorFactory.getAppender(titleDescriptor, dateDescriptor, " ");
return propertyDescriptorFactory.getAppender(new WwDocumentAuthorDescriptor(), documentDescriptor, " - ");
}
Aggregations