@Test public void testExtractPageNumbers_standardCase() throws Exception { final String[] input = target.extractPageNumbers("123-124"); assertThat(input.length, is(2)); assertThat(input[0], is("123")); assertThat(input[1], is("124")); }
String[] extractPageNumbers(String text) { if (text.length() < 10) { if (text.contains("-") && text.length() > 3) { return text.split("-"); } else { return new String[]{text}; } } return new String[0]; }
PublicationTeiDocumentStaxHandler implements StaxParserContentHandler { String[] extractPageNumbers(String text) { if (text.length() < 10) { if (text.contains("-") && text.length() > 3) { return text.split("-"); } else { return new String[]{text}; } } return new String[0]; } }
PublicationTeiDocumentStaxHandler implements StaxParserContentHandler { String[] extractPageNumbers(String text) { if (text.length() < 10) { if (text.contains("-") && text.length() > 3) { return text.split("-"); } else { return new String[]{text}; } } return new String[0]; } PublicationTeiDocumentStaxHandler();  PublicationTeiDocumentStaxHandler(Publication publication); }
PublicationTeiDocumentStaxHandler implements StaxParserContentHandler { String[] extractPageNumbers(String text) { if (text.length() < 10) { if (text.contains("-") && text.length() > 3) { return text.split("-"); } else { return new String[]{text}; } } return new String[0]; } PublicationTeiDocumentStaxHandler();  PublicationTeiDocumentStaxHandler(Publication publication); @Override void onStartDocument(XMLStreamReader2 reader); @Override void onEndDocument(XMLStreamReader2 reader); @Override void onStartElement(XMLStreamReader2 reader); @Override void onEndElement(XMLStreamReader2 reader); @Override void onCharacter(XMLStreamReader2 reader); In_Serial getInSerial(); Publication getPublication(); Monograph getMonogr(); Collection getCollection(); Journal getJournal(); List<Serial_Identifier> getSerialIdentifiers(); Conference_Event getConferenceEvent(); Address getAddress(); }
PublicationTeiDocumentStaxHandler implements StaxParserContentHandler { String[] extractPageNumbers(String text) { if (text.length() < 10) { if (text.contains("-") && text.length() > 3) { return text.split("-"); } else { return new String[]{text}; } } return new String[0]; } PublicationTeiDocumentStaxHandler();  PublicationTeiDocumentStaxHandler(Publication publication); @Override void onStartDocument(XMLStreamReader2 reader); @Override void onEndDocument(XMLStreamReader2 reader); @Override void onStartElement(XMLStreamReader2 reader); @Override void onEndElement(XMLStreamReader2 reader); @Override void onCharacter(XMLStreamReader2 reader); In_Serial getInSerial(); Publication getPublication(); Monograph getMonogr(); Collection getCollection(); Journal getJournal(); List<Serial_Identifier> getSerialIdentifiers(); Conference_Event getConferenceEvent(); Address getAddress();  }