/** * Set a configuration option * @param name the name of the option to be set. The names of the options available are listed * as constants in class {@link net.sf.saxon.FeatureKeys} * @param value the value of the option to be set. The type of the value depends on the option * that is being set * @throws IllegalArgumentException if the property name is not recognized */ // TODO: make this a typesafe method public void setConfigurationProperty(String name, Object value) { config.setConfigurationProperty(name, value); }
/** * Set a boolean property of the configuration * * @param propertyName the name of the required property. See the class {@link FeatureKeys} for * constants representing the property names that can be requested. This class only recognizes * properties whose type is boolean. * @param value the value of the property. * @throws IllegalArgumentException if the property name is not recognized (as a property whose expected * value is boolean) */ public void setBooleanProperty(String propertyName, boolean value) { setConfigurationProperty(propertyName, value); }
/** * Set a boolean property of the configuration * * @param feature the required property. See the class {@link Feature} for * constants representing the property names that can be requested. This class only recognizes * properties whose type is boolean. * @param value the value of the property. * @throws IllegalArgumentException if the feature is not recognized (as a feature whose expected * value is boolean) */ public void setBooleanProperty(Feature<Boolean> feature, boolean value) { setConfigurationProperty(feature, value); }
/** * Set a boolean property of the configuration * * @param propertyName the name of the required property. See the class {@link FeatureKeys} for * constants representing the property names that can be requested. This class only recognizes * properties whose type is boolean. * @param value the value of the property. * @throws IllegalArgumentException if the property name is not recognized (as a property whose expected * value is boolean) */ public void setBooleanProperty(String propertyName, boolean value) { setConfigurationProperty(propertyName, value); }
/** * Set a boolean property of the configuration * * @param feature the required property. See the class {@link Feature} for * constants representing the property names that can be requested. This class only recognizes * properties whose type is boolean. * @param value the value of the property. * @throws IllegalArgumentException if the feature is not recognized (as a feature whose expected * value is boolean) */ public void setBooleanProperty(Feature<Boolean> feature, boolean value) { setConfigurationProperty(feature, value); }
/** * Set a configuration property * * @param feature the option to be set. The names of the options available are listed * as constants in class {@link net.sf.saxon.lib.Feature}. * @param value the value of the option to be set (which must be of the appropriate type for the * particular feature. * @throws IllegalArgumentException if the supplied value is not a valid value for the selected feature. * @since 9.9 introduced to give a faster and type-safe alternative to * {@link #setConfigurationProperty(String, Object)} */ public <T> void setConfigurationProperty(Feature<T> feature, T value) { if (feature == Feature.CONFIGURATION) { config = (Configuration) value; } else { config.setConfigurationProperty(feature, value); } }
/** * Set a configuration property * * @param feature the option to be set. The names of the options available are listed * as constants in class {@link net.sf.saxon.lib.Feature}. * @param value the value of the option to be set (which must be of the appropriate type for the * particular feature. * @throws IllegalArgumentException if the supplied value is not a valid value for the selected feature. * @since 9.9 introduced to give a faster and type-safe alternative to * {@link #setConfigurationProperty(String, Object)} */ public <T> void setConfigurationProperty(Feature<T> feature, T value) { if (feature == Feature.CONFIGURATION) { config = (Configuration) value; } else { config.setConfigurationProperty(feature, value); } }
/** * Set a configuration property * * @param name the name of the option to be set. The names of the options available are listed * as constants in class {@link net.sf.saxon.lib.FeatureKeys}. * @param value the value of the option to be set. * @throws IllegalArgumentException if the property name is not recognized or if the supplied value * is not a valid value for the named property. * @deprecated since 9.9 - use {@link #setConfigurationProperty(Feature, Object)} */ public void setConfigurationProperty(/*@NotNull*/ String name, /*@NotNull*/ Object value) { if (name.equals(FeatureKeys.CONFIGURATION)) { config = (Configuration) value; } else { config.setConfigurationProperty(name, value); } }
/** * Set a configuration property * * @param name the name of the option to be set. The names of the options available are listed * as constants in class {@link net.sf.saxon.lib.FeatureKeys}. * @param value the value of the option to be set. * @throws IllegalArgumentException if the property name is not recognized or if the supplied value * is not a valid value for the named property. * @deprecated since 9.9 - use {@link #setConfigurationProperty(Feature, Object)} */ public void setConfigurationProperty(/*@NotNull*/ String name, /*@NotNull*/ Object value) { if (name.equals(FeatureKeys.CONFIGURATION)) { config = (Configuration) value; } else { config.setConfigurationProperty(name, value); } }
/** * Allows the user to set specific attributes on the underlying * implementation. An attribute in this context is defined to * be an option that the implementation provides. * * @param name The name of the attribute. This must be one of the constants * defined in class {@link net.sf.saxon.FeatureKeys}. * @param value The value of the attribute. * @throws IllegalArgumentException thrown if Saxon * doesn't recognize the attribute. * @see net.sf.saxon.FeatureKeys */ public void setAttribute(String name, Object value) throws IllegalArgumentException { if (name.equals(FeatureKeys.CONFIGURATION)) { config = (Configuration)value; } else { config.setConfigurationProperty(name, value); } }
/** * Allows the user to set specific attributes on the underlying * implementation. An attribute in this context is defined to * be an option that the implementation provides. * * @param name The name of the attribute. This must be one of the constants * defined in class {@link net.sf.saxon.FeatureKeys}. * @param value The value of the attribute. * @throws IllegalArgumentException thrown if Saxon * doesn't recognize the attribute. * @see net.sf.saxon.FeatureKeys */ public void setAttribute(String name, Object value) throws IllegalArgumentException { if (name.equals(FeatureKeys.CONFIGURATION)) { config = (Configuration)value; } else { config.setConfigurationProperty(name, value); } }
private void readLocalizationsElement(Attributes atts) { for (int i = 0; i < atts.getLength(); i++) { if (atts.getURI(i).isEmpty()) { String name = atts.getLocalName(i); String value = atts.getValue(i); if ("defaultLanguage".equals(name) && !value.isEmpty()) { config.setConfigurationProperty(FeatureKeys.DEFAULT_LANGUAGE, value); } if ("defaultCountry".equals(name) && !value.isEmpty()) { config.setConfigurationProperty(FeatureKeys.DEFAULT_COUNTRY, value); } } } }
private void readLocalizationsElement(Attributes atts) { for (int i = 0; i < atts.getLength(); i++) { if (atts.getURI(i).isEmpty()) { String name = atts.getLocalName(i); String value = atts.getValue(i); if ("defaultLanguage".equals(name) && value.length() > 0) { config.setConfigurationProperty(FeatureKeys.DEFAULT_LANGUAGE, value); } if ("defaultCountry".equals(name) && value.length() > 0) { config.setConfigurationProperty(FeatureKeys.DEFAULT_COUNTRY, value); } } } }
/** * @param outputFormat * currently supported: String, Writer, OutputStream * @param classLoader * class loader for resource retrieval, may be <code>null</code> * @param globalParams * static XQuery parameters */ public XqjTransmogrifier( Class<T> outputFormat, ClassLoader classLoader, Map<String, Object> globalParams) { super(classLoader); this.outputFormat = outputFormat; if (globalParams != null) { for (Entry<String, Object> entry : globalParams.entrySet()) { XQUERY_GLOBAL_CONFIG.setConfigurationProperty(entry.getKey(), entry.getValue()); } } }
/** * Allows the user to set specific attributes on the underlying * implementation. * @param name The name of the attribute. For Saxon this must be one of the * names defined in {@link FeatureKeys} * @param value The value of the attribute. * @exception IllegalArgumentException thrown if the underlying * implementation doesn't recognize the attribute. */ public void setAttribute(String name, Object value) { if (name.equals(FeatureKeys.CONFIGURATION)) { config = (Configuration)value; } else { if (config == null) { config = new Configuration(); } config.setConfigurationProperty(name, value); } }
private void applyProperty(Properties props, String propertyName, String featureKey) { String value = props.getProperty(propertyName); if (value != null) { try { config.setConfigurationProperty(featureKey, value); } catch (IllegalArgumentException e) { String message = e.getMessage(); if (message.startsWith(featureKey)) { message = message.replace(featureKey, "Value"); } if (message.startsWith("Unknown configuration property")) { message = "Property not available in Saxon-" + config.getEditionCode(); } error(props.getProperty("#element"), propertyName, value, message); } } }
private void applyProperty(Properties props, String propertyName, String featureKey) { String value = props.getProperty(propertyName); if (value != null) { try { config.setConfigurationProperty(featureKey, value); } catch (IllegalArgumentException e) { String message = e.getMessage(); if (message.startsWith(featureKey)) { message = message.replace(featureKey, "Value"); } if (message.startsWith("Unknown configuration property")) { message = "Property not available in Saxon-" + config.getEditionCode(); } error(props.getProperty("#element"), propertyName, value, message); } } }
processor.getUnderlyingConfiguration().setConfigurationProperty(name, value); break;
processor.getUnderlyingConfiguration().setConfigurationProperty(name, value); break;
Configuration config = processor.getUnderlyingConfiguration(); config.setDocumentNumberAllocator(new DocIDNumberAllocator()); config.setConfigurationProperty(FeatureKeys.XQUERY_PRESERVE_NAMESPACES, false);