com.sun.org.apache.xerces.internal.xni.parser.XMLComponent Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.xni.parser.XMLComponent. 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-jdk8u-backup 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: XMLSchemaValidatorComponentManager.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/** Sets feature defaults for the given component on this configuration. */
private void setFeatureDefaults(final XMLComponent component,
        final String [] recognizedFeatures, XSGrammarPoolContainer grammarContainer) {
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; ++i) {
            String featureId = recognizedFeatures[i];
            Boolean state = grammarContainer.getFeature(featureId);
            if (state == null) {
                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;
                }
            }
        }
    }
}
 
Example #3
Source File: XMLSchemaValidatorComponentManager.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/** Sets feature defaults for the given component on this configuration. */
private void setFeatureDefaults(final XMLComponent component,
        final String [] recognizedFeatures, XSGrammarPoolContainer grammarContainer) {
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; ++i) {
            String featureId = recognizedFeatures[i];
            Boolean state = grammarContainer.getFeature(featureId);
            if (state == null) {
                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;
                }
            }
        }
    }
}
 
Example #4
Source File: DOMConfigurationImpl.java    From jdk1.8-source-analysis with Apache License 2.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 #5
Source File: XMLSchemaValidatorComponentManager.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/** Sets property defaults for the given component on this configuration. */
private void setPropertyDefaults(final XMLComponent component, final String [] recognizedProperties) {
    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 #6
Source File: DOMConfigurationImpl.java    From hottub 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 #7
Source File: XMLSchemaValidatorComponentManager.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/** Sets feature defaults for the given component on this configuration. */
private void setFeatureDefaults(final XMLComponent component,
        final String [] recognizedFeatures, XSGrammarPoolContainer grammarContainer) {
    if (recognizedFeatures != null) {
        for (int i = 0; i < recognizedFeatures.length; ++i) {
            String featureId = recognizedFeatures[i];
            Boolean state = grammarContainer.getFeature(featureId);
            if (state == null) {
                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;
                }
            }
        }
    }
}
 
Example #8
Source File: XMLSchemaValidatorComponentManager.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/** Sets property defaults for the given component on this configuration. */
private void setPropertyDefaults(final XMLComponent component, final String [] recognizedProperties) {
    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 #9
Source File: XML11DTDConfiguration.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);
    addRecognizedParamsAndSetDefaults(component);

}
 
Example #10
Source File: BasicParserConfiguration.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * reset all components before parsing and namespace context
 */
protected void reset() throws XNIException {

    // reset every component
    int count = fComponents.size();
    for (int i = 0; i < count; i++) {
        XMLComponent c = (XMLComponent) fComponents.get(i);
        c.reset(this);
    }

}
 
Example #11
Source File: XML11DTDConfiguration.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * reset all common components before parsing
 */
protected void resetCommon() throws XNIException {
        // reset common components
        int count = fCommonComponents.size();
        for (int i = 0; i < count; i++) {
                XMLComponent c = (XMLComponent) fCommonComponents.get(i);
                c.reset(this);
        }

}
 
Example #12
Source File: BasicParserConfiguration.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * setProperty
 *
 * @param propertyId
 * @param value
 */
public void setProperty(String propertyId, Object value)
    throws XMLConfigurationException {

    // forward to every component
    int count = fComponents.size();
    for (int i = 0; i < count; i++) {
        XMLComponent c = (XMLComponent) fComponents.get(i);
        c.setProperty(propertyId, value);
    }

    // store value if noone "objects"
    super.setProperty(propertyId, value);

}
 
Example #13
Source File: XML11DTDConfiguration.java    From openjdk-jdk8u-backup 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);
    addRecognizedParamsAndSetDefaults(component);

}
 
Example #14
Source File: XML11NonValidatingConfiguration.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds common 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 addCommonComponent(XMLComponent component) {

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

}
 
Example #15
Source File: DOMConfigurationImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * reset all components before parsing
 */
protected void reset() throws XNIException {

    if (fValidationManager != null)
        fValidationManager.reset();

    int count = fComponents.size();
    for (int i = 0; i < count; i++) {
        XMLComponent c = fComponents.get(i);
        c.reset(this);
    }

}
 
Example #16
Source File: XML11NonValidatingConfiguration.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Adds common 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 addCommonComponent(XMLComponent component) {

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

}
 
Example #17
Source File: XML11NonValidatingConfiguration.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);
    addRecognizedParamsAndSetDefaults(component);

}
 
Example #18
Source File: XML11Configuration.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * reset all components before parsing and namespace context
 */
protected void resetXML11() throws XNIException {
        // reset every component
        int count = fXML11Components.size();
        for (int i = 0; i < count; i++) {
                XMLComponent c = fXML11Components.get(i);
                c.reset(this);
        }

}
 
Example #19
Source File: XML11Configuration.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * reset all XML 1.0 components before parsing and namespace context
 */
protected void reset() throws XNIException {
        int count = fComponents.size();
        for (int i = 0; i < count; i++) {
                XMLComponent c = fComponents.get(i);
                c.reset(this);
        }

}
 
Example #20
Source File: XML11Configuration.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * reset all common components before parsing
 */
protected void resetCommon() throws XNIException {
        // reset common components
        int count = fCommonComponents.size();
        for (int i = 0; i < count; i++) {
                XMLComponent c = fCommonComponents.get(i);
                c.reset(this);
        }

}
 
Example #21
Source File: XML11Configuration.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * reset all XML 1.0 components before parsing and namespace context
 */
protected void reset() throws XNIException {
        int count = fComponents.size();
        for (int i = 0; i < count; i++) {
                XMLComponent c = fComponents.get(i);
                c.reset(this);
        }

}
 
Example #22
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 #23
Source File: XML11NonValidatingConfiguration.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds common 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 addCommonComponent(XMLComponent component) {

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

}
 
Example #24
Source File: XML11DTDConfiguration.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds an XML 1.1 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 addXML11Component(XMLComponent component) {

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

}
 
Example #25
Source File: XML11Configuration.java    From openjdk-jdk8u-backup 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);
    addRecognizedParamsAndSetDefaults(component);

}
 
Example #26
Source File: XML11DTDConfiguration.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);
    addRecognizedParamsAndSetDefaults(component);

}
 
Example #27
Source File: DOMConfigurationImpl.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * reset all components before parsing
 */
protected void reset() throws XNIException {

    if (fValidationManager != null)
        fValidationManager.reset();

    int count = fComponents.size();
    for (int i = 0; i < count; i++) {
        XMLComponent c = fComponents.get(i);
        c.reset(this);
    }

}
 
Example #28
Source File: XML11DTDConfiguration.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * reset all common components before parsing
 */
protected void resetCommon() throws XNIException {
        // reset common components
        int count = fCommonComponents.size();
        for (int i = 0; i < count; i++) {
                XMLComponent c = (XMLComponent) fCommonComponents.get(i);
                c.reset(this);
        }

}
 
Example #29
Source File: XML11DTDConfiguration.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * reset all XML 1.0 components before parsing and namespace context
 */
protected void reset() throws XNIException {
        int count = fComponents.size();
        for (int i = 0; i < count; i++) {
                XMLComponent c = (XMLComponent) fComponents.get(i);
                c.reset(this);
        }

}
 
Example #30
Source File: XML11NonValidatingConfiguration.java    From JDKSourceCode1.8 with MIT License 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);
    addRecognizedParamsAndSetDefaults(component);

}