Java Code Examples for com.sun.xml.internal.fastinfoset.util.LocalNameQualifiedNamesMap#obtainEntry()

The following examples show how to use com.sun.xml.internal.fastinfoset.util.LocalNameQualifiedNamesMap#obtainEntry() . 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: SerializerVocabulary.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private void addToNameTable(QName n, LocalNameQualifiedNamesMap m) {
    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    if (n.getNamespaceURI().length() > 0) {
        namespaceURIIndex = namespaceName.obtainIndex(n.getNamespaceURI());
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            namespaceURIIndex = namespaceName.get(n.getNamespaceURI());
        }

        if (n.getPrefix().length() > 0) {
            prefixIndex = prefix.obtainIndex(n.getPrefix());
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                prefixIndex = prefix.get(n.getPrefix());
            }
        }
    }

    int localNameIndex = localName.obtainIndex(n.getLocalPart());
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        localNameIndex = localName.get(n.getLocalPart());
    }

    QualifiedName name = new QualifiedName(n.getPrefix(), n.getNamespaceURI(), n.getLocalPart(),
            m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);

    LocalNameQualifiedNamesMap.Entry entry = null;
    if (_useLocalNameAsKey) {
        entry = m.obtainEntry(n.getLocalPart());
    } else {
        String qName = (prefixIndex == -1)
            ? n.getLocalPart()
            : n.getPrefix() + ":" + n.getLocalPart();
        entry = m.obtainEntry(qName);
    }

    entry.addQualifiedName(name);
}
 
Example 2
Source File: SerializerVocabulary.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void addToNameTable(QName n, LocalNameQualifiedNamesMap m) {
    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    if (n.getNamespaceURI().length() > 0) {
        namespaceURIIndex = namespaceName.obtainIndex(n.getNamespaceURI());
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            namespaceURIIndex = namespaceName.get(n.getNamespaceURI());
        }

        if (n.getPrefix().length() > 0) {
            prefixIndex = prefix.obtainIndex(n.getPrefix());
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                prefixIndex = prefix.get(n.getPrefix());
            }
        }
    }

    int localNameIndex = localName.obtainIndex(n.getLocalPart());
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        localNameIndex = localName.get(n.getLocalPart());
    }

    QualifiedName name = new QualifiedName(n.getPrefix(), n.getNamespaceURI(), n.getLocalPart(),
            m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);

    LocalNameQualifiedNamesMap.Entry entry = null;
    if (_useLocalNameAsKey) {
        entry = m.obtainEntry(n.getLocalPart());
    } else {
        String qName = (prefixIndex == -1)
            ? n.getLocalPart()
            : n.getPrefix() + ":" + n.getLocalPart();
        entry = m.obtainEntry(qName);
    }

    entry.addQualifiedName(name);
}
 
Example 3
Source File: SerializerVocabulary.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void addToNameTable(QName n, LocalNameQualifiedNamesMap m) {
    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    if (n.getNamespaceURI().length() > 0) {
        namespaceURIIndex = namespaceName.obtainIndex(n.getNamespaceURI());
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            namespaceURIIndex = namespaceName.get(n.getNamespaceURI());
        }

        if (n.getPrefix().length() > 0) {
            prefixIndex = prefix.obtainIndex(n.getPrefix());
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                prefixIndex = prefix.get(n.getPrefix());
            }
        }
    }

    int localNameIndex = localName.obtainIndex(n.getLocalPart());
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        localNameIndex = localName.get(n.getLocalPart());
    }

    QualifiedName name = new QualifiedName(n.getPrefix(), n.getNamespaceURI(), n.getLocalPart(),
            m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);

    LocalNameQualifiedNamesMap.Entry entry = null;
    if (_useLocalNameAsKey) {
        entry = m.obtainEntry(n.getLocalPart());
    } else {
        String qName = (prefixIndex == -1)
            ? n.getLocalPart()
            : n.getPrefix() + ":" + n.getLocalPart();
        entry = m.obtainEntry(qName);
    }

    entry.addQualifiedName(name);
}
 
