Project

Profile

Help

Revision 8d20c190

Added by O'Neil Delpratt over 7 years ago

Add comments to methods relating to Parser features and properties

View differences:

latest9.5/hej/net/sf/saxon/lib/ParseOptions.java
195 195
        validationErrorLimit = java.lang.Math.min(validationErrorLimit, options.validationErrorLimit);
196 196
    }
197 197

  
198
    public void addParserFeature(String uri, boolean value){
199
        if(parserFeatures == null) {
200
            parserFeatures = new HashMap<String, Boolean>();
201
        }
202
         parserFeatures.put(uri, new Boolean(value));
203
    }
204

  
205
    public void addParserProperties(String uri, String value){
206
        if(parserProperties == null) {
207
            parserProperties = new HashMap<String, String>();
208
        }
209
         parserProperties.put(uri, value);
210
    }
198
    /**
199
      * Add a parser feature to a map, which will be applied to the XML parser later
200
      *
201
      * @param uri The features as a URIs
202
      * @param value The value given to the feature as boolean
203
      */
204
     public void addParserFeature(String uri, boolean value){
205
         if(parserFeatures == null) {
206
             parserFeatures = new HashMap<String, Boolean>();
207
         }
208
          parserFeatures.put(uri, new Boolean(value));
209
     }
211 210

  
212
    public boolean getParserFeature(String uri){
213
        return parserFeatures.get(uri).booleanValue();
214
    }
211
     /**
212
      * Add a parser property to a map, which is applied to the XML parser later
213
      *
214
      * @param uri The properties as a URIs
215
      * @param value The value given to the properties as a string
216
      */
217
     public void addParserProperties(String uri, String value){
218
         if(parserProperties == null) {
219
             parserProperties = new HashMap<String, String>();
220
         }
221
          parserProperties.put(uri, value);
222
     }
215 223

  
216
    public String getParserProperty(String name){
217
        return parserProperties.get(name);
218
    }
224
     /**
225
      * Get a particular parser feature added
226
      *
227
      * @param uri The feature name as a URIs
228
      * @return The feature value as boolean
229
      */
230
     public boolean getParserFeature(String uri){
231
         return parserFeatures.get(uri).booleanValue();
232
     }
219 233

  
220
    public Map<String, Boolean> getParserFeatures(){
221
        return parserFeatures;
222
    }
234
     /**
235
      * Get a particular parser property added
236
      *
237
      * @param name The properties as a URIs
238
      * @return The property value as string
239
      */
240
     public String getParserProperty(String name){
241
         return parserProperties.get(name);
242
     }
223 243

  
224
    public Map<String, String> getParserProperties(){
225
        return parserProperties;
226
    }
244
     /**
245
      * Get all the parser features added
246
      *
247
      * @return A map of (feature, value) pairs
248
      */
249
     public Map<String, Boolean> getParserFeatures(){
250
         return parserFeatures;
251
     }
227 252

  
253
     /**
254
      * Get all the parser properties added
255
      *
256
      * @return A map of (feature, string) pairs
257
      */
258
     public Map<String, String> getParserProperties(){
259
         return parserProperties;
260
     }
228 261

  
229 262

  
230 263
    /**
......
236 269
    public void applyDefaults(/*@NotNull*/ Configuration config) {
237 270
        if (dtdValidation == Validation.DEFAULT) {
238 271
            dtdValidation = config.isValidation() ? Validation.STRICT : Validation.SKIP;
239
        }        
272
        }
240 273
        if (schemaValidation == Validation.DEFAULT) {
241 274
            schemaValidation = config.getSchemaValidationMode();
242 275
        }

Also available in: Unified diff