com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList

Here are the examples of the java api class com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList taken from open source projects.

1. XSDHandler#addGlobalTypeDecls()

Project: openjdk
File: XSDHandler.java
private void addGlobalTypeDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    XSNamedMap components = srcGrammar.getComponents(XSConstants.TYPE_DEFINITION);
    int len = components.getLength();
    XSTypeDefinition srcDecl, dstDecl;
    // add global components
    for (int i = 0; i < len; i++) {
        srcDecl = (XSTypeDefinition) components.item(i);
        dstDecl = dstGrammar.getGlobalTypeDecl(srcDecl.getName());
        if (dstDecl == null) {
            dstGrammar.addGlobalTypeDecl(srcDecl);
        } else if (dstDecl != srcDecl && !fTolerateDuplicates) {
            reportSharingError(srcDecl.getNamespace(), srcDecl.getName());
        }
    }
    // add any extended (duplicate) global components
    ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.TYPE_DEFINITION);
    len = componentsExt.getLength();
    for (int i = 0; i < len; i += 2) {
        final String key = (String) componentsExt.item(i);
        final int index = key.indexOf(',');
        final String location = key.substring(0, index);
        final String name = key.substring(index + 1, key.length());
        srcDecl = (XSTypeDefinition) componentsExt.item(i + 1);
        dstDecl = dstGrammar.getGlobalTypeDecl(name, location);
        if (dstDecl == null) {
            dstGrammar.addGlobalTypeDecl(srcDecl, location);
        } else // REVISIT - do we report an error?
        if (dstDecl != srcDecl) {
        }
    }
}

2. XSDHandler#addGlobalGroupDecls()

Project: openjdk
File: XSDHandler.java
private void addGlobalGroupDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    XSNamedMap components = srcGrammar.getComponents(XSConstants.MODEL_GROUP_DEFINITION);
    int len = components.getLength();
    XSGroupDecl srcDecl, dstDecl;
    // add global components
    for (int i = 0; i < len; i++) {
        srcDecl = (XSGroupDecl) components.item(i);
        dstDecl = dstGrammar.getGlobalGroupDecl(srcDecl.getName());
        if (dstDecl == null) {
            dstGrammar.addGlobalGroupDecl(srcDecl);
        } else if (srcDecl != dstDecl && !fTolerateDuplicates) {
            reportSharingError(srcDecl.getNamespace(), srcDecl.getName());
        }
    }
    // add any extended (duplicate) global components
    ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.MODEL_GROUP_DEFINITION);
    len = componentsExt.getLength();
    for (int i = 0; i < len; i += 2) {
        final String key = (String) componentsExt.item(i);
        final int index = key.indexOf(',');
        final String location = key.substring(0, index);
        final String name = key.substring(index + 1, key.length());
        srcDecl = (XSGroupDecl) componentsExt.item(i + 1);
        dstDecl = dstGrammar.getGlobalGroupDecl(name, location);
        if (dstDecl == null) {
            dstGrammar.addGlobalGroupDecl(srcDecl, location);
        } else // REVIST - do we report an error?
        if (dstDecl != srcDecl) {
        }
    }
}

3. XSDHandler#addGlobalNotationDecls()

Project: openjdk
File: XSDHandler.java
private void addGlobalNotationDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    XSNamedMap components = srcGrammar.getComponents(XSConstants.NOTATION_DECLARATION);
    int len = components.getLength();
    XSNotationDecl srcDecl, dstDecl;
    // add global components
    for (int i = 0; i < len; i++) {
        srcDecl = (XSNotationDecl) components.item(i);
        dstDecl = dstGrammar.getGlobalNotationDecl(srcDecl.getName());
        if (dstDecl == null) {
            dstGrammar.addGlobalNotationDecl(srcDecl);
        } else if (dstDecl != srcDecl && !fTolerateDuplicates) {
            reportSharingError(srcDecl.getNamespace(), srcDecl.getName());
        }
    }
    // add any extended (duplicate) global components
    ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.NOTATION_DECLARATION);
    len = componentsExt.getLength();
    for (int i = 0; i < len; i += 2) {
        final String key = (String) componentsExt.item(i);
        final int index = key.indexOf(',');
        final String location = key.substring(0, index);
        final String name = key.substring(index + 1, key.length());
        srcDecl = (XSNotationDecl) componentsExt.item(i + 1);
        dstDecl = dstGrammar.getGlobalNotationDecl(name, location);
        if (dstDecl == null) {
            dstGrammar.addGlobalNotationDecl(srcDecl, location);
        } else // REVISIT - do we report an error?
        if (dstDecl != srcDecl) {
        }
    }
}

4. XSDHandler#addGlobalAttributeGroupDecls()

