TagD extends TagW { public static LocalTime getDicomTime(String time) { if (StringUtil.hasText(time)) { try { return LocalTime.parse(time.trim(), DICOM_TIME); } catch (Exception e) { try { StringBuilder buf = new StringBuilder(8); time.chars().filter(i -> ':' != (char) i).forEachOrdered(i -> buf.append((char) i)); return LocalTime.parse(buf.toString().trim(), DICOM_TIME); } catch (Exception e1) { LOGGER.error("Parse DICOM time", e1); } } } return null; } TagD(int tagID);  TagD(int tagID, int vmMax);  TagD(int tagID, int vmMin, int vmMax);  TagD(int tagID, int vmMin, int vmMax, Object defaultValue);  TagD(int tagID, String privateCreatorID);  TagD(int tagID, String privateCreatorID, int vmMin, int vmMax, Object defaultValue);  TagD(int tagID, String displayedName, String privateCreatorID, int vmMin, int vmMax, Object defaultValue);  TagD(int tagID, String keyword, String displayedName, String privateCreatorID, VR vr, int vmMin, int vmMax,
        Object defaultValue, boolean retired); private  TagD(int tagID, String displayedName, String privateCreatorID, VR vr, int vmMin, int vmMax,
        Object defaultValue); VR getValueRerpesentation(); int getDicomValueMultiplicity(Object value); @Override int hashCode(); @Override boolean equals(Object obj); @Override Object getValue(Object data); @Override boolean isStringFamilyType(); @Override String getFormattedTagValue(Object value, String format); static TagW get(String keyword); static String getKeywordFromTag(int tagID, String privateCreatorID); static TagW get(int tagID); static TagW get(int tagID, String privateCreatorID); static TagW getNullable(int tagID); static TagW getNullable(int tagID, String privateCreatorID); static Object getTagValue(TagReadable tagable, int tagID); static T getTagValue(TagReadable tagable, int tagID, Class<T> type); static TagW[] getTagFromIDs(int... tagID); static TagW getUID(Level level); static LocalDate getDicomDate(String date); static LocalTime getDicomTime(String time); static LocalDateTime getDicomDateTime(TimeZone tz, String value); static LocalDateTime getDicomDateTime(TimeZone tz, String value, boolean ceil); static LocalDateTime dateTime(long dateTimeID, Attributes attributes); static LocalDateTime dateTime(int dateID, int timeID, TagReadable tagable); static String formatDicomDate(LocalDate date); static String formatDicomTime(LocalTime time); static TemporalAccessor getDateFromElement(XMLStreamReader xmler, String attribute, TagType type,
        TemporalAccessor defaultValue); static TemporalAccessor[] getDatesFromElement(XMLStreamReader xmler, String attribute, TagType type,
        TemporalAccessor[] defaultValue); static TemporalAccessor[] getDatesFromElement(XMLStreamReader xmler, String attribute, TagType type,
        TemporalAccessor[] defaultValue, String separator); static String getDicomPeriod(String value); static String getDicomPersonName(String name); static String getDicomPatientSex(String val);  }
@Test public void testGetDicomTime() throws Exception { LocalTime time = TagD.getDicomTime("070907.0705 "); assertEquals(LocalTime.of(7, 9, 7, 70_500_000), time); time = TagD.getDicomTime("10"); assertEquals(LocalTime.of(10, 0), time); time = TagD.getDicomTime("1010"); assertEquals(LocalTime.of(10, 10), time); time = TagD.getDicomTime("021 "); assertEquals(null, time); time = TagD.getDicomTime("07:09:07.0705 "); assertEquals(LocalTime.of(7, 9, 7, 70_500_000), time); }