@Test public void testRead() { ModsDefinition mods = ModsUtils.unmarshal(MonographUnitMapperTest.class.getResource("monograph_unit_mods.xml"), ModsDefinition.class); MonographUnitMapper instance = new MonographUnitMapper(); MonographUnit result = instance.map(mods); assertEquals("Zbirka 1", result.getNumber()); assertNull(result.getNote()); }
@Override public MonographUnit map(ModsDefinition mods) { NodeLookup nlookup = new NodeLookup(mods); MonographUnit result = new MonographUnit(); IdentifierMapper identifierMap = new IdentifierMapper(); result.setIdentifiers(identifierMap.map(mods)); StringPlusLanguage number = nlookup.getNumber(false); result.setNumber(number == null ? null : number.getValue()); Text note = nlookup.getNote(false); result.setNote(note == null ? null : note.getValue()); return result; }
MonographUnitMapper implements Mapper<MonographUnit> { @Override public MonographUnit map(ModsDefinition mods) { NodeLookup nlookup = new NodeLookup(mods); MonographUnit result = new MonographUnit(); IdentifierMapper identifierMap = new IdentifierMapper(); result.setIdentifiers(identifierMap.map(mods)); StringPlusLanguage number = nlookup.getNumber(false); result.setNumber(number == null ? null : number.getValue()); Text note = nlookup.getNote(false); result.setNote(note == null ? null : note.getValue()); return result; } }
MonographUnitMapper implements Mapper<MonographUnit> { @Override public MonographUnit map(ModsDefinition mods) { NodeLookup nlookup = new NodeLookup(mods); MonographUnit result = new MonographUnit(); IdentifierMapper identifierMap = new IdentifierMapper(); result.setIdentifiers(identifierMap.map(mods)); StringPlusLanguage number = nlookup.getNumber(false); result.setNumber(number == null ? null : number.getValue()); Text note = nlookup.getNote(false); result.setNote(note == null ? null : note.getValue()); return result; }  }
MonographUnitMapper implements Mapper<MonographUnit> { @Override public MonographUnit map(ModsDefinition mods) { NodeLookup nlookup = new NodeLookup(mods); MonographUnit result = new MonographUnit(); IdentifierMapper identifierMap = new IdentifierMapper(); result.setIdentifiers(identifierMap.map(mods)); StringPlusLanguage number = nlookup.getNumber(false); result.setNumber(number == null ? null : number.getValue()); Text note = nlookup.getNote(false); result.setNote(note == null ? null : note.getValue()); return result; }  @Override MonographUnit map(ModsDefinition mods); @Override ModsDefinition map(ModsDefinition mods, MonographUnit munit); }
MonographUnitMapper implements Mapper<MonographUnit> { @Override public MonographUnit map(ModsDefinition mods) { NodeLookup nlookup = new NodeLookup(mods); MonographUnit result = new MonographUnit(); IdentifierMapper identifierMap = new IdentifierMapper(); result.setIdentifiers(identifierMap.map(mods)); StringPlusLanguage number = nlookup.getNumber(false); result.setNumber(number == null ? null : number.getValue()); Text note = nlookup.getNote(false); result.setNote(note == null ? null : note.getValue()); return result; }  @Override MonographUnit map(ModsDefinition mods); @Override ModsDefinition map(ModsDefinition mods, MonographUnit munit);  }