Example 4
Source File: SerializerVocabulary.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void addToNameTable(QName n, LocalNameQualifiedNamesMap m) {
    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    if (n.getNamespaceURI().length() > 0) {
        namespaceURIIndex = namespaceName.obtainIndex(n.getNamespaceURI());
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            namespaceURIIndex = namespaceName.get(n.getNamespaceURI());
        }

        if (n.getPrefix().length() > 0) {
            prefixIndex = prefix.obtainIndex(n.getPrefix());
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                prefixIndex = prefix.get(n.getPrefix());
            }
        }
    }

    int localNameIndex = localName.obtainIndex(n.getLocalPart());
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        localNameIndex = localName.get(n.getLocalPart());
    }

    QualifiedName name = new QualifiedName(n.getPrefix(), n.getNamespaceURI(), n.getLocalPart(),
            m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);

    LocalNameQualifiedNamesMap.Entry entry = null;
    if (_useLocalNameAsKey) {
        entry = m.obtainEntry(n.getLocalPart());
    } else {
        String qName = (prefixIndex == -1)
            ? n.getLocalPart()
            : n.getPrefix() + ":" + n.getLocalPart();
        entry = m.obtainEntry(qName);
    }

    entry.addQualifiedName(name);
}
 
Example 5
Source File: SerializerVocabulary.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void addToNameTable(QName n, LocalNameQualifiedNamesMap m) {
    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    if (n.getNamespaceURI().length() > 0) {
        namespaceURIIndex = namespaceName.obtainIndex(n.getNamespaceURI());
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            namespaceURIIndex = namespaceName.get(n.getNamespaceURI());
        }

        if (n.getPrefix().length() > 0) {
            prefixIndex = prefix.obtainIndex(n.getPrefix());
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                prefixIndex = prefix.get(n.getPrefix());
            }
        }
    }

    int localNameIndex = localName.obtainIndex(n.getLocalPart());
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        localNameIndex = localName.get(n.getLocalPart());
    }

    QualifiedName name = new QualifiedName(n.getPrefix(), n.getNamespaceURI(), n.getLocalPart(),
            m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);

    LocalNameQualifiedNamesMap.Entry entry = null;
    if (_useLocalNameAsKey) {
        entry = m.obtainEntry(n.getLocalPart());
    } else {
        String qName = (prefixIndex == -1)
            ? n.getLocalPart()
            : n.getPrefix() + ":" + n.getLocalPart();
        entry = m.obtainEntry(qName);
    }

    entry.addQualifiedName(name);
}
 
Example 6
Source File: SerializerVocabulary.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void addToNameTable(QName n, LocalNameQualifiedNamesMap m) {
    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    if (n.getNamespaceURI().length() > 0) {
        namespaceURIIndex = namespaceName.obtainIndex(n.getNamespaceURI());
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            namespaceURIIndex = namespaceName.get(n.getNamespaceURI());
        }

        if (n.getPrefix().length() > 0) {
            prefixIndex = prefix.obtainIndex(n.getPrefix());
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                prefixIndex = prefix.get(n.getPrefix());
            }
        }
    }

    int localNameIndex = localName.obtainIndex(n.getLocalPart());
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        localNameIndex = localName.get(n.getLocalPart());
    }

    QualifiedName name = new QualifiedName(n.getPrefix(), n.getNamespaceURI(), n.getLocalPart(),
            m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);

    LocalNameQualifiedNamesMap.Entry entry = null;
    if (_useLocalNameAsKey) {
        entry = m.obtainEntry(n.getLocalPart());
    } else {
        String qName = (prefixIndex == -1)
            ? n.getLocalPart()
            : n.getPrefix() + ":" + n.getLocalPart();
        entry = m.obtainEntry(qName);
    }

    entry.addQualifiedName(name);
}
 
