Java Code Examples for com.sun.org.apache.xerces.internal.xni.parser.XMLComponent#getRecognizedFeatures()

The following examples show how to use com.sun.org.apache.xerces.internal.xni.parser.XMLComponent#getRecognizedFeatures() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DOMConfigurationImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
protected void addComponent(XMLComponent component) {

        // don't add a component more than once
        if (fComponents.contains(component)) {
            return;
        }
        fComponents.add(component);

        // register component's recognized features
        String[] recognizedFeatures = component.getRecognizedFeatures();
        addRecognizedFeatures(recognizedFeatures);

        // register component's recognized properties
        String[] recognizedProperties = component.getRecognizedProperties();
        addRecognizedProperties(recognizedProperties);

    }
 
Example 2
Source File: DOMConfigurationImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
protected void addComponent(XMLComponent component) {

        // don't add a component more than once
        if (fComponents.contains(component)) {
            return;
        }
        fComponents.add(component);

        // register component's recognized features
        String[] recognizedFeatures = component.getRecognizedFeatures();
        addRecognizedFeatures(recognizedFeatures);

        // register component's recognized properties
        String[] recognizedProperties = component.getRecognizedProperties();
        addRecognizedProperties(recognizedProperties);

    }
 
Example 3
Source File: DOMConfigurationImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
protected void addComponent(XMLComponent component) {

        // don't add a component more than once
        if (fComponents.contains(component)) {
            return;
        }
        fComponents.add(component);

        // register component's recognized features
        String[] recognizedFeatures = component.getRecognizedFeatures();
        addRecognizedFeatures(recognizedFeatures);

        // register component's recognized properties
        String[] recognizedProperties = component.getRecognizedProperties();
        addRecognizedProperties(recognizedProperties);

    }
 
Example 4
Source File: DOMConfigurationImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
protected void addComponent(XMLComponent component) {

        // don't add a component more than once
        if (fComponents.contains(component)) {
            return;
        }
        fComponents.add(component);

        // register component's recognized features
        String[] recognizedFeatures = component.getRecognizedFeatures();
        addRecognizedFeatures(recognizedFeatures);

        // register component's recognized properties
        String[] recognizedProperties = component.getRecognizedProperties();
        addRecognizedProperties(recognizedProperties);

    }
 
Example 5
Source File: XMLSchemaValidatorComponentManager.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Adds all of the component's recognized features and properties
 * to the list of default recognized features and properties, and
 * sets default values on the configuration for features and
 * properties which were previously absent from the configuration.
 *
 * @param component The component whose recognized features
 * and properties will be added to the configuration
 */
public void addRecognizedParamsAndSetDefaults(XMLComponent component, XSGrammarPoolContainer grammarContainer) {

    // register component's recognized features
    final String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    final String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    setFeatureDefaults(component, recognizedFeatures, grammarContainer);
    setPropertyDefaults(component, recognizedProperties);
}
 
Example 6
Source File: BasicParserConfiguration.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds a component to the parser configuration. This method will
 * also add all of the component's recognized features and properties
 * to the list of default recognized features and properties.
 *
 * @param component The component to add.
 */
protected void addComponent(XMLComponent component) {

    // don't add a component more than once
    if (fComponents.contains(component)) {
        return;
    }
    fComponents.add(component);

    // register component's recognized features
    String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; i++) {
            String featureId = recognizedFeatures[i];
            Boolean state = component.getFeatureDefault(featureId);
            if (state != null) {
                super.setFeature(featureId, state.booleanValue());
            }
        }
    }
    if (recognizedProperties != null) {
        for (int i = 0; i < recognizedProperties.length; i++) {
            String propertyId = recognizedProperties[i];
            Object value = component.getPropertyDefault(propertyId);
            if (value != null) {
                super.setProperty(propertyId, value);
            }
        }
    }

}
 
Example 7
Source File: BasicParserConfiguration.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds a component to the parser configuration. This method will
 * also add all of the component's recognized features and properties
 * to the list of default recognized features and properties.
 *
 * @param component The component to add.
 */
protected void addComponent(XMLComponent component) {

    // don't add a component more than once
    if (fComponents.contains(component)) {
        return;
    }
    fComponents.add(component);

    // register component's recognized features
    String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; i++) {
            String featureId = recognizedFeatures[i];
            Boolean state = component.getFeatureDefault(featureId);
            if (state != null) {
                super.setFeature(featureId, state.booleanValue());
            }
        }
    }
    if (recognizedProperties != null) {
        for (int i = 0; i < recognizedProperties.length; i++) {
            String propertyId = recognizedProperties[i];
            Object value = component.getPropertyDefault(propertyId);
            if (value != null) {
                super.setProperty(propertyId, value);
            }
        }
    }

}
 
