Java Code Examples for com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar#getImportedGrammars()

The following examples show how to use com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar#getImportedGrammars() . 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: XSDHandler.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Namespace growth
 *
 * Go throuth the grammar bucket, and for each grammar in the bucket
 * check the import list. If there exists a grammar in import list
 * that has the same namespace as newGrammar, but a different instance,
 * then update the import list and replace the old grammar instance with
 * the new one
 */
private void updateImportListWith(SchemaGrammar newGrammar) {
    SchemaGrammar[] schemaGrammars = fGrammarBucket.getGrammars();
    for (int i = 0; i < schemaGrammars.length; ++i) {
        SchemaGrammar sg = schemaGrammars[i];
        if (sg != newGrammar) {
            Vector importedGrammars = sg.getImportedGrammars();
            if (importedGrammars != null) {
                for (int j=0; j<importedGrammars.size(); j++) {
                    SchemaGrammar isg = (SchemaGrammar) importedGrammars.elementAt(j);
                    if (null2EmptyString(isg.getTargetNamespace()).equals(null2EmptyString(newGrammar.getTargetNamespace()))) {
                        if (isg != newGrammar) {
                            importedGrammars.set(j, newGrammar);
                        }
                        break;
                    }
                }
            }
        }
    }
}
 
Example 2
Source File: XSDHandler.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Namespace growth
 *
 * Go throuth the grammar bucket, and for each grammar in the bucket
 * check the import list. If there exists a grammar in import list
 * that has the same namespace as newGrammar, but a different instance,
 * then update the import list and replace the old grammar instance with
 * the new one
 */
private void updateImportListWith(SchemaGrammar newGrammar) {
    SchemaGrammar[] schemaGrammars = fGrammarBucket.getGrammars();
    for (int i = 0; i < schemaGrammars.length; ++i) {
        SchemaGrammar sg = schemaGrammars[i];
        if (sg != newGrammar) {
            Vector importedGrammars = sg.getImportedGrammars();
            if (importedGrammars != null) {
                for (int j=0; j<importedGrammars.size(); j++) {
                    SchemaGrammar isg = (SchemaGrammar) importedGrammars.elementAt(j);
                    if (null2EmptyString(isg.getTargetNamespace()).equals(null2EmptyString(newGrammar.getTargetNamespace()))) {
                        if (isg != newGrammar) {
                            importedGrammars.set(j, newGrammar);
                        }
                        break;
                    }
                }
            }
        }
    }
}
 
Example 3
Source File: XSDHandler.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Namespace growth
 *
 * Go throuth the grammar bucket, and for each grammar in the bucket
 * check the import list. If there exists a grammar in import list
 * that has the same namespace as newGrammar, but a different instance,
 * then update the import list and replace the old grammar instance with
 * the new one
 */
private void updateImportListWith(SchemaGrammar newGrammar) {
    SchemaGrammar[] schemaGrammars = fGrammarBucket.getGrammars();
    for (int i = 0; i < schemaGrammars.length; ++i) {
        SchemaGrammar sg = schemaGrammars[i];
        if (sg != newGrammar) {
            Vector importedGrammars = sg.getImportedGrammars();
            if (importedGrammars != null) {
                for (int j=0; j<importedGrammars.size(); j++) {
                    SchemaGrammar isg = (SchemaGrammar) importedGrammars.elementAt(j);
                    if (null2EmptyString(isg.getTargetNamespace()).equals(null2EmptyString(newGrammar.getTargetNamespace()))) {
                        if (isg != newGrammar) {
                            importedGrammars.set(j, newGrammar);
                        }
                        break;
                    }
                }
            }
        }
    }
}
 
Example 4
Source File: XSDHandler.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Namespace growth
 *
 * Go throuth the grammar bucket, and for each grammar in the bucket
 * check the import list. If there exists a grammar in import list
 * that has the same namespace as newGrammar, but a different instance,
 * then update the import list and replace the old grammar instance with
 * the new one
 */
