Java Code Examples for com.sun.xml.internal.fastinfoset.util.StringIntMap

The following examples show how to use com.sun.xml.internal.fastinfoset.util.StringIntMap. These examples are extracted from open source projects. 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
private void convertVocabulary(com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary v) {
    final StringIntMap prefixMap = new FixedEntryStringIntMap(
            EncodingConstants.XML_NAMESPACE_PREFIX, 8);
    final StringIntMap namespaceNameMap = new FixedEntryStringIntMap(
            EncodingConstants.XML_NAMESPACE_NAME, 8);
    final StringIntMap localNameMap = new StringIntMap();

    addToTable(v.restrictedAlphabets.iterator(), restrictedAlphabet);
    addToTable(v.encodingAlgorithms.iterator(), encodingAlgorithm);
    addToTable(v.prefixes.iterator(), prefix, prefixMap);
    addToTable(v.namespaceNames.iterator(), namespaceName, namespaceNameMap);
    addToTable(v.localNames.iterator(), localName, localNameMap);
    addToTable(v.otherNCNames.iterator(), otherNCName);
    addToTable(v.otherURIs.iterator(), otherURI);
    addToTable(v.attributeValues.iterator(), attributeValue);
    addToTable(v.otherStrings.iterator(), otherString);
    addToTable(v.characterContentChunks.iterator(), characterContentChunk);
    addToTable(v.elements.iterator(), elementName, false,
            prefixMap, namespaceNameMap, localNameMap);
    addToTable(v.attributes.iterator(), attributeName, true,
            prefixMap, namespaceNameMap, localNameMap);
}
 
Example 2
Source Project: openjdk-8   Source File: ParserVocabulary.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void convertVocabulary(com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary v) {
    final StringIntMap prefixMap = new FixedEntryStringIntMap(
            EncodingConstants.XML_NAMESPACE_PREFIX, 8);
    final StringIntMap namespaceNameMap = new FixedEntryStringIntMap(
            EncodingConstants.XML_NAMESPACE_NAME, 8);
    final StringIntMap localNameMap = new StringIntMap();

    addToTable(v.restrictedAlphabets.iterator(), restrictedAlphabet);
    addToTable(v.encodingAlgorithms.iterator(), encodingAlgorithm);
    addToTable(v.prefixes.iterator(), prefix, prefixMap);
    addToTable(v.namespaceNames.iterator(), namespaceName, namespaceNameMap);
    addToTable(v.localNames.iterator(), localName, localNameMap);
    addToTable(v.otherNCNames.iterator(), otherNCName);
    addToTable(v.otherURIs.iterator(), otherURI);
    addToTable(v.attributeValues.iterator(), attributeValue);
    addToTable(v.otherStrings.iterator(), otherString);
    addToTable(v.characterContentChunks.iterator(), characterContentChunk);
    addToTable(v.elements.iterator(), elementName, false,
            prefixMap, namespaceNameMap, localNameMap);
    addToTable(v.attributes.iterator(), attributeName, true,
            prefixMap, namespaceNameMap, localNameMap);
}
 
Example 3
private void convertVocabulary(com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary v) {
    final StringIntMap prefixMap = new FixedEntryStringIntMap(
            EncodingConstants.XML_NAMESPACE_PREFIX, 8);
    final StringIntMap namespaceNameMap = new FixedEntryStringIntMap(
            EncodingConstants.XML_NAMESPACE_NAME, 8);
    final StringIntMap localNameMap = new StringIntMap();

    addToTable(v.restrictedAlphabets.iterator(), restrictedAlphabet);
    addToTable(v.encodingAlgorithms.iterator(), encodingAlgorithm);
    addToTable(v.prefixes.iterator(), prefix, prefixMap);
    addToTable(v.namespaceNames.iterator(), namespaceName, namespaceNameMap);
    addToTable(v.localNames.iterator(), localName, localNameMap);
    addToTable(v.otherNCNames.iterator(), otherNCName);
    addToTable(v.otherURIs.iterator(), otherURI);
    addToTable(v.attributeValues.iterator(), attributeValue);
    addToTable(v.otherStrings.iterator(), otherString);
    addToTable(v.characterContentChunks.iterator(), characterContentChunk);
    addToTable(v.elements.iterator(), elementName, false,
            prefixMap, namespaceNameMap, localNameMap);
    addToTable(v.attributes.iterator(), attributeName, true,
            prefixMap, namespaceNameMap, localNameMap);
}
 