Example 8
Source File: BasicParserConfiguration.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Adds a component to the parser configuration. This method will
 * also add all of the component's recognized features and properties
 * to the list of default recognized features and properties.
 *
 * @param component The component to add.
 */
protected void addComponent(XMLComponent component) {

    // don't add a component more than once
    if (fComponents.contains(component)) {
        return;
    }
    fComponents.add(component);

    // register component's recognized features
    String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; i++) {
            String featureId = recognizedFeatures[i];
            Boolean state = component.getFeatureDefault(featureId);
            if (state != null) {
                super.setFeature(featureId, state.booleanValue());
            }
        }
    }
    if (recognizedProperties != null) {
        for (int i = 0; i < recognizedProperties.length; i++) {
            String propertyId = recognizedProperties[i];
            Object value = component.getPropertyDefault(propertyId);
            if (value != null) {
                super.setProperty(propertyId, value);
            }
        }
    }

}
 
Example 9
Source File: XMLSchemaValidatorComponentManager.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds all of the component's recognized features and properties
 * to the list of default recognized features and properties, and
 * sets default values on the configuration for features and
 * properties which were previously absent from the configuration.
 *
 * @param component The component whose recognized features
 * and properties will be added to the configuration
 */
public void addRecognizedParamsAndSetDefaults(XMLComponent component, XSGrammarPoolContainer grammarContainer) {

    // register component's recognized features
    final String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    final String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    setFeatureDefaults(component, recognizedFeatures, grammarContainer);
    setPropertyDefaults(component, recognizedProperties);
}
 
Example 10
Source File: XMLSchemaValidatorComponentManager.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds all of the component's recognized features and properties
 * to the list of default recognized features and properties, and
 * sets default values on the configuration for features and
 * properties which were previously absent from the configuration.
 *
 * @param component The component whose recognized features
 * and properties will be added to the configuration
 */
public void addRecognizedParamsAndSetDefaults(XMLComponent component, XSGrammarPoolContainer grammarContainer) {

    // register component's recognized features
    final String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    final String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    setFeatureDefaults(component, recognizedFeatures, grammarContainer);
    setPropertyDefaults(component, recognizedProperties);
}
 
Example 11
Source File: BasicParserConfiguration.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds a component to the parser configuration. This method will
 * also add all of the component's recognized features and properties
 * to the list of default recognized features and properties.
 *
 * @param component The component to add.
 */
protected void addComponent(XMLComponent component) {

    // don't add a component more than once
    if (fComponents.contains(component)) {
        return;
    }
    fComponents.add(component);

    // register component's recognized features
    String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; i++) {
            String featureId = recognizedFeatures[i];
            Boolean state = component.getFeatureDefault(featureId);
            if (state != null) {
                super.setFeature(featureId, state.booleanValue());
            }
        }
    }
    if (recognizedProperties != null) {
        for (int i = 0; i < recognizedProperties.length; i++) {
            String propertyId = recognizedProperties[i];
            Object value = component.getPropertyDefault(propertyId);
            if (value != null) {
                super.setProperty(propertyId, value);
            }
        }
    }

}
 
Example 12
Source File: BasicParserConfiguration.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Adds a component to the parser configuration. This method will
 * also add all of the component's recognized features and properties
 * to the list of default recognized features and properties.
 *
 * @param component The component to add.
 */
protected void addComponent(XMLComponent component) {

    // don't add a component more than once
    if (fComponents.contains(component)) {
        return;
    }
    fComponents.add(component);

    // register component's recognized features
    String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; i++) {
            String featureId = recognizedFeatures[i];
            Boolean state = component.getFeatureDefault(featureId);
            if (state != null) {
                super.setFeature(featureId, state.booleanValue());
            }
        }
    }
    if (recognizedProperties != null) {
        for (int i = 0; i < recognizedProperties.length; i++) {
            String propertyId = recognizedProperties[i];
            Object value = component.getPropertyDefault(propertyId);
            if (value != null) {
                super.setProperty(propertyId, value);
            }
        }
    }

}
 
Example 13
Source File: XML11NonValidatingConfiguration.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Adds all of the component's recognized features and properties
 * to the list of default recognized features and properties, and
 * sets default values on the configuration for features and
 * properties which were previously absent from the configuration.
 *
 * @param component The component whose recognized features
 * and properties will be added to the configuration
 */
