Package 

Class ValidationPreferences


  • 
    public class ValidationPreferences
    
                        

    This class allows the client to relax the level of validation when reading a shape file. When instantiated, all validations are turned on by default, so the client can specifically turn off the required ones.

    • Method Detail

      • setForceShapeType

         void setForceShapeType(ShapeType forceShapeType)

        Forces the shape type to a specific type, disabling its validation. Setthis value to null to enable the validation. Defaults to null.

      • setAllowBadRecordNumbers

         void setAllowBadRecordNumbers(boolean allowBadRecordNumbers)

        Inhibits the validation of the record numbers; a correct shape file musthave sequential record numbers, starting at 1. Defaults to false.

      • setAllowBadContentLength

         void setAllowBadContentLength(boolean allowBadContentLength)

        Inhibits the validation of the content length of each shape. Defaults tofalse.

      • setAllowMultipleShapeTypes

         void setAllowMultipleShapeTypes(boolean allowMultipleShapeTypes)

        Allows shapes of multiple types in the file; in a correct shape file allshapes must be of a single type, specified on the header of the file.Defaults to false.

      • setAllowUnlimitedNumberOfPointsPerShape

         void setAllowUnlimitedNumberOfPointsPerShape(boolean allowUnlimitedNumberOfPointsPerShape)

        Allows any (positive) number of points per shape. It's strongly advised toalways limit the number of points per shape; otherwise, a corrupt file witha gigantic (garbage) number of points may crash the reader with anOutOfMemory error. Defaults to false, with a default limit of 10000.

      • setMaxNumberOfPointsPerShape

         void setMaxNumberOfPointsPerShape(int maxItems)

        Specifies the maximum number of points a shape can have. If a shape isfound with a larger number of points a exception is thrown showing thenumber of points it has. This parameter can be adjusted for differentfiles, or turned off with the methodsetAllowUnlimitedNumberOfPointsPerShape(). Defaults to 10000.

      • setForcePartType

         void setForcePartType(PartType forcePartType)

        Forces the part types to a specific type, disabling its validation. Setthis value to null to enable the validation. Defaults to null.