Beispiel #1
0
 internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
 {
     if (transition != SpatialValidatorImplementation.NestedValidator.PipelineCall.End)
     {
         throw new FormatException(Strings.Validator_FullGlobeCannotHaveElements);
     }
     validator.Return();
 }
Beispiel #2
0
 internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
 {
     if (transition == SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem)
     {
         validator.Call(SpatialValidatorImplementation.NestedValidator.BeginSpatial);
     }
     else
     {
         SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem, transition);
     }
 }
Beispiel #3
0
 internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
 {
     if (transition == SpatialValidatorImplementation.NestedValidator.PipelineCall.End)
     {
         validator.Return();
     }
     else
     {
         SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.End, transition);
     }
 }
Beispiel #4
0
 internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
 {
     SpatialValidatorImplementation.NestedValidator.PipelineCall call = transition;
     if (call == SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginFigure)
     {
         validator.Jump(SpatialValidatorImplementation.NestedValidator.PointBuilding);
     }
     else if (call == SpatialValidatorImplementation.NestedValidator.PipelineCall.End)
     {
         validator.Return();
     }
     else
     {
         SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginFigure, SpatialValidatorImplementation.NestedValidator.PipelineCall.End, transition);
     }
 }
Beispiel #5
0
                internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
                {
                    switch (transition)
                    {
                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem:
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginPoint:
                        validator.Call(SpatialValidatorImplementation.NestedValidator.PointStart);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.End:
                        validator.Return();
                        return;
                    }
                    SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem, SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginPoint, SpatialValidatorImplementation.NestedValidator.PipelineCall.End, transition);
                }
Beispiel #6
0
                internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
                {
                    switch (transition)
                    {
                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.LineTo:
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.EndFigure:
                        if (validator.pointCount < 2)
                        {
                            throw new FormatException(Strings.Validator_LineStringNeedsTwoPoints);
                        }
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.LineStringEnd);
                        return;
                    }
                    SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.LineTo, SpatialValidatorImplementation.NestedValidator.PipelineCall.EndFigure, transition);
                }
Beispiel #7
0
                internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
                {
                    switch (transition)
                    {
                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem:
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginPoint:
                        validator.Call(SpatialValidatorImplementation.NestedValidator.PointStart);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginLineString:
                        validator.Call(SpatialValidatorImplementation.NestedValidator.LineStringStart);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginPolygon:
                        validator.Call(SpatialValidatorImplementation.NestedValidator.PolygonStart);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginMultiPoint:
                        validator.Call(SpatialValidatorImplementation.NestedValidator.MultiPoint);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginMultiLineString:
                        validator.Call(SpatialValidatorImplementation.NestedValidator.MultiLineString);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginMultiPolygon:
                        validator.Call(SpatialValidatorImplementation.NestedValidator.MultiPolygon);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginCollection:
                        validator.Call(SpatialValidatorImplementation.NestedValidator.Collection);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginFullGlobe:
                        throw new FormatException(Strings.Validator_FullGlobeInCollection);

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.End:
                        validator.Return();
                        return;
                    }
                    SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem, SpatialValidatorImplementation.NestedValidator.PipelineCall.Begin, SpatialValidatorImplementation.NestedValidator.PipelineCall.End, transition);
                }
Beispiel #8
0
 internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
 {
     SpatialValidatorImplementation.NestedValidator.PipelineCall call = transition;
     if (call != SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem)
     {
         if (call == SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginPolygon)
         {
             validator.Call(SpatialValidatorImplementation.NestedValidator.PolygonStart);
         }
         else if (call == SpatialValidatorImplementation.NestedValidator.PipelineCall.End)
         {
             validator.Return();
         }
         else
         {
             SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.SetCoordinateSystem, SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginPolygon, SpatialValidatorImplementation.NestedValidator.PipelineCall.End, transition);
         }
     }
 }
Beispiel #9
0
                internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
                {
                    switch (transition)
                    {
                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginPoint:
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.PointStart);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginLineString:
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.LineStringStart);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginPolygon:
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.PolygonStart);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginMultiPoint:
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.MultiPoint);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginMultiLineString:
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.MultiLineString);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginMultiPolygon:
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.MultiPolygon);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginCollection:
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.Collection);
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginFullGlobe:
                        if (validator.depth != 1)
                        {
                            throw new FormatException(Strings.Validator_FullGlobeInCollection);
                        }
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.FullGlobe);
                        return;
                    }
                    SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.Begin, transition);
                }
Beispiel #10
0
                internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
                {
                    switch (transition)
                    {
                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.LineTo:
                        if (validator.pointCount != 0)
                        {
                            SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.EndFigure, transition);
                        }
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.EndFigure:
                        if (validator.pointCount == 0)
                        {
                            SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.BeginFigure, transition);
                        }
                        validator.Jump(SpatialValidatorImplementation.NestedValidator.PointEnd);
                        return;
                    }
                    SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.EndFigure, transition);
                }
Beispiel #11
0
                internal override void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator)
                {
                    switch (transition)
                    {
                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.LineTo:
                        return;

                    case SpatialValidatorImplementation.NestedValidator.PipelineCall.EndFigure:
                        validator.ringCount++;
                        if (!validator.processingGeography)
                        {
                            SpatialValidatorImplementation.NestedValidator.ValidateGeometryPolygon(validator.pointCount, validator.initialFirstCoordinate, validator.initialSecondCoordinate, validator.mostRecentFirstCoordinate, validator.mostRecentSecondCoordinate);
                            break;
                        }
                        SpatialValidatorImplementation.NestedValidator.ValidateGeographyPolygon(validator.pointCount, validator.initialFirstCoordinate, validator.initialSecondCoordinate, validator.mostRecentFirstCoordinate, validator.mostRecentSecondCoordinate);
                        break;

                    default:
                        SpatialValidatorImplementation.NestedValidator.ValidatorState.ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall.LineTo, SpatialValidatorImplementation.NestedValidator.PipelineCall.EndFigure, transition);
                        return;
                    }
                    validator.Jump(SpatialValidatorImplementation.NestedValidator.PolygonStart);
                }
Beispiel #12
0
 internal abstract void ValidateTransition(SpatialValidatorImplementation.NestedValidator.PipelineCall transition, SpatialValidatorImplementation.NestedValidator validator);
Beispiel #13
0
 protected static void ThrowExpected(SpatialValidatorImplementation.NestedValidator.PipelineCall transition1, SpatialValidatorImplementation.NestedValidator.PipelineCall transition2, SpatialValidatorImplementation.NestedValidator.PipelineCall transition3, SpatialValidatorImplementation.NestedValidator.PipelineCall actual)
 {
     throw new FormatException(Strings.Validator_UnexpectedCall2(transition1 + ", " + transition2, transition3, actual));
 }