private void updateImportListWith(SchemaGrammar newGrammar) {
    SchemaGrammar[] schemaGrammars = fGrammarBucket.getGrammars();
    for (int i = 0; i < schemaGrammars.length; ++i) {
        SchemaGrammar sg = schemaGrammars[i];
        if (sg != newGrammar) {
            Vector importedGrammars = sg.getImportedGrammars();
            if (importedGrammars != null) {
                for (int j=0; j<importedGrammars.size(); j++) {
                    SchemaGrammar isg = (SchemaGrammar) importedGrammars.elementAt(j);
                    if (null2EmptyString(isg.getTargetNamespace()).equals(null2EmptyString(newGrammar.getTargetNamespace()))) {
                        if (isg != newGrammar) {
                            importedGrammars.set(j, newGrammar);
                        }
                        break;
                    }
                }
            }
        }
    }
}
 
Example 5
Source File: XSDHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Namespace growth
 *
 * Go throuth the grammar bucket, and for each grammar in the bucket
 * check the import list. If there exists a grammar in import list
 * that has the same namespace as newGrammar, but a different instance,
 * then update the import list and replace the old grammar instance with
 * the new one
 */
private void updateImportListWith(SchemaGrammar newGrammar) {
    SchemaGrammar[] schemaGrammars = fGrammarBucket.getGrammars();
    for (int i = 0; i < schemaGrammars.length; ++i) {
        SchemaGrammar sg = schemaGrammars[i];
        if (sg != newGrammar) {
            Vector importedGrammars = sg.getImportedGrammars();
            if (importedGrammars != null) {
                for (int j=0; j<importedGrammars.size(); j++) {
                    SchemaGrammar isg = (SchemaGrammar) importedGrammars.elementAt(j);
                    if (null2EmptyString(isg.getTargetNamespace()).equals(null2EmptyString(newGrammar.getTargetNamespace()))) {
                        if (isg != newGrammar) {
                            importedGrammars.set(j, newGrammar);
                        }
                        break;
                    }
                }
            }
        }
    }
}
 
Example 6
Source File: XSDHandler.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Namespace growth
 *
 * Go throuth the grammar bucket, and for each grammar in the bucket
 * check the import list. If there exists a grammar in import list
 * that has the same namespace as newGrammar, but a different instance,
 * then update the import list and replace the old grammar instance with
 * the new one
 */
private void updateImportListWith(SchemaGrammar newGrammar) {
    SchemaGrammar[] schemaGrammars = fGrammarBucket.getGrammars();
    for (int i = 0; i < schemaGrammars.length; ++i) {
        SchemaGrammar sg = schemaGrammars[i];
        if (sg != newGrammar) {
            Vector importedGrammars = sg.getImportedGrammars();
            if (importedGrammars != null) {
                for (int j=0; j<importedGrammars.size(); j++) {
                    SchemaGrammar isg = (SchemaGrammar) importedGrammars.elementAt(j);
                    if (null2EmptyString(isg.getTargetNamespace()).equals(null2EmptyString(newGrammar.getTargetNamespace()))) {
                        if (isg != newGrammar) {
                            importedGrammars.set(j, newGrammar);
                        }
                        break;
                    }
                }
            }
        }
    }
}
 
Example 7
Source File: XSDHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Namespace growth
 *
 * Go throuth the grammar bucket, and for each grammar in the bucket
 * check the import list. If there exists a grammar in import list
 * that has the same namespace as newGrammar, but a different instance,
 * then update the import list and replace the old grammar instance with
 * the new one
 */
private void updateImportListWith(SchemaGrammar newGrammar) {
    SchemaGrammar[] schemaGrammars = fGrammarBucket.getGrammars();
    for (int i = 0; i < schemaGrammars.length; ++i) {
        SchemaGrammar sg = schemaGrammars[i];
        if (sg != newGrammar) {
            Vector importedGrammars = sg.getImportedGrammars();
            if (importedGrammars != null) {
                for (int j=0; j<importedGrammars.size(); j++) {
                    SchemaGrammar isg = (SchemaGrammar) importedGrammars.elementAt(j);
                    if (null2EmptyString(isg.getTargetNamespace()).equals(null2EmptyString(newGrammar.getTargetNamespace()))) {
                        if (isg != newGrammar) {
                            importedGrammars.set(j, newGrammar);
                        }
                        break;
                    }
                }
            }
        }
    }
}
 