Example 7
Source File: SerializerVocabulary.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void addToNameTable(QName n, LocalNameQualifiedNamesMap m) {
    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    if (n.getNamespaceURI().length() > 0) {
        namespaceURIIndex = namespaceName.obtainIndex(n.getNamespaceURI());
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            namespaceURIIndex = namespaceName.get(n.getNamespaceURI());
        }

        if (n.getPrefix().length() > 0) {
            prefixIndex = prefix.obtainIndex(n.getPrefix());
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                prefixIndex = prefix.get(n.getPrefix());
            }
        }
    }

    int localNameIndex = localName.obtainIndex(n.getLocalPart());
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        localNameIndex = localName.get(n.getLocalPart());
    }

    QualifiedName name = new QualifiedName(n.getPrefix(), n.getNamespaceURI(), n.getLocalPart(),
            m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);

    LocalNameQualifiedNamesMap.Entry entry = null;
    if (_useLocalNameAsKey) {
        entry = m.obtainEntry(n.getLocalPart());
    } else {
        String qName = (prefixIndex == -1)
            ? n.getLocalPart()
            : n.getPrefix() + ":" + n.getLocalPart();
        entry = m.obtainEntry(qName);
    }

    entry.addQualifiedName(name);
}
 
Example 8
Source File: SerializerVocabulary.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void addToNameTable(QName n, LocalNameQualifiedNamesMap m) {
    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    if (n.getNamespaceURI().length() > 0) {
        namespaceURIIndex = namespaceName.obtainIndex(n.getNamespaceURI());
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            namespaceURIIndex = namespaceName.get(n.getNamespaceURI());
        }

        if (n.getPrefix().length() > 0) {
            prefixIndex = prefix.obtainIndex(n.getPrefix());
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                prefixIndex = prefix.get(n.getPrefix());
            }
        }
    }

    int localNameIndex = localName.obtainIndex(n.getLocalPart());
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        localNameIndex = localName.get(n.getLocalPart());
    }

    QualifiedName name = new QualifiedName(n.getPrefix(), n.getNamespaceURI(), n.getLocalPart(),
            m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);

    LocalNameQualifiedNamesMap.Entry entry = null;
    if (_useLocalNameAsKey) {
        entry = m.obtainEntry(n.getLocalPart());
    } else {
        String qName = (prefixIndex == -1)
            ? n.getLocalPart()
            : n.getPrefix() + ":" + n.getLocalPart();
        entry = m.obtainEntry(qName);
    }

    entry.addQualifiedName(name);
}
 
Example 9
Source File: VocabularyGenerator.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void addToNameTable(String namespaceURI, String qName, String localName,
        Set v, LocalNameQualifiedNamesMap m, QualifiedNameArray a,
        boolean isAttribute) throws SAXException {
    LocalNameQualifiedNamesMap.Entry entry = m.obtainEntry(qName);
    if (entry._valueIndex > 0) {
        QualifiedName[] names = entry._value;
        for (int i = 0; i < entry._valueIndex; i++) {
            if ((namespaceURI == names[i].namespaceName || namespaceURI.equals(names[i].namespaceName))) {
                return;
            }
        }
    }

    String prefix = getPrefixFromQualifiedName(qName);

    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    int localNameIndex = -1;
    if (namespaceURI.length() > 0) {
        namespaceURIIndex = _serializerVocabulary.namespaceName.get(namespaceURI);
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            throw new SAXException(CommonResourceBundle.getInstance().
                    getString("message.namespaceURINotIndexed", new Object[]{Integer.valueOf(namespaceURIIndex)}));
        }

        if (prefix.length() > 0) {
            prefixIndex = _serializerVocabulary.prefix.get(prefix);
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                throw new SAXException(CommonResourceBundle.getInstance().
                        getString("message.prefixNotIndexed", new Object[]{Integer.valueOf(prefixIndex)}));
            }
        }
    }

    localNameIndex = _serializerVocabulary.localName.obtainIndex(localName);
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        _parserVocabulary.localName.add(localName);
        localNameIndex = _parserVocabulary.localName.getSize() - 1;
    }
    QualifiedName name = new QualifiedName(prefix, namespaceURI, localName, m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);
    if (isAttribute) {
        name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
    }
    entry.addQualifiedName(name);
    a.add(name);

    v.add(name.getQName());
}
 
