GmlTimePositionTypeReader { public TimePosition read( final XMLStreamReader xmlStream ) throws XMLStreamException { final String frame = getAttributeValue( xmlStream, FRAME ); final String calendarEraName = getAttributeValue( xmlStream, CALENDAR_ERA_NAME ); final IndeterminateValue indeterminatePosition = parseIndeterminateValueIfPresent( xmlStream ); final String timePositionUnion = xmlStream.getElementText().trim(); return new TimePosition( frame, calendarEraName, indeterminatePosition, timePositionUnion ); }  TimePosition read( final XMLStreamReader xmlStream );  }
@Test public void readMinimalExample() throws Exception { final GMLStreamReader reader = getGmlStreamReader( "time_position_minimal.gml" ); final XMLStreamReader xmlStream = reader.getXMLReader(); final TimePosition timePosition = new GmlTimePositionTypeReader().read( xmlStream ); assertNotNull( timePosition ); assertNull( timePosition.getFrame() ); assertNull( timePosition.getCalendarEraName() ); assertNull( timePosition.getIndeterminatePosition() ); assertEquals( "2001-05-23", timePosition.getValue() ); assertOnEndElement( xmlStream ); }
@Test public void readFullExample() throws Exception { final GMLStreamReader reader = getGmlStreamReader( "time_position_full.gml" ); final XMLStreamReader xmlStream = reader.getXMLReader(); final TimePosition timePosition = new GmlTimePositionTypeReader().read( xmlStream ); assertNotNull( timePosition ); assertEquals( "http: assertEquals( "Meiji", timePosition.getCalendarEraName() ); assertEquals( BEFORE, timePosition.getIndeterminatePosition() ); assertEquals( "0025-03", timePosition.getValue() ); assertOnEndElement( xmlStream ); }