Example 8
Source File: XSDHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Namespace growth
 *
 * Go through the import list of a given grammar and for each imported
 * grammar, check to see if the grammar bucket has a newer version.
 * If a new instance is found, we update the import list with the
 * newer version.
 */
private void updateImportListFor(SchemaGrammar grammar) {
    Vector importedGrammars = grammar.getImportedGrammars();
    if (importedGrammars != null) {
        for (int i=0; i<importedGrammars.size(); i++) {
            SchemaGrammar isg1 = (SchemaGrammar) importedGrammars.elementAt(i);
            SchemaGrammar isg2 = fGrammarBucket.getGrammar(isg1.getTargetNamespace());
            if (isg2 != null && isg1 != isg2) {
                importedGrammars.set(i, isg2);
            }
        }
    }
}
 
Example 9
Source File: XSDHandler.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Namespace growth
 *
 * Go through the import list of a given grammar and for each imported
 * grammar, check to see if the grammar bucket has a newer version.
 * If a new instance is found, we update the import list with the
 * newer version.
 */
private void updateImportListFor(SchemaGrammar grammar) {
    Vector importedGrammars = grammar.getImportedGrammars();
    if (importedGrammars != null) {
        for (int i=0; i<importedGrammars.size(); i++) {
            SchemaGrammar isg1 = (SchemaGrammar) importedGrammars.elementAt(i);
            SchemaGrammar isg2 = fGrammarBucket.getGrammar(isg1.getTargetNamespace());
            if (isg2 != null && isg1 != isg2) {
                importedGrammars.set(i, isg2);
            }
        }
    }
}
 
Example 10
Source File: XSDHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void addNewImportedGrammars(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    final Vector igs1 = srcGrammar.getImportedGrammars();
    if (igs1 != null) {
        Vector igs2 = dstGrammar.getImportedGrammars();

        if (igs2 == null) {
            igs2 = ((Vector) igs1.clone());
            dstGrammar.setImportedGrammars(igs2);
        }
        else {
            updateImportList(igs1, igs2);
        }
    }
}
 
Example 11
Source File: XSDHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void addNewImportedGrammars(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    final Vector igs1 = srcGrammar.getImportedGrammars();
    if (igs1 != null) {
        Vector igs2 = dstGrammar.getImportedGrammars();

        if (igs2 == null) {
            igs2 = ((Vector) igs1.clone());
            dstGrammar.setImportedGrammars(igs2);
        }
        else {
            updateImportList(igs1, igs2);
        }
    }
}
 
Example 12
Source File: XSDHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Namespace growth
 *
 * Go through the import list of a given grammar and for each imported
 * grammar, check to see if the grammar bucket has a newer version.
 * If a new instance is found, we update the import list with the
 * newer version.
 */
private void updateImportListFor(SchemaGrammar grammar) {
    Vector importedGrammars = grammar.getImportedGrammars();
    if (importedGrammars != null) {
        for (int i=0; i<importedGrammars.size(); i++) {
            SchemaGrammar isg1 = (SchemaGrammar) importedGrammars.elementAt(i);
            SchemaGrammar isg2 = fGrammarBucket.getGrammar(isg1.getTargetNamespace());
            if (isg2 != null && isg1 != isg2) {
                importedGrammars.set(i, isg2);
            }
        }
    }
}
 
Example 13
Source File: XSDHandler.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private void addNewImportedGrammars(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    final Vector igs1 = srcGrammar.getImportedGrammars();
    if (igs1 != null) {
        Vector igs2 = dstGrammar.getImportedGrammars();

        if (igs2 == null) {
            igs2 = ((Vector) igs1.clone());
            dstGrammar.setImportedGrammars(igs2);
        }
        else {
            updateImportList(igs1, igs2);
        }
    }
}
 
Example 14
Source File: XSDHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void addNewImportedGrammars(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    final Vector igs1 = srcGrammar.getImportedGrammars();
    if (igs1 != null) {
        Vector igs2 = dstGrammar.getImportedGrammars();

        if (igs2 == null) {
            igs2 = ((Vector) igs1.clone());
            dstGrammar.setImportedGrammars(igs2);
        }
        else {
            updateImportList(igs1, igs2);
        }
    }
}
 