Example 10
Source File: VocabularyGenerator.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void addToNameTable(String namespaceURI, String qName, String localName,
        Set v, LocalNameQualifiedNamesMap m, QualifiedNameArray a,
        boolean isAttribute) throws SAXException {
    LocalNameQualifiedNamesMap.Entry entry = m.obtainEntry(qName);
    if (entry._valueIndex > 0) {
        QualifiedName[] names = entry._value;
        for (int i = 0; i < entry._valueIndex; i++) {
            if ((namespaceURI == names[i].namespaceName || namespaceURI.equals(names[i].namespaceName))) {
                return;
            }
        }
    }

    String prefix = getPrefixFromQualifiedName(qName);

    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    int localNameIndex = -1;
    if (namespaceURI.length() > 0) {
        namespaceURIIndex = _serializerVocabulary.namespaceName.get(namespaceURI);
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            throw new SAXException(CommonResourceBundle.getInstance().
                    getString("message.namespaceURINotIndexed", new Object[]{Integer.valueOf(namespaceURIIndex)}));
        }

        if (prefix.length() > 0) {
            prefixIndex = _serializerVocabulary.prefix.get(prefix);
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                throw new SAXException(CommonResourceBundle.getInstance().
                        getString("message.prefixNotIndexed", new Object[]{Integer.valueOf(prefixIndex)}));
            }
        }
    }

    localNameIndex = _serializerVocabulary.localName.obtainIndex(localName);
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        _parserVocabulary.localName.add(localName);
        localNameIndex = _parserVocabulary.localName.getSize() - 1;
    }
    QualifiedName name = new QualifiedName(prefix, namespaceURI, localName, m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);
    if (isAttribute) {
        name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
    }
    entry.addQualifiedName(name);
    a.add(name);

    v.add(name.getQName());
}
 
Example 11
Source File: VocabularyGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void addToNameTable(String namespaceURI, String qName, String localName,
        Set v, LocalNameQualifiedNamesMap m, QualifiedNameArray a,
        boolean isAttribute) throws SAXException {
    LocalNameQualifiedNamesMap.Entry entry = m.obtainEntry(qName);
    if (entry._valueIndex > 0) {
        QualifiedName[] names = entry._value;
        for (int i = 0; i < entry._valueIndex; i++) {
            if ((namespaceURI == names[i].namespaceName || namespaceURI.equals(names[i].namespaceName))) {
                return;
            }
        }
    }

    String prefix = getPrefixFromQualifiedName(qName);

    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    int localNameIndex = -1;
    if (namespaceURI.length() > 0) {
        namespaceURIIndex = _serializerVocabulary.namespaceName.get(namespaceURI);
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            throw new SAXException(CommonResourceBundle.getInstance().
                    getString("message.namespaceURINotIndexed", new Object[]{Integer.valueOf(namespaceURIIndex)}));
        }

        if (prefix.length() > 0) {
            prefixIndex = _serializerVocabulary.prefix.get(prefix);
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                throw new SAXException(CommonResourceBundle.getInstance().
                        getString("message.prefixNotIndexed", new Object[]{Integer.valueOf(prefixIndex)}));
            }
        }
    }

    localNameIndex = _serializerVocabulary.localName.obtainIndex(localName);
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        _parserVocabulary.localName.add(localName);
        localNameIndex = _parserVocabulary.localName.getSize() - 1;
    }
    QualifiedName name = new QualifiedName(prefix, namespaceURI, localName, m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);
    if (isAttribute) {
        name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
    }
    entry.addQualifiedName(name);
    a.add(name);

    v.add(name.getQName());
}
 
Example 12
Source File: VocabularyGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void addToNameTable(String namespaceURI, String qName, String localName,
        Set v, LocalNameQualifiedNamesMap m, QualifiedNameArray a,
        boolean isAttribute) throws SAXException {
    LocalNameQualifiedNamesMap.Entry entry = m.obtainEntry(qName);
    if (entry._valueIndex > 0) {
        QualifiedName[] names = entry._value;
        for (int i = 0; i < entry._valueIndex; i++) {
            if ((namespaceURI == names[i].namespaceName || namespaceURI.equals(names[i].namespaceName))) {
                return;
            }
        }
    }

    String prefix = getPrefixFromQualifiedName(qName);

    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    int localNameIndex = -1;
    if (namespaceURI.length() > 0) {
        namespaceURIIndex = _serializerVocabulary.namespaceName.get(namespaceURI);
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            throw new SAXException(CommonResourceBundle.getInstance().
                    getString("message.namespaceURINotIndexed", new Object[]{Integer.valueOf(namespaceURIIndex)}));
        }

        if (prefix.length() > 0) {
            prefixIndex = _serializerVocabulary.prefix.get(prefix);
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                throw new SAXException(CommonResourceBundle.getInstance().
                        getString("message.prefixNotIndexed", new Object[]{Integer.valueOf(prefixIndex)}));
            }
        }
    }

    localNameIndex = _serializerVocabulary.localName.obtainIndex(localName);
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        _parserVocabulary.localName.add(localName);
        localNameIndex = _parserVocabulary.localName.getSize() - 1;
    }
    QualifiedName name = new QualifiedName(prefix, namespaceURI, localName, m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);
    if (isAttribute) {
        name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
    }
    entry.addQualifiedName(name);
    a.add(name);

    v.add(name.getQName());
}
 