protected void addRecognizedParamsAndSetDefaults(XMLComponent component) {

    // register component's recognized features
    String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; ++i) {
            String featureId = recognizedFeatures[i];
            Boolean state = component.getFeatureDefault(featureId);
            if (state != null) {
                // Do not overwrite values already set on the configuration.
                if (!fFeatures.containsKey(featureId)) {
                    fFeatures.put(featureId, state);
                    // For newly added components who recognize this feature
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
    if (recognizedProperties != null) {
        for (int i = 0; i < recognizedProperties.length; ++i) {
            String propertyId = recognizedProperties[i];
            Object value = component.getPropertyDefault(propertyId);
            if (value != null) {
                // Do not overwrite values already set on the configuration.
                if (!fProperties.containsKey(propertyId)) {
                    fProperties.put(propertyId, value);
                    // For newly added components who recognize this property
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
}
 
Example 14
Source File: XML11DTDConfiguration.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Adds all of the component's recognized features and properties
 * to the list of default recognized features and properties, and
 * sets default values on the configuration for features and
 * properties which were previously absent from the configuration.
 *
 * @param component The component whose recognized features
 * and properties will be added to the configuration
 */
protected void addRecognizedParamsAndSetDefaults(XMLComponent component) {

    // register component's recognized features
    String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; ++i) {
            String featureId = recognizedFeatures[i];
            Boolean state = component.getFeatureDefault(featureId);
            if (state != null) {
                // Do not overwrite values already set on the configuration.
                if (!fFeatures.containsKey(featureId)) {
                    fFeatures.put(featureId, state);
                    // For newly added components who recognize this feature
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
    if (recognizedProperties != null) {
        for (int i = 0; i < recognizedProperties.length; ++i) {
            String propertyId = recognizedProperties[i];
            Object value = component.getPropertyDefault(propertyId);
            if (value != null) {
                // Do not overwrite values already set on the configuration.
                if (!fProperties.containsKey(propertyId)) {
                    fProperties.put(propertyId, value);
                    // For newly added components who recognize this property
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
}
 
Example 15
Source File: XML11NonValidatingConfiguration.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Adds all of the component's recognized features and properties
 * to the list of default recognized features and properties, and
 * sets default values on the configuration for features and
 * properties which were previously absent from the configuration.
 *
 * @param component The component whose recognized features
 * and properties will be added to the configuration
 */
protected void addRecognizedParamsAndSetDefaults(XMLComponent component) {

    // register component's recognized features
    String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; ++i) {
            String featureId = recognizedFeatures[i];
            Boolean state = component.getFeatureDefault(featureId);
            if (state != null) {
                // Do not overwrite values already set on the configuration.
                if (!fFeatures.containsKey(featureId)) {
                    fFeatures.put(featureId, state);
                    // For newly added components who recognize this feature
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
    if (recognizedProperties != null) {
        for (int i = 0; i < recognizedProperties.length; ++i) {
            String propertyId = recognizedProperties[i];
            Object value = component.getPropertyDefault(propertyId);
            if (value != null) {
                // Do not overwrite values already set on the configuration.
                if (!fProperties.containsKey(propertyId)) {
                    fProperties.put(propertyId, value);
                    // For newly added components who recognize this property
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
}
 
Example 16
Source File: XML11NonValidatingConfiguration.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
/**
 * Adds all of the component's recognized features and properties
 * to the list of default recognized features and properties, and
 * sets default values on the configuration for features and
 * properties which were previously absent from the configuration.
 *
 * @param component The component whose recognized features
 * and properties will be added to the configuration
 */
protected void addRecognizedParamsAndSetDefaults(XMLComponent component) {

    // register component's recognized features
    String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; ++i) {
            String featureId = recognizedFeatures[i];
            Boolean state = component.getFeatureDefault(featureId);
            if (state != null) {
                // Do not overwrite values already set on the configuration.
                if (!fFeatures.containsKey(featureId)) {
                    fFeatures.put(featureId, state);
                    // For newly added components who recognize this feature
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
    if (recognizedProperties != null) {
        for (int i = 0; i < recognizedProperties.length; ++i) {
            String propertyId = recognizedProperties[i];
            Object value = component.getPropertyDefault(propertyId);
            if (value != null) {
                // Do not overwrite values already set on the configuration.
                if (!fProperties.containsKey(propertyId)) {
                    fProperties.put(propertyId, value);
                    // For newly added components who recognize this property
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
}
 
Example 17
Source File: XML11NonValidatingConfiguration.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Adds all of the component's recognized features and properties
 * to the list of default recognized features and properties, and
 * sets default values on the configuration for features and
 * properties which were previously absent from the configuration.
 *
 * @param component The component whose recognized features
 * and properties will be added to the configuration
 */
protected void addRecognizedParamsAndSetDefaults(XMLComponent component) {

    // register component's recognized features
    String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; ++i) {
            String featureId = recognizedFeatures[i];
            Boolean state = component.getFeatureDefault(featureId);
            if (state != null) {
                // Do not overwrite values already set on the configuration.
                if (!fFeatures.containsKey(featureId)) {
                    fFeatures.put(featureId, state);
                    // For newly added components who recognize this feature
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
    if (recognizedProperties != null) {
        for (int i = 0; i < recognizedProperties.length; ++i) {
            String propertyId = recognizedProperties[i];
            Object value = component.getPropertyDefault(propertyId);
            if (value != null) {
                // Do not overwrite values already set on the configuration.
                if (!fProperties.containsKey(propertyId)) {
                    fProperties.put(propertyId, value);
                    // For newly added components who recognize this property
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
}
 
Example 18
Source File: XML11NonValidatingConfiguration.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
/**
 * Adds all of the component's recognized features and properties
 * to the list of default recognized features and properties, and
 * sets default values on the configuration for features and
 * properties which were previously absent from the configuration.
 *
 * @param component The component whose recognized features
 * and properties will be added to the configuration
 */
protected void addRecognizedParamsAndSetDefaults(XMLComponent component) {

    // register component's recognized features
    String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; ++i) {
            String featureId = recognizedFeatures[i];
            Boolean state = component.getFeatureDefault(featureId);
            if (state != null) {
                // Do not overwrite values already set on the configuration.
                if (!fFeatures.containsKey(featureId)) {
                    fFeatures.put(featureId, state);
                    // For newly added components who recognize this feature
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
    if (recognizedProperties != null) {
        for (int i = 0; i < recognizedProperties.length; ++i) {
            String propertyId = recognizedProperties[i];
            Object value = component.getPropertyDefault(propertyId);
            if (value != null) {
                // Do not overwrite values already set on the configuration.
                if (!fProperties.containsKey(propertyId)) {
                    fProperties.put(propertyId, value);
                    // For newly added components who recognize this property
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
}
 
Example 19
Source File: XML11DTDConfiguration.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Adds all of the component's recognized features and properties
 * to the list of default recognized features and properties, and
 * sets default values on the configuration for features and
 * properties which were previously absent from the configuration.
 *
 * @param component The component whose recognized features
 * and properties will be added to the configuration
 */
protected void addRecognizedParamsAndSetDefaults(XMLComponent component) {

    // register component's recognized features
    String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; ++i) {
            String featureId = recognizedFeatures[i];
            Boolean state = component.getFeatureDefault(featureId);
            if (state != null) {
                // Do not overwrite values already set on the configuration.
                if (!fFeatures.containsKey(featureId)) {
                    fFeatures.put(featureId, state);
                    // For newly added components who recognize this feature
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
    if (recognizedProperties != null) {
        for (int i = 0; i < recognizedProperties.length; ++i) {
            String propertyId = recognizedProperties[i];
            Object value = component.getPropertyDefault(propertyId);
            if (value != null) {
                // Do not overwrite values already set on the configuration.
                if (!fProperties.containsKey(propertyId)) {
                    fProperties.put(propertyId, value);
                    // For newly added components who recognize this property
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
}
 
Example 20
Source File: SchemaParsingConfig.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Adds all of the component's recognized features and properties
 * to the list of default recognized features and properties, and
 * sets default values on the configuration for features and
 * properties which were previously absent from the configuration.
 *
 * @param component The component whose recognized features
 * and properties will be added to the configuration
 */
private void addRecognizedParamsAndSetDefaults(XMLComponent component) {

    // register component's recognized features
    String[] recognizedFeatures = component.getRecognizedFeatures();
    addRecognizedFeatures(recognizedFeatures);

    // register component's recognized properties
    String[] recognizedProperties = component.getRecognizedProperties();
    addRecognizedProperties(recognizedProperties);

    // set default values
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; ++i) {
            String featureId = recognizedFeatures[i];
            Boolean state = component.getFeatureDefault(featureId);
            if (state != null) {
                // Do not overwrite values already set on the configuration.
                if (!fFeatures.containsKey(featureId)) {
                    fFeatures.put(featureId, state);
                    // For newly added components who recognize this feature
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
    if (recognizedProperties != null) {
        for (int i = 0; i < recognizedProperties.length; ++i) {
            String propertyId = recognizedProperties[i];
            Object value = component.getPropertyDefault(propertyId);
            if (value != null) {
                // Do not overwrite values already set on the configuration.
                if (!fProperties.containsKey(propertyId)) {
                    fProperties.put(propertyId, value);
                    // For newly added components who recognize this property
                    // but did not offer a default value, we need to make
                    // sure these components will get an opportunity to read
                    // the value before parsing begins.
                    fConfigUpdated = true;
                }
            }
        }
    }
}