Example 4
private void convertVocabulary(com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary v) {
    final StringIntMap prefixMap = new FixedEntryStringIntMap(
            EncodingConstants.XML_NAMESPACE_PREFIX, 8);
    final StringIntMap namespaceNameMap = new FixedEntryStringIntMap(
            EncodingConstants.XML_NAMESPACE_NAME, 8);
    final StringIntMap localNameMap = new StringIntMap();

    addToTable(v.restrictedAlphabets.iterator(), restrictedAlphabet);
    addToTable(v.encodingAlgorithms.iterator(), encodingAlgorithm);
    addToTable(v.prefixes.iterator(), prefix, prefixMap);
    addToTable(v.namespaceNames.iterator(), namespaceName, namespaceNameMap);
    addToTable(v.localNames.iterator(), localName, localNameMap);
    addToTable(v.otherNCNames.iterator(), otherNCName);
    addToTable(v.otherURIs.iterator(), otherURI);
    addToTable(v.attributeValues.iterator(), attributeValue);
    addToTable(v.otherStrings.iterator(), otherString);
    addToTable(v.characterContentChunks.iterator(), characterContentChunk);
    addToTable(v.elements.iterator(), elementName, false,
            prefixMap, namespaceNameMap, localNameMap);
    addToTable(v.attributes.iterator(), attributeName, true,
            prefixMap, namespaceNameMap, localNameMap);
}
 
Example 5
private void convertVocabulary(com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary v) {
    final StringIntMap prefixMap = new FixedEntryStringIntMap(
            EncodingConstants.XML_NAMESPACE_PREFIX, 8);
    final StringIntMap namespaceNameMap = new FixedEntryStringIntMap(
            EncodingConstants.XML_NAMESPACE_NAME, 8);
    final StringIntMap localNameMap = new StringIntMap();

    addToTable(v.restrictedAlphabets.iterator(), restrictedAlphabet);
    addToTable(v.encodingAlgorithms.iterator(), encodingAlgorithm);
    addToTable(v.prefixes.iterator(), prefix, prefixMap);
    addToTable(v.namespaceNames.iterator(), namespaceName, namespaceNameMap);
    addToTable(v.localNames.iterator(), localName, localNameMap);
    addToTable(v.otherNCNames.iterator(), otherNCName);
    addToTable(v.otherURIs.iterator(), otherURI);
    addToTable(v.attributeValues.iterator(), attributeValue);
    addToTable(v.otherStrings.iterator(), otherString);
    addToTable(v.characterContentChunks.iterator(), characterContentChunk);
    addToTable(v.elements.iterator(), elementName, false,
            prefixMap, namespaceNameMap, localNameMap);
    addToTable(v.attributes.iterator(), attributeName, true,
            prefixMap, namespaceNameMap, localNameMap);
}
 
Example 6
Source Project: TencentKona-8   Source File: Encoder.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Encode a non identifying string on the first bit of an octet.
 * Implementation of clause C.14 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
 *
 * @param s the string to encode
 * @param map the vocabulary table of strings to indexes.
 * @param addToTable true if the string could be added to the vocabulary
 *                   table (if table has enough memory)
 * @param mustBeAddedToTable true if the string must be added to the vocabulary
 *                   table (if not already present in the table).
 */
protected final void encodeNonIdentifyingStringOnFirstBit(String s, StringIntMap map,
        boolean addToTable, boolean mustBeAddedToTable) throws IOException {
    if (s == null || s.length() == 0) {
        // C.26 an index (first bit '1') with seven '1' bits for an empty string
        write(0xFF);
    } else {
        if (addToTable || mustBeAddedToTable) {
            // if attribute value could be added to table
            boolean canAddAttributeToTable = mustBeAddedToTable ||
                    canAddAttributeToTable(s.length());

            // obtain/get index
            int index = canAddAttributeToTable ?
                map.obtainIndex(s) :
                map.get(s);

            if (index != KeyIntMap.NOT_PRESENT) {
                // if attribute value is in table
                encodeNonZeroIntegerOnSecondBitFirstBitOne(index);
            } else if (canAddAttributeToTable) {
                // if attribute value is not in table, but could be added
                _b = EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG |
                        _nonIdentifyingStringOnFirstBitCES;
                encodeNonEmptyCharacterStringOnFifthBit(s);
            } else {
                // if attribute value is not in table and could not be added
                _b = _nonIdentifyingStringOnFirstBitCES;
                encodeNonEmptyCharacterStringOnFifthBit(s);
            }
        } else {
            _b = _nonIdentifyingStringOnFirstBitCES;
            encodeNonEmptyCharacterStringOnFifthBit(s);
        }
    }
}
 
