@Test(expected = UnparsableTypeException.class) public void getParserThrowsAUnparsableTypeExceptionWhenNoParserIsKnowForTheType() { instance.getParser(UnknownType.class); }
public PropertyParser getParser(Class<?> type) { if (String.class.isAssignableFrom(type)) { return new StringPropertyParser(); } else if (Change.class.isAssignableFrom(type)) { return new ChangeDatePropertyParser(); } else if (Datable.class.isAssignableFrom(type)) { return new DatableFromYearPropertyParser(); } else if (Gender.class.isAssignableFrom(type)) { return new GenderPropertyParser(); } else if (PersonNames.class.isAssignableFrom(type)) { return new PersonNamesDefaultNamePropertyParser(); } else if (LocationNames.class.isAssignableFrom(type)) { return new DefaultLocationNamePropertyParser(); } else if (CollectiveType.class.isAssignableFrom(type)) { return new CollectiveTypePropertyParser(); } else if (DocumentType.class.isAssignableFrom(type)) { return new DocumentTypePropertyParser(); } else if (TempName.class.isAssignableFrom(type)) { return new TempNamePropertyParser(); } else if (List.class.isAssignableFrom(type)) { return new StringListParser(); } throw new UnparsableTypeException("Type " + type + " is not supported"); }
PropertyParserFactory { public PropertyParser getParser(Class<?> type) { if (String.class.isAssignableFrom(type)) { return new StringPropertyParser(); } else if (Change.class.isAssignableFrom(type)) { return new ChangeDatePropertyParser(); } else if (Datable.class.isAssignableFrom(type)) { return new DatableFromYearPropertyParser(); } else if (Gender.class.isAssignableFrom(type)) { return new GenderPropertyParser(); } else if (PersonNames.class.isAssignableFrom(type)) { return new PersonNamesDefaultNamePropertyParser(); } else if (LocationNames.class.isAssignableFrom(type)) { return new DefaultLocationNamePropertyParser(); } else if (CollectiveType.class.isAssignableFrom(type)) { return new CollectiveTypePropertyParser(); } else if (DocumentType.class.isAssignableFrom(type)) { return new DocumentTypePropertyParser(); } else if (TempName.class.isAssignableFrom(type)) { return new TempNamePropertyParser(); } else if (List.class.isAssignableFrom(type)) { return new StringListParser(); } throw new UnparsableTypeException("Type " + type + " is not supported"); } }
PropertyParserFactory { public PropertyParser getParser(Class<?> type) { if (String.class.isAssignableFrom(type)) { return new StringPropertyParser(); } else if (Change.class.isAssignableFrom(type)) { return new ChangeDatePropertyParser(); } else if (Datable.class.isAssignableFrom(type)) { return new DatableFromYearPropertyParser(); } else if (Gender.class.isAssignableFrom(type)) { return new GenderPropertyParser(); } else if (PersonNames.class.isAssignableFrom(type)) { return new PersonNamesDefaultNamePropertyParser(); } else if (LocationNames.class.isAssignableFrom(type)) { return new DefaultLocationNamePropertyParser(); } else if (CollectiveType.class.isAssignableFrom(type)) { return new CollectiveTypePropertyParser(); } else if (DocumentType.class.isAssignableFrom(type)) { return new DocumentTypePropertyParser(); } else if (TempName.class.isAssignableFrom(type)) { return new TempNamePropertyParser(); } else if (List.class.isAssignableFrom(type)) { return new StringListParser(); } throw new UnparsableTypeException("Type " + type + " is not supported"); }  }
PropertyParserFactory { public PropertyParser getParser(Class<?> type) { if (String.class.isAssignableFrom(type)) { return new StringPropertyParser(); } else if (Change.class.isAssignableFrom(type)) { return new ChangeDatePropertyParser(); } else if (Datable.class.isAssignableFrom(type)) { return new DatableFromYearPropertyParser(); } else if (Gender.class.isAssignableFrom(type)) { return new GenderPropertyParser(); } else if (PersonNames.class.isAssignableFrom(type)) { return new PersonNamesDefaultNamePropertyParser(); } else if (LocationNames.class.isAssignableFrom(type)) { return new DefaultLocationNamePropertyParser(); } else if (CollectiveType.class.isAssignableFrom(type)) { return new CollectiveTypePropertyParser(); } else if (DocumentType.class.isAssignableFrom(type)) { return new DocumentTypePropertyParser(); } else if (TempName.class.isAssignableFrom(type)) { return new TempNamePropertyParser(); } else if (List.class.isAssignableFrom(type)) { return new StringListParser(); } throw new UnparsableTypeException("Type " + type + " is not supported"); }  PropertyParser getParser(Class<?> type); PropertyParser getJoinedListParser(String seperator); }
PropertyParserFactory { public PropertyParser getParser(Class<?> type) { if (String.class.isAssignableFrom(type)) { return new StringPropertyParser(); } else if (Change.class.isAssignableFrom(type)) { return new ChangeDatePropertyParser(); } else if (Datable.class.isAssignableFrom(type)) { return new DatableFromYearPropertyParser(); } else if (Gender.class.isAssignableFrom(type)) { return new GenderPropertyParser(); } else if (PersonNames.class.isAssignableFrom(type)) { return new PersonNamesDefaultNamePropertyParser(); } else if (LocationNames.class.isAssignableFrom(type)) { return new DefaultLocationNamePropertyParser(); } else if (CollectiveType.class.isAssignableFrom(type)) { return new CollectiveTypePropertyParser(); } else if (DocumentType.class.isAssignableFrom(type)) { return new DocumentTypePropertyParser(); } else if (TempName.class.isAssignableFrom(type)) { return new TempNamePropertyParser(); } else if (List.class.isAssignableFrom(type)) { return new StringListParser(); } throw new UnparsableTypeException("Type " + type + " is not supported"); }  PropertyParser getParser(Class<?> type); PropertyParser getJoinedListParser(String seperator);  }