Example 13
Source File: VocabularyGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void addToNameTable(String namespaceURI, String qName, String localName,
        Set v, LocalNameQualifiedNamesMap m, QualifiedNameArray a,
        boolean isAttribute) throws SAXException {
    LocalNameQualifiedNamesMap.Entry entry = m.obtainEntry(qName);
    if (entry._valueIndex > 0) {
        QualifiedName[] names = entry._value;
        for (int i = 0; i < entry._valueIndex; i++) {
            if ((namespaceURI == names[i].namespaceName || namespaceURI.equals(names[i].namespaceName))) {
                return;
            }
        }
    }

    String prefix = getPrefixFromQualifiedName(qName);

    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    int localNameIndex = -1;
    if (namespaceURI.length() > 0) {
        namespaceURIIndex = _serializerVocabulary.namespaceName.get(namespaceURI);
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            throw new SAXException(CommonResourceBundle.getInstance().
                    getString("message.namespaceURINotIndexed", new Object[]{Integer.valueOf(namespaceURIIndex)}));
        }

        if (prefix.length() > 0) {
            prefixIndex = _serializerVocabulary.prefix.get(prefix);
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                throw new SAXException(CommonResourceBundle.getInstance().
                        getString("message.prefixNotIndexed", new Object[]{Integer.valueOf(prefixIndex)}));
            }
        }
    }

    localNameIndex = _serializerVocabulary.localName.obtainIndex(localName);
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        _parserVocabulary.localName.add(localName);
        localNameIndex = _parserVocabulary.localName.getSize() - 1;
    }
    QualifiedName name = new QualifiedName(prefix, namespaceURI, localName, m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);
    if (isAttribute) {
        name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
    }
    entry.addQualifiedName(name);
    a.add(name);

    v.add(name.getQName());
}
 
Example 14
Source File: VocabularyGenerator.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void addToNameTable(String namespaceURI, String qName, String localName,
        Set v, LocalNameQualifiedNamesMap m, QualifiedNameArray a,
        boolean isAttribute) throws SAXException {
    LocalNameQualifiedNamesMap.Entry entry = m.obtainEntry(qName);
    if (entry._valueIndex > 0) {
        QualifiedName[] names = entry._value;
        for (int i = 0; i < entry._valueIndex; i++) {
            if ((namespaceURI == names[i].namespaceName || namespaceURI.equals(names[i].namespaceName))) {
                return;
            }
        }
    }

    String prefix = getPrefixFromQualifiedName(qName);

    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    int localNameIndex = -1;
    if (namespaceURI.length() > 0) {
        namespaceURIIndex = _serializerVocabulary.namespaceName.get(namespaceURI);
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            throw new SAXException(CommonResourceBundle.getInstance().
                    getString("message.namespaceURINotIndexed", new Object[]{Integer.valueOf(namespaceURIIndex)}));
        }

        if (prefix.length() > 0) {
            prefixIndex = _serializerVocabulary.prefix.get(prefix);
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                throw new SAXException(CommonResourceBundle.getInstance().
                        getString("message.prefixNotIndexed", new Object[]{Integer.valueOf(prefixIndex)}));
            }
        }
    }

    localNameIndex = _serializerVocabulary.localName.obtainIndex(localName);
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        _parserVocabulary.localName.add(localName);
        localNameIndex = _parserVocabulary.localName.getSize() - 1;
    }
    QualifiedName name = new QualifiedName(prefix, namespaceURI, localName, m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);
    if (isAttribute) {
        name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
    }
    entry.addQualifiedName(name);
    a.add(name);

    v.add(name.getQName());
}
 