Example 7
Source Project: hottub   Source File: ParserVocabulary.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void addToTable(Iterator i, QualifiedNameArray a,
        boolean isAttribute,
        StringIntMap prefixMap, StringIntMap namespaceNameMap,
        StringIntMap localNameMap) {
    while (i.hasNext()) {
        addToNameTable((QName)i.next(), a, isAttribute,
                prefixMap, namespaceNameMap, localNameMap);
    }
}
 
Example 8
private void addToTable(String s, StringArray a, StringIntMap m) {
    if (s.length() == 0) {
        return;
    }

    if (m != null) m.obtainIndex(s);
    a.add(s);
}
 
Example 9
Source Project: hottub   Source File: ParserVocabulary.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void addToTable(String s, PrefixArray a, StringIntMap m) {
    if (s.length() == 0) {
        return;
    }

    if (m != null) m.obtainIndex(s);
    a.add(s);
}
 
Example 10
private void addToTable(String s, PrefixArray a, StringIntMap m) {
    if (s.length() == 0) {
        return;
    }

    if (m != null) m.obtainIndex(s);
    a.add(s);
}
 
Example 11
Source Project: hottub   Source File: VocabularyGenerator.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void addToTable(String s, Set v, StringIntMap m, PrefixArray a) {
    if (s.length() == 0) {
        return;
    }

    if (m.obtainIndex(s) == KeyIntMap.NOT_PRESENT) {
        a.add(s);
    }

    v.add(s);
}
 
Example 12
private void addToNameTable(QName n, QualifiedNameArray a,
        boolean isAttribute,
        StringIntMap prefixMap, StringIntMap namespaceNameMap,
        StringIntMap localNameMap) {
    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    if (n.getNamespaceURI().length() > 0) {
        namespaceURIIndex = namespaceNameMap.obtainIndex(n.getNamespaceURI());
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            namespaceURIIndex = namespaceName.getSize();
            namespaceName.add(n.getNamespaceURI());
        }

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

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

    QualifiedName name = new QualifiedName(n.getPrefix(), n.getNamespaceURI(), n.getLocalPart(),
            a.getSize(),
            prefixIndex, namespaceURIIndex, localNameIndex);
    if (isAttribute) {
        name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
    }
    a.add(name);
}
 
Example 13
public SerializerVocabulary() {
    tables[RESTRICTED_ALPHABET] = restrictedAlphabet = new StringIntMap(4);
    tables[ENCODING_ALGORITHM] = encodingAlgorithm = new StringIntMap(4);
    tables[PREFIX] = prefix = new FixedEntryStringIntMap(EncodingConstants.XML_NAMESPACE_PREFIX, 8);
    tables[NAMESPACE_NAME] = namespaceName = new FixedEntryStringIntMap(EncodingConstants.XML_NAMESPACE_NAME, 8);
    tables[LOCAL_NAME] = localName = new StringIntMap();
    tables[OTHER_NCNAME] = otherNCName = new StringIntMap(4);
    tables[OTHER_URI] = otherURI = new StringIntMap(4);
    tables[ATTRIBUTE_VALUE] = attributeValue = new StringIntMap();
    tables[OTHER_STRING] = otherString = new CharArrayIntMap(4);
    tables[CHARACTER_CONTENT_CHUNK] = characterContentChunk = new CharArrayIntMap();
    tables[ELEMENT_NAME] = elementName = new LocalNameQualifiedNamesMap();
    tables[ATTRIBUTE_NAME] = attributeName = new LocalNameQualifiedNamesMap();
}
 
Example 14
public void addToTable(String s, Set v, StringIntMap m, StringArray a) {
    if (s.length() == 0) {
        return;
    }

    if (m.obtainIndex(s) == KeyIntMap.NOT_PRESENT) {
        a.add(s);
    }

    v.add(s);
}
 
Example 15
private void addToTable(String s, StringIntMap m) {
    if (s.length() == 0) {
        return;
    }

    m.obtainIndex(s);
}
 
Example 16
public void addToTable(String s, Set v, StringIntMap m, StringArray a) {
    if (s.length() == 0) {
        return;
    }

    if (m.obtainIndex(s) == KeyIntMap.NOT_PRESENT) {
        a.add(s);
    }

    v.add(s);
}
 
Example 17
public void addToTable(String s, Set v, StringIntMap m, PrefixArray a) {
    if (s.length() == 0) {
        return;
    }

    if (m.obtainIndex(s) == KeyIntMap.NOT_PRESENT) {
        a.add(s);
    }

    v.add(s);
}
 