Example 15
Source File: XSDHandler.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Namespace growth
 *
 * Go through the import list of a given grammar and for each imported
 * grammar, check to see if the grammar bucket has a newer version.
 * If a new instance is found, we update the import list with the
 * newer version.
 */
private void updateImportListFor(SchemaGrammar grammar) {
    Vector importedGrammars = grammar.getImportedGrammars();
    if (importedGrammars != null) {
        for (int i=0; i<importedGrammars.size(); i++) {
            SchemaGrammar isg1 = (SchemaGrammar) importedGrammars.elementAt(i);
            SchemaGrammar isg2 = fGrammarBucket.getGrammar(isg1.getTargetNamespace());
            if (isg2 != null && isg1 != isg2) {
                importedGrammars.set(i, isg2);
            }
        }
    }
}
 
Example 16
Source File: XSDHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void addNewImportedGrammars(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    final Vector igs1 = srcGrammar.getImportedGrammars();
    if (igs1 != null) {
        Vector igs2 = dstGrammar.getImportedGrammars();

        if (igs2 == null) {
            igs2 = ((Vector) igs1.clone());
            dstGrammar.setImportedGrammars(igs2);
        }
        else {
            updateImportList(igs1, igs2);
        }
    }
}
 
Example 17
Source File: XSDHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Namespace growth
 *
 * Go through the import list of a given grammar and for each imported
 * grammar, check to see if the grammar bucket has a newer version.
 * If a new instance is found, we update the import list with the
 * newer version.
 */
private void updateImportListFor(SchemaGrammar grammar) {
    Vector importedGrammars = grammar.getImportedGrammars();
    if (importedGrammars != null) {
        for (int i=0; i<importedGrammars.size(); i++) {
            SchemaGrammar isg1 = (SchemaGrammar) importedGrammars.elementAt(i);
            SchemaGrammar isg2 = fGrammarBucket.getGrammar(isg1.getTargetNamespace());
            if (isg2 != null && isg1 != isg2) {
                importedGrammars.set(i, isg2);
            }
        }
    }
}
 
Example 18
Source File: XSDHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void addNewImportedGrammars(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    final Vector igs1 = srcGrammar.getImportedGrammars();
    if (igs1 != null) {
        Vector igs2 = dstGrammar.getImportedGrammars();

        if (igs2 == null) {
            igs2 = ((Vector) igs1.clone());
            dstGrammar.setImportedGrammars(igs2);
        }
        else {
            updateImportList(igs1, igs2);
        }
    }
}
 
Example 19
Source File: XSDHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Namespace growth
 *
 * Go through the import list of a given grammar and for each imported
 * grammar, check to see if the grammar bucket has a newer version.
 * If a new instance is found, we update the import list with the
 * newer version.
 */
private void updateImportListFor(SchemaGrammar grammar) {
    Vector importedGrammars = grammar.getImportedGrammars();
    if (importedGrammars != null) {
        for (int i=0; i<importedGrammars.size(); i++) {
            SchemaGrammar isg1 = (SchemaGrammar) importedGrammars.elementAt(i);
            SchemaGrammar isg2 = fGrammarBucket.getGrammar(isg1.getTargetNamespace());
            if (isg2 != null && isg1 != isg2) {
                importedGrammars.set(i, isg2);
            }
        }
    }
}
 
Example 20
Source File: XSDHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Namespace growth
 *
 * Go through the import list of a given grammar and for each imported
 * grammar, check to see if the grammar bucket has a newer version.
 * If a new instance is found, we update the import list with the
 * newer version.
 */
private void updateImportListFor(SchemaGrammar grammar) {
    Vector importedGrammars = grammar.getImportedGrammars();
    if (importedGrammars != null) {
        for (int i=0; i<importedGrammars.size(); i++) {
            SchemaGrammar isg1 = (SchemaGrammar) importedGrammars.elementAt(i);
            SchemaGrammar isg2 = fGrammarBucket.getGrammar(isg1.getTargetNamespace());
            if (isg2 != null && isg1 != isg2) {
                importedGrammars.set(i, isg2);
            }
        }
    }
}