Example 15
Source File: VocabularyGenerator.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void addToNameTable(String namespaceURI, String qName, String localName,
        Set v, LocalNameQualifiedNamesMap m, QualifiedNameArray a,
        boolean isAttribute) throws SAXException {
    LocalNameQualifiedNamesMap.Entry entry = m.obtainEntry(qName);
    if (entry._valueIndex > 0) {
        QualifiedName[] names = entry._value;
        for (int i = 0; i < entry._valueIndex; i++) {
            if ((namespaceURI == names[i].namespaceName || namespaceURI.equals(names[i].namespaceName))) {
                return;
            }
        }
    }

    String prefix = getPrefixFromQualifiedName(qName);

    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    int localNameIndex = -1;
    if (namespaceURI.length() > 0) {
        namespaceURIIndex = _serializerVocabulary.namespaceName.get(namespaceURI);
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            throw new SAXException(CommonResourceBundle.getInstance().
                    getString("message.namespaceURINotIndexed", new Object[]{Integer.valueOf(namespaceURIIndex)}));
        }

        if (prefix.length() > 0) {
            prefixIndex = _serializerVocabulary.prefix.get(prefix);
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                throw new SAXException(CommonResourceBundle.getInstance().
                        getString("message.prefixNotIndexed", new Object[]{Integer.valueOf(prefixIndex)}));
            }
        }
    }

    localNameIndex = _serializerVocabulary.localName.obtainIndex(localName);
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        _parserVocabulary.localName.add(localName);
        localNameIndex = _parserVocabulary.localName.getSize() - 1;
    }
    QualifiedName name = new QualifiedName(prefix, namespaceURI, localName, m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);
    if (isAttribute) {
        name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
    }
    entry.addQualifiedName(name);
    a.add(name);

    v.add(name.getQName());
}
 
Example 16
Source File: VocabularyGenerator.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void addToNameTable(String namespaceURI, String qName, String localName,
        Set v, LocalNameQualifiedNamesMap m, QualifiedNameArray a,
        boolean isAttribute) throws SAXException {
    LocalNameQualifiedNamesMap.Entry entry = m.obtainEntry(qName);
    if (entry._valueIndex > 0) {
        QualifiedName[] names = entry._value;
        for (int i = 0; i < entry._valueIndex; i++) {
            if ((namespaceURI == names[i].namespaceName || namespaceURI.equals(names[i].namespaceName))) {
                return;
            }
        }
    }

    String prefix = getPrefixFromQualifiedName(qName);

    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    int localNameIndex = -1;
    if (namespaceURI.length() > 0) {
        namespaceURIIndex = _serializerVocabulary.namespaceName.get(namespaceURI);
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            throw new SAXException(CommonResourceBundle.getInstance().
                    getString("message.namespaceURINotIndexed", new Object[]{Integer.valueOf(namespaceURIIndex)}));
        }

        if (prefix.length() > 0) {
            prefixIndex = _serializerVocabulary.prefix.get(prefix);
            if (prefixIndex == KeyIntMap.NOT_PRESENT) {
                throw new SAXException(CommonResourceBundle.getInstance().
                        getString("message.prefixNotIndexed", new Object[]{Integer.valueOf(prefixIndex)}));
            }
        }
    }

    localNameIndex = _serializerVocabulary.localName.obtainIndex(localName);
    if (localNameIndex == KeyIntMap.NOT_PRESENT) {
        _parserVocabulary.localName.add(localName);
        localNameIndex = _parserVocabulary.localName.getSize() - 1;
    }
    QualifiedName name = new QualifiedName(prefix, namespaceURI, localName, m.getNextIndex(),
            prefixIndex, namespaceURIIndex, localNameIndex);
    if (isAttribute) {
        name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
    }
    entry.addQualifiedName(name);
    a.add(name);

    v.add(name.getQName());
}