Example 18
public SAXDocumentSerializerWithPrefixMapping(Map namespaceToPrefixMapping) {
    // Use the local name to look up elements/attributes
    super(true);
    _namespaceToPrefixMapping = new HashMap(namespaceToPrefixMapping);
    _prefixToPrefixMapping = new HashMap();

    // Empty prefix
    _namespaceToPrefixMapping.put("", "");
    // 'xml' prefix
    _namespaceToPrefixMapping.put(EncodingConstants.XML_NAMESPACE_NAME, EncodingConstants.XML_NAMESPACE_PREFIX);

    _declaredNamespaces = new StringIntMap(4);
}
 
Example 19
Source Project: jdk8u60   Source File: Encoder.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Encode a non identifying string on the first bit of an octet.
 * Implementation of clause C.14 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
 *
 * @param s the string to encode
 * @param map the vocabulary table of strings to indexes.
 * @param addToTable true if the string could be added to the vocabulary
 *                   table (if table has enough memory)
 * @param mustBeAddedToTable true if the string must be added to the vocabulary
 *                   table (if not already present in the table).
 */
protected final void encodeNonIdentifyingStringOnFirstBit(String s, StringIntMap map,
        boolean addToTable, boolean mustBeAddedToTable) throws IOException {
    if (s == null || s.length() == 0) {
        // C.26 an index (first bit '1') with seven '1' bits for an empty string
        write(0xFF);
    } else {
        if (addToTable || mustBeAddedToTable) {
            // if attribute value could be added to table
            boolean canAddAttributeToTable = mustBeAddedToTable ||
                    canAddAttributeToTable(s.length());

            // obtain/get index
            int index = canAddAttributeToTable ?
                map.obtainIndex(s) :
                map.get(s);

            if (index != KeyIntMap.NOT_PRESENT) {
                // if attribute value is in table
                encodeNonZeroIntegerOnSecondBitFirstBitOne(index);
            } else if (canAddAttributeToTable) {
                // if attribute value is not in table, but could be added
                _b = EncodingConstants.NISTRING_ADD_TO_TABLE_FLAG |
                        _nonIdentifyingStringOnFirstBitCES;
                encodeNonEmptyCharacterStringOnFifthBit(s);
            } else {
                // if attribute value is not in table and could not be added
                _b = _nonIdentifyingStringOnFirstBitCES;
                encodeNonEmptyCharacterStringOnFifthBit(s);
            }
        } else {
            _b = _nonIdentifyingStringOnFirstBitCES;
            encodeNonEmptyCharacterStringOnFifthBit(s);
        }
    }
}
 
Example 20
Source Project: openjdk-8   Source File: Encoder.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Encode a non empty identifying string on the first bit of an octet.
 * Implementation of clause C.13 of ITU-T Rec. X.891 | ISO/IEC 24824-1.
 *
 * @param s the identifying string.
 * @param map the vocabulary table to use to determin the index of the
 *        identifying string
 */
protected final void encodeIdentifyingNonEmptyStringOnFirstBit(String s, StringIntMap map) throws IOException {
    int index = map.obtainIndex(s);
    if (index == KeyIntMap.NOT_PRESENT) {
        // _b = 0;
        encodeNonEmptyOctetStringOnSecondBit(s);
    } else {
        // _b = 0x80;
        encodeNonZeroIntegerOnSecondBitFirstBitOne(index);
    }
}
 
Example 21
Source Project: jdk8u60   Source File: ParserVocabulary.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void addToTable(String s, StringArray a, StringIntMap m) {
    if (s.length() == 0) {
        return;
    }

    if (m != null) m.obtainIndex(s);
    a.add(s);
}
 
Example 22
Source Project: jdk8u60   Source File: ParserVocabulary.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void addToTable(String s, PrefixArray a, StringIntMap m) {
    if (s.length() == 0) {
        return;
    }

    if (m != null) m.obtainIndex(s);
    a.add(s);
}
 
Example 23
Source Project: jdk8u60   Source File: ParserVocabulary.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void addToTable(Iterator i, QualifiedNameArray a,
        boolean isAttribute,
        StringIntMap prefixMap, StringIntMap namespaceNameMap,
        StringIntMap localNameMap) {
    while (i.hasNext()) {
        addToNameTable((QName)i.next(), a, isAttribute,
                prefixMap, namespaceNameMap, localNameMap);
    }
}
 