Project: openjdk
File: XSDHandler.java
private void addGlobalAttributeGroupDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    XSNamedMap components = srcGrammar.getComponents(XSConstants.ATTRIBUTE_GROUP);
    int len = components.getLength();
    XSAttributeGroupDecl srcDecl, dstDecl;
    // add global components
    for (int i = 0; i < len; i++) {
        srcDecl = (XSAttributeGroupDecl) components.item(i);
        dstDecl = dstGrammar.getGlobalAttributeGroupDecl(srcDecl.getName());
        if (dstDecl == null) {
            dstGrammar.addGlobalAttributeGroupDecl(srcDecl);
        } else if (dstDecl != srcDecl && !fTolerateDuplicates) {
            reportSharingError(srcDecl.getNamespace(), srcDecl.getName());
        }
    }
    // add any extended (duplicate) global components
    ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.ATTRIBUTE_GROUP);
    len = componentsExt.getLength();
    for (int i = 0; i < len; i += 2) {
        final String key = (String) componentsExt.item(i);
        final int index = key.indexOf(',');
        final String location = key.substring(0, index);
        final String name = key.substring(index + 1, key.length());
        srcDecl = (XSAttributeGroupDecl) componentsExt.item(i + 1);
        dstDecl = dstGrammar.getGlobalAttributeGroupDecl(name, location);
        if (dstDecl == null) {
            dstGrammar.addGlobalAttributeGroupDecl(srcDecl, location);
        } else // REVISIT - do we report an error?
        if (dstDecl != srcDecl) {
        }
    }
}

5. XSDHandler#addGlobalAttributeDecls()

Project: openjdk
File: XSDHandler.java
private void addGlobalAttributeDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    XSNamedMap components = srcGrammar.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
    int len = components.getLength();
    XSAttributeDecl srcDecl, dstDecl;
    // add global components
    for (int i = 0; i < len; i++) {
        srcDecl = (XSAttributeDecl) components.item(i);
        dstDecl = dstGrammar.getGlobalAttributeDecl(srcDecl.getName());
        if (dstDecl == null) {
            dstGrammar.addGlobalAttributeDecl(srcDecl);
        } else if (dstDecl != srcDecl && !fTolerateDuplicates) {
            reportSharingError(srcDecl.getNamespace(), srcDecl.getName());
        }
    }
    // add any extended (duplicate) global components
    ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.ATTRIBUTE_DECLARATION);
    len = componentsExt.getLength();
    for (int i = 0; i < len; i += 2) {
        final String key = (String) componentsExt.item(i);
        final int index = key.indexOf(',');
        final String location = key.substring(0, index);
        final String name = key.substring(index + 1, key.length());
        srcDecl = (XSAttributeDecl) componentsExt.item(i + 1);
        dstDecl = dstGrammar.getGlobalAttributeDecl(name, location);
        if (dstDecl == null) {
            dstGrammar.addGlobalAttributeDecl(srcDecl, location);
        } else // REVISIT - do we report an error?
        if (dstDecl != srcDecl) {
        }
    }
}

6. XSDHandler#addGlobalElementDecls()

Project: openjdk
File: XSDHandler.java
private void addGlobalElementDecls(SchemaGrammar srcGrammar, SchemaGrammar dstGrammar) {
    XSNamedMap components = srcGrammar.getComponents(XSConstants.ELEMENT_DECLARATION);
    int len = components.getLength();
    XSElementDecl srcDecl, dstDecl;
    // add global components
    for (int i = 0; i < len; i++) {
        srcDecl = (XSElementDecl) components.item(i);
        dstDecl = dstGrammar.getGlobalElementDecl(srcDecl.getName());
        if (dstDecl == null) {
            dstGrammar.addGlobalElementDecl(srcDecl);
        } else if (dstDecl != srcDecl) {
        // TODO: if not tolerating duplicate, generate an error message
        }
    }
    // add any extended (duplicate) global components
    ObjectList componentsExt = srcGrammar.getComponentsExt(XSConstants.ELEMENT_DECLARATION);
    len = componentsExt.getLength();
    for (int i = 0; i < len; i += 2) {
        final String key = (String) componentsExt.item(i);
        final int index = key.indexOf(',');
        final String location = key.substring(0, index);
        final String name = key.substring(index + 1, key.length());
        srcDecl = (XSElementDecl) componentsExt.item(i + 1);
        dstDecl = dstGrammar.getGlobalElementDecl(name, location);
        if (dstDecl == null) {
            dstGrammar.addGlobalElementDecl(srcDecl, location);
        } else if (dstDecl != srcDecl) {
        // TODO: if not tolerating duplicate, generate an error message
        }
    }
}