GmlTimeInstantReader extends AbstractGmlTimeGeometricPrimitiveReader { public TimeInstant read( final XMLStreamReader xmlStream ) throws XMLStreamException { final String gmlId = parseGmlId( xmlStream ); final String frame = getAttributeValue( xmlStream, FRAME ); final List<Property> props = readGmlStandardProperties( xmlStream ); final List<RelatedTime> relatedTimes = readRelatedTimes( xmlStream ); final TimePosition timePosition = readRequiredTimePosition( xmlStream ); nextElement( xmlStream ); return new GenericTimeInstant( gmlId, props, relatedTimes, frame, timePosition ); } GmlTimeInstantReader( final GMLStreamReader gmlStreamReader ); TimeInstant read( final XMLStreamReader xmlStream );  }
@Test public void readMinimalExample() throws Exception { final GMLStreamReader reader = getGmlStreamReader( "time_instant_minimal.gml" ); final XMLStreamReader xmlStream = reader.getXMLReader(); final TimeInstant timeInstant = new GmlTimeInstantReader( reader ).read( xmlStream ); assertNotNull( timeInstant ); assertEquals( "t11", timeInstant.getId() ); assertNull( timeInstant.getFrame() ); assertEquals( "2001-05-23", timeInstant.getPosition().getValue() ); assertOnEndElement( xmlStream ); }
@Test public void readFullExample() throws Exception { final GMLStreamReader reader = getGmlStreamReader( "time_instant_full.gml" ); final XMLStreamReader xmlStream = reader.getXMLReader(); final TimeInstant timeInstant = new GmlTimeInstantReader( reader ).read( xmlStream ); assertNotNull( timeInstant ); assertEquals( "t11", timeInstant.getId() ); assertEquals( "http: assertNotNull( timeInstant.getPosition() ); assertOnEndElement( xmlStream ); }