GML3GeometryWriter extends AbstractGMLObjectWriter implements GMLGeometryWriter { protected void exportCurveSegment( CurveSegment curveSeg ) throws XMLStreamException, UnknownCRSException, TransformationException { switch ( curveSeg.getSegmentType() ) { case ARC: exportArc( (Arc) curveSeg ); break; case ARC_BY_BULGE: exportArcByBulge( (ArcByBulge) curveSeg ); break; case ARC_BY_CENTER_POINT: exportArcByCenterPoint( (ArcByCenterPoint) curveSeg ); break; case ARC_STRING: exportArcString( (ArcString) curveSeg ); break; case ARC_STRING_BY_BULGE: exportArcStringByBulge( (ArcStringByBulge) curveSeg ); break; case BEZIER: exportBezier( (Bezier) curveSeg ); break; case BSPLINE: exportBSpline( (BSpline) curveSeg ); break; case CIRCLE: exportCircle( (Circle) curveSeg ); break; case CIRCLE_BY_CENTER_POINT: exportCircleByCenterPoint( (CircleByCenterPoint) curveSeg ); break; case CLOTHOID: exportClothoid( (Clothoid) curveSeg ); break; case CUBIC_SPLINE: exportCubicSpline( (CubicSpline) curveSeg ); break; case GEODESIC: exportGeodesic( (Geodesic) curveSeg ); break; case GEODESIC_STRING: exportGeodesicString( (GeodesicString) curveSeg ); break; case LINE_STRING_SEGMENT: exportLineStringSegment( (LineStringSegment) curveSeg ); break; case OFFSET_CURVE: exportOffsetCurve( (OffsetCurve) curveSeg ); break; } } GML3GeometryWriter( GMLStreamWriter gmlStreamWriter ); @SuppressWarnings("unchecked") @Override void export( Geometry geometry ); @Override void exportReference( GeometryReference<Geometry> geometryRef ); @SuppressWarnings("unchecked") @Override void exportMultiGeometry( MultiGeometry<? extends Geometry> geometry ); @Override void exportPoint( Point point ); @Override void exportCurve( Curve curve ); @Override void exportSurface( Surface surface ); @Override void exportTriangulatedSurface( TriangulatedSurface triangSurface ); @Override void exportTin( Tin tin ); @Override void exportSolid( Solid solid ); @Override void exportRing( Ring ring ); @Override void exportCompositeCurve( CompositeCurve compositeCurve ); @Override void exportCompositeSurface( CompositeSurface compositeSurface ); @Override void exportCompositeSolid( CompositeSolid compositeSolid ); @Override void exportEnvelope( Envelope envelope ); @Override void exportCompositeGeometry( CompositeGeometry<GeometricPrimitive> geometryComplex );  }
@Test public void testValidatingExportedCurveSegments() throws XMLStreamException, XMLParsingException, UnknownCRSException, FactoryConfigurationError, IOException, TransformationException { for ( String segmentSource : segmentSources ) { URL docURL = GML3GeometryWriterTest.class.getResource( SEGMENT_DIR + segmentSource ); GMLStreamReader parser = getGML31StreamReader( docURL ); XMLStreamReaderWrapper xmlReader = new XMLStreamReaderWrapper( parser.getXMLReader(), docURL.toString() ); CurveSegment curveSegment = ( (GML3GeometryReader) parser.getGeometryReader() ).getCurveSegmentReader().parseCurveSegment( xmlReader, null ); XMLMemoryStreamWriter memoryWriter = new XMLMemoryStreamWriter(); SchemaLocationXMLStreamWriter writer = new SchemaLocationXMLStreamWriter( memoryWriter.getXMLStreamWriter(), SCHEMA_LOCATION_ATTRIBUTE ); GMLStreamWriter exporter = GMLOutputFactory.createGMLStreamWriter( GML_31, writer ); ( (GML3GeometryWriter) exporter.getGeometryWriter() ).exportCurveSegment( curveSegment ); writer.flush(); XMLAssert.assertValidity( memoryWriter.getReader(), SCHEMA_LOCATION ); } }