Example 24
Source Project: hottub   Source File: ParserVocabulary.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void addToNameTable(QName n, QualifiedNameArray a,
        boolean isAttribute,
        StringIntMap prefixMap, StringIntMap namespaceNameMap,
        StringIntMap localNameMap) {
    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    if (n.getNamespaceURI().length() > 0) {
        namespaceURIIndex = namespaceNameMap.obtainIndex(n.getNamespaceURI());
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            namespaceURIIndex = namespaceName.getSize();
            namespaceName.add(n.getNamespaceURI());
        }

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

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

    QualifiedName name = new QualifiedName(n.getPrefix(), n.getNamespaceURI(), n.getLocalPart(),
            a.getSize(),
            prefixIndex, namespaceURIIndex, localNameIndex);
    if (isAttribute) {
        name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
    }
    a.add(name);
}
 
Example 25
Source Project: hottub   Source File: SerializerVocabulary.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void addToTable(String s, StringIntMap m) {
    if (s.length() == 0) {
        return;
    }

    m.obtainIndex(s);
}
 
Example 26
private void addToNameTable(QName n, QualifiedNameArray a,
        boolean isAttribute,
        StringIntMap prefixMap, StringIntMap namespaceNameMap,
        StringIntMap localNameMap) {
    int namespaceURIIndex = -1;
    int prefixIndex = -1;
    if (n.getNamespaceURI().length() > 0) {
        namespaceURIIndex = namespaceNameMap.obtainIndex(n.getNamespaceURI());
        if (namespaceURIIndex == KeyIntMap.NOT_PRESENT) {
            namespaceURIIndex = namespaceName.getSize();
            namespaceName.add(n.getNamespaceURI());
        }

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

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

    QualifiedName name = new QualifiedName(n.getPrefix(), n.getNamespaceURI(), n.getLocalPart(),
            a.getSize(),
            prefixIndex, namespaceURIIndex, localNameIndex);
    if (isAttribute) {
        name.createAttributeValues(DuplicateAttributeVerifier.MAP_SIZE);
    }
    a.add(name);
}
 
Example 27
Source Project: hottub   Source File: SerializerVocabulary.java    License: GNU General Public License v2.0 5 votes vote down vote up
public SerializerVocabulary() {
    tables[RESTRICTED_ALPHABET] = restrictedAlphabet = new StringIntMap(4);
    tables[ENCODING_ALGORITHM] = encodingAlgorithm = new StringIntMap(4);
    tables[PREFIX] = prefix = new FixedEntryStringIntMap(EncodingConstants.XML_NAMESPACE_PREFIX, 8);
    tables[NAMESPACE_NAME] = namespaceName = new FixedEntryStringIntMap(EncodingConstants.XML_NAMESPACE_NAME, 8);
    tables[LOCAL_NAME] = localName = new StringIntMap();
    tables[OTHER_NCNAME] = otherNCName = new StringIntMap(4);
    tables[OTHER_URI] = otherURI = new StringIntMap(4);
    tables[ATTRIBUTE_VALUE] = attributeValue = new StringIntMap();
    tables[OTHER_STRING] = otherString = new CharArrayIntMap(4);
    tables[CHARACTER_CONTENT_CHUNK] = characterContentChunk = new CharArrayIntMap();
    tables[ELEMENT_NAME] = elementName = new LocalNameQualifiedNamesMap();
    tables[ATTRIBUTE_NAME] = attributeName = new LocalNameQualifiedNamesMap();
}
 
Example 28
Source Project: jdk8u60   Source File: VocabularyGenerator.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void addToTable(String s, Set v, StringIntMap m, StringArray a) {
    if (s.length() == 0) {
        return;
    }

    if (m.obtainIndex(s) == KeyIntMap.NOT_PRESENT) {
        a.add(s);
    }

    v.add(s);
}
 
Example 29
Source Project: jdk8u60   Source File: VocabularyGenerator.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void addToTable(String s, Set v, StringIntMap m, PrefixArray a) {
    if (s.length() == 0) {
        return;
    }

    if (m.obtainIndex(s) == KeyIntMap.NOT_PRESENT) {
        a.add(s);
    }

    v.add(s);
}
 
Example 30
public SAXDocumentSerializerWithPrefixMapping(Map namespaceToPrefixMapping) {
    // Use the local name to look up elements/attributes
    super(true);
    _namespaceToPrefixMapping = new HashMap(namespaceToPrefixMapping);
    _prefixToPrefixMapping = new HashMap();

    // Empty prefix
    _namespaceToPrefixMapping.put("", "");
    // 'xml' prefix
    _namespaceToPrefixMapping.put(EncodingConstants.XML_NAMESPACE_NAME, EncodingConstants.XML_NAMESPACE_PREFIX);

    _declaredNamespaces = new StringIntMap(4);
}