com.sun.xml.internal.fastinfoset.DecoderStateTables Java Examples

The following examples show how to use com.sun.xml.internal.fastinfoset.DecoderStateTables. 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: StAXDocumentParser.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean isBase64Follows() throws IOException {
    // Process information item
    int b = peek(this);
    switch (DecoderStateTables.EII(b)) {
        case DecoderStateTables.CII_EA:
            int algorithmId = (b & 0x02) << 6;
            int b2 = peek2(this);
            algorithmId |= (b2 & 0xFC) >> 2;

            return algorithmId == EncodingAlgorithmIndexes.BASE64;
        default:
            return false;
    }
}
 
Example #2
Source File: StAXDocumentParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public boolean isBase64Follows() throws IOException {
    // Process information item
    int b = peek(this);
    switch (DecoderStateTables.EII(b)) {
        case DecoderStateTables.CII_EA:
            int algorithmId = (b & 0x02) << 6;
            int b2 = peek2(this);
            algorithmId |= (b2 & 0xFC) >> 2;

            return algorithmId == EncodingAlgorithmIndexes.BASE64;
        default:
            return false;
    }
}
 
Example #3
Source File: StAXDocumentParser.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public boolean isBase64Follows() throws IOException {
    // Process information item
    int b = peek(this);
    switch (DecoderStateTables.EII(b)) {
        case DecoderStateTables.CII_EA:
            int algorithmId = (b & 0x02) << 6;
            int b2 = peek2(this);
            algorithmId |= (b2 & 0xFC) >> 2;

            return algorithmId == EncodingAlgorithmIndexes.BASE64;
        default:
            return false;
    }
}
 
Example #4
Source File: StAXDocumentParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public boolean isBase64Follows() throws IOException {
    // Process information item
    int b = peek(this);
    switch (DecoderStateTables.EII(b)) {
        case DecoderStateTables.CII_EA:
            int algorithmId = (b & 0x02) << 6;
            int b2 = peek2(this);
            algorithmId |= (b2 & 0xFC) >> 2;

            return algorithmId == EncodingAlgorithmIndexes.BASE64;
        default:
            return false;
    }
}
 
Example #5
Source File: StAXDocumentParser.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public boolean isBase64Follows() throws IOException {
    // Process information item
    int b = peek(this);
    switch (DecoderStateTables.EII(b)) {
        case DecoderStateTables.CII_EA:
            int algorithmId = (b & 0x02) << 6;
            int b2 = peek2(this);
            algorithmId |= (b2 & 0xFC) >> 2;

            return algorithmId == EncodingAlgorithmIndexes.BASE64;
        default:
            return false;
    }
}
 
Example #6
Source File: StAXDocumentParser.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public boolean isBase64Follows() throws IOException {
    // Process information item
    int b = peek(this);
    switch (DecoderStateTables.EII(b)) {
        case DecoderStateTables.CII_EA:
            int algorithmId = (b & 0x02) << 6;
            int b2 = peek2(this);
            algorithmId |= (b2 & 0xFC) >> 2;

            return algorithmId == EncodingAlgorithmIndexes.BASE64;
        default:
            return false;
    }
}
 
Example #7
Source File: StAXDocumentParser.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public boolean isBase64Follows() throws IOException {
    // Process information item
    int b = peek(this);
    switch (DecoderStateTables.EII(b)) {
        case DecoderStateTables.CII_EA:
            int algorithmId = (b & 0x02) << 6;
            int b2 = peek2(this);
            algorithmId |= (b2 & 0xFC) >> 2;

            return algorithmId == EncodingAlgorithmIndexes.BASE64;
        default:
            return false;
    }
}
 
Example #8
Source File: StAXDocumentParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean isBase64Follows() throws IOException {
    // Process information item
    int b = peek(this);
    switch (DecoderStateTables.EII(b)) {
        case DecoderStateTables.CII_EA:
            int algorithmId = (b & 0x02) << 6;
            int b2 = peek2(this);
            algorithmId |= (b2 & 0xFC) >> 2;

            return algorithmId == EncodingAlgorithmIndexes.BASE64;
        default:
            return false;
    }
}
 
Example #9
Source File: StAXDocumentParser.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected final void processEIIWithNamespaces(boolean hasAttributes) throws FastInfosetException, IOException {
    if (++_prefixTable._declarationId == Integer.MAX_VALUE) {
        _prefixTable.clearDeclarationIds();
    }

    _currentNamespaceAIIsStart = _namespaceAIIsIndex;
    String prefix = "", namespaceName = "";
    int b = read();
    while ((b & EncodingConstants.NAMESPACE_ATTRIBUTE_MASK) == EncodingConstants.NAMESPACE_ATTRIBUTE) {
        if (_namespaceAIIsIndex == _namespaceAIIsPrefix.length) {
            resizeNamespaceAIIs();
        }

        switch (b & EncodingConstants.NAMESPACE_ATTRIBUTE_PREFIX_NAME_MASK) {
            // no prefix, no namespace
            // Undeclaration of default namespace
            case 0:
                prefix = namespaceName =
                        _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // no prefix, namespace
                // Declaration of default namespace
            case 1:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] = "";
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(false);

                _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // prefix, no namespace
                // Undeclaration of namespace
            case 2:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(false);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = -1;
                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
                // prefix, namespace
                // Declaration of prefixed namespace
            case 3:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(true);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(true);

                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
        }

        // Push namespace declarations onto the stack
        _prefixTable.pushScopeWithPrefixEntry(prefix, namespaceName, _prefixIndex, _namespaceNameIndex);

        b = read();
    }
    if (b != EncodingConstants.TERMINATOR) {
        throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.EIInamespaceNameNotTerminatedCorrectly"));
    }
    _currentNamespaceAIIsEnd = _namespaceAIIsIndex;

    b = read();
    switch(DecoderStateTables.EII(b)) {
        case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
            processEII(_elementNameTable._array[b], hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_MEDIUM:
            processEII(processEIIIndexMedium(b), hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_LARGE:
            processEII(processEIIIndexLarge(b), hasAttributes);
            break;
        case DecoderStateTables.EII_LITERAL:
        {
            final QualifiedName qn = processLiteralQualifiedName(
                    b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
                    _elementNameTable.getNext());
            _elementNameTable.add(qn);
            processEII(qn, hasAttributes);
            break;
        }
        default:
            throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEIIAfterAIIs"));
    }
}
 
Example #10
Source File: StAXDocumentParser.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected final void processEIIWithNamespaces(boolean hasAttributes) throws FastInfosetException, IOException {
    if (++_prefixTable._declarationId == Integer.MAX_VALUE) {
        _prefixTable.clearDeclarationIds();
    }

    _currentNamespaceAIIsStart = _namespaceAIIsIndex;
    String prefix = "", namespaceName = "";
    int b = read();
    while ((b & EncodingConstants.NAMESPACE_ATTRIBUTE_MASK) == EncodingConstants.NAMESPACE_ATTRIBUTE) {
        if (_namespaceAIIsIndex == _namespaceAIIsPrefix.length) {
            resizeNamespaceAIIs();
        }

        switch (b & EncodingConstants.NAMESPACE_ATTRIBUTE_PREFIX_NAME_MASK) {
            // no prefix, no namespace
            // Undeclaration of default namespace
            case 0:
                prefix = namespaceName =
                        _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // no prefix, namespace
                // Declaration of default namespace
            case 1:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] = "";
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(false);

                _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // prefix, no namespace
                // Undeclaration of namespace
            case 2:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(false);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = -1;
                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
                // prefix, namespace
                // Declaration of prefixed namespace
            case 3:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(true);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(true);

                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
        }

        // Push namespace declarations onto the stack
        _prefixTable.pushScopeWithPrefixEntry(prefix, namespaceName, _prefixIndex, _namespaceNameIndex);

        b = read();
    }
    if (b != EncodingConstants.TERMINATOR) {
        throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.EIInamespaceNameNotTerminatedCorrectly"));
    }
    _currentNamespaceAIIsEnd = _namespaceAIIsIndex;

    b = read();
    switch(DecoderStateTables.EII(b)) {
        case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
            processEII(_elementNameTable._array[b], hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_MEDIUM:
            processEII(processEIIIndexMedium(b), hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_LARGE:
            processEII(processEIIIndexLarge(b), hasAttributes);
            break;
        case DecoderStateTables.EII_LITERAL:
        {
            final QualifiedName qn = processLiteralQualifiedName(
                    b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
                    _elementNameTable.getNext());
            _elementNameTable.add(qn);
            processEII(qn, hasAttributes);
            break;
        }
        default:
            throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEIIAfterAIIs"));
    }
}
 
Example #11
Source File: StAXDocumentParser.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected final void processEIIWithNamespaces(boolean hasAttributes) throws FastInfosetException, IOException {
    if (++_prefixTable._declarationId == Integer.MAX_VALUE) {
        _prefixTable.clearDeclarationIds();
    }

    _currentNamespaceAIIsStart = _namespaceAIIsIndex;
    String prefix = "", namespaceName = "";
    int b = read();
    while ((b & EncodingConstants.NAMESPACE_ATTRIBUTE_MASK) == EncodingConstants.NAMESPACE_ATTRIBUTE) {
        if (_namespaceAIIsIndex == _namespaceAIIsPrefix.length) {
            resizeNamespaceAIIs();
        }

        switch (b & EncodingConstants.NAMESPACE_ATTRIBUTE_PREFIX_NAME_MASK) {
            // no prefix, no namespace
            // Undeclaration of default namespace
            case 0:
                prefix = namespaceName =
                        _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // no prefix, namespace
                // Declaration of default namespace
            case 1:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] = "";
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(false);

                _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // prefix, no namespace
                // Undeclaration of namespace
            case 2:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(false);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = -1;
                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
                // prefix, namespace
                // Declaration of prefixed namespace
            case 3:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(true);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(true);

                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
        }

        // Push namespace declarations onto the stack
        _prefixTable.pushScopeWithPrefixEntry(prefix, namespaceName, _prefixIndex, _namespaceNameIndex);

        b = read();
    }
    if (b != EncodingConstants.TERMINATOR) {
        throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.EIInamespaceNameNotTerminatedCorrectly"));
    }
    _currentNamespaceAIIsEnd = _namespaceAIIsIndex;

    b = read();
    switch(DecoderStateTables.EII(b)) {
        case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
            processEII(_elementNameTable._array[b], hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_MEDIUM:
            processEII(processEIIIndexMedium(b), hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_LARGE:
            processEII(processEIIIndexLarge(b), hasAttributes);
            break;
        case DecoderStateTables.EII_LITERAL:
        {
            final QualifiedName qn = processLiteralQualifiedName(
                    b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
                    _elementNameTable.getNext());
            _elementNameTable.add(qn);
            processEII(qn, hasAttributes);
            break;
        }
        default:
            throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEIIAfterAIIs"));
    }
}
 
Example #12
Source File: StAXDocumentParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected final void processEIIWithNamespaces(boolean hasAttributes) throws FastInfosetException, IOException {
    if (++_prefixTable._declarationId == Integer.MAX_VALUE) {
        _prefixTable.clearDeclarationIds();
    }

    _currentNamespaceAIIsStart = _namespaceAIIsIndex;
    String prefix = "", namespaceName = "";
    int b = read();
    while ((b & EncodingConstants.NAMESPACE_ATTRIBUTE_MASK) == EncodingConstants.NAMESPACE_ATTRIBUTE) {
        if (_namespaceAIIsIndex == _namespaceAIIsPrefix.length) {
            resizeNamespaceAIIs();
        }

        switch (b & EncodingConstants.NAMESPACE_ATTRIBUTE_PREFIX_NAME_MASK) {
            // no prefix, no namespace
            // Undeclaration of default namespace
            case 0:
                prefix = namespaceName =
                        _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // no prefix, namespace
                // Declaration of default namespace
            case 1:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] = "";
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(false);

                _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // prefix, no namespace
                // Undeclaration of namespace
            case 2:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(false);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = -1;
                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
                // prefix, namespace
                // Declaration of prefixed namespace
            case 3:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(true);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(true);

                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
        }

        // Push namespace declarations onto the stack
        _prefixTable.pushScopeWithPrefixEntry(prefix, namespaceName, _prefixIndex, _namespaceNameIndex);

        b = read();
    }
    if (b != EncodingConstants.TERMINATOR) {
        throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.EIInamespaceNameNotTerminatedCorrectly"));
    }
    _currentNamespaceAIIsEnd = _namespaceAIIsIndex;

    b = read();
    switch(DecoderStateTables.EII(b)) {
        case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
            processEII(_elementNameTable._array[b], hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_MEDIUM:
            processEII(processEIIIndexMedium(b), hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_LARGE:
            processEII(processEIIIndexLarge(b), hasAttributes);
            break;
        case DecoderStateTables.EII_LITERAL:
        {
            final QualifiedName qn = processLiteralQualifiedName(
                    b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
                    _elementNameTable.getNext());
            _elementNameTable.add(qn);
            processEII(qn, hasAttributes);
            break;
        }
        default:
            throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEIIAfterAIIs"));
    }
}
 
Example #13
Source File: StAXDocumentParser.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected final void processEIIWithNamespaces(boolean hasAttributes) throws FastInfosetException, IOException {
    if (++_prefixTable._declarationId == Integer.MAX_VALUE) {
        _prefixTable.clearDeclarationIds();
    }

    _currentNamespaceAIIsStart = _namespaceAIIsIndex;
    String prefix = "", namespaceName = "";
    int b = read();
    while ((b & EncodingConstants.NAMESPACE_ATTRIBUTE_MASK) == EncodingConstants.NAMESPACE_ATTRIBUTE) {
        if (_namespaceAIIsIndex == _namespaceAIIsPrefix.length) {
            resizeNamespaceAIIs();
        }

        switch (b & EncodingConstants.NAMESPACE_ATTRIBUTE_PREFIX_NAME_MASK) {
            // no prefix, no namespace
            // Undeclaration of default namespace
            case 0:
                prefix = namespaceName =
                        _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // no prefix, namespace
                // Declaration of default namespace
            case 1:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] = "";
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(false);

                _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // prefix, no namespace
                // Undeclaration of namespace
            case 2:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(false);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = -1;
                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
                // prefix, namespace
                // Declaration of prefixed namespace
            case 3:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(true);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(true);

                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
        }

        // Push namespace declarations onto the stack
        _prefixTable.pushScopeWithPrefixEntry(prefix, namespaceName, _prefixIndex, _namespaceNameIndex);

        b = read();
    }
    if (b != EncodingConstants.TERMINATOR) {
        throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.EIInamespaceNameNotTerminatedCorrectly"));
    }
    _currentNamespaceAIIsEnd = _namespaceAIIsIndex;

    b = read();
    switch(DecoderStateTables.EII(b)) {
        case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
            processEII(_elementNameTable._array[b], hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_MEDIUM:
            processEII(processEIIIndexMedium(b), hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_LARGE:
            processEII(processEIIIndexLarge(b), hasAttributes);
            break;
        case DecoderStateTables.EII_LITERAL:
        {
            final QualifiedName qn = processLiteralQualifiedName(
                    b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
                    _elementNameTable.getNext());
            _elementNameTable.add(qn);
            processEII(qn, hasAttributes);
            break;
        }
        default:
            throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEIIAfterAIIs"));
    }
}
 
Example #14
Source File: StAXDocumentParser.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected final void processEIIWithNamespaces(boolean hasAttributes) throws FastInfosetException, IOException {
    if (++_prefixTable._declarationId == Integer.MAX_VALUE) {
        _prefixTable.clearDeclarationIds();
    }

    _currentNamespaceAIIsStart = _namespaceAIIsIndex;
    String prefix = "", namespaceName = "";
    int b = read();
    while ((b & EncodingConstants.NAMESPACE_ATTRIBUTE_MASK) == EncodingConstants.NAMESPACE_ATTRIBUTE) {
        if (_namespaceAIIsIndex == _namespaceAIIsPrefix.length) {
            resizeNamespaceAIIs();
        }

        switch (b & EncodingConstants.NAMESPACE_ATTRIBUTE_PREFIX_NAME_MASK) {
            // no prefix, no namespace
            // Undeclaration of default namespace
            case 0:
                prefix = namespaceName =
                        _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // no prefix, namespace
                // Declaration of default namespace
            case 1:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] = "";
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(false);

                _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // prefix, no namespace
                // Undeclaration of namespace
            case 2:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(false);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = -1;
                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
                // prefix, namespace
                // Declaration of prefixed namespace
            case 3:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(true);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(true);

                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
        }

        // Push namespace declarations onto the stack
        _prefixTable.pushScopeWithPrefixEntry(prefix, namespaceName, _prefixIndex, _namespaceNameIndex);

        b = read();
    }
    if (b != EncodingConstants.TERMINATOR) {
        throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.EIInamespaceNameNotTerminatedCorrectly"));
    }
    _currentNamespaceAIIsEnd = _namespaceAIIsIndex;

    b = read();
    switch(DecoderStateTables.EII(b)) {
        case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
            processEII(_elementNameTable._array[b], hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_MEDIUM:
            processEII(processEIIIndexMedium(b), hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_LARGE:
            processEII(processEIIIndexLarge(b), hasAttributes);
            break;
        case DecoderStateTables.EII_LITERAL:
        {
            final QualifiedName qn = processLiteralQualifiedName(
                    b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
                    _elementNameTable.getNext());
            _elementNameTable.add(qn);
            processEII(qn, hasAttributes);
            break;
        }
        default:
            throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEIIAfterAIIs"));
    }
}
 
Example #15
Source File: StAXDocumentParser.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected final void processEIIWithNamespaces(boolean hasAttributes) throws FastInfosetException, IOException {
    if (++_prefixTable._declarationId == Integer.MAX_VALUE) {
        _prefixTable.clearDeclarationIds();
    }

    _currentNamespaceAIIsStart = _namespaceAIIsIndex;
    String prefix = "", namespaceName = "";
    int b = read();
    while ((b & EncodingConstants.NAMESPACE_ATTRIBUTE_MASK) == EncodingConstants.NAMESPACE_ATTRIBUTE) {
        if (_namespaceAIIsIndex == _namespaceAIIsPrefix.length) {
            resizeNamespaceAIIs();
        }

        switch (b & EncodingConstants.NAMESPACE_ATTRIBUTE_PREFIX_NAME_MASK) {
            // no prefix, no namespace
            // Undeclaration of default namespace
            case 0:
                prefix = namespaceName =
                        _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // no prefix, namespace
                // Declaration of default namespace
            case 1:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] = "";
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(false);

                _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // prefix, no namespace
                // Undeclaration of namespace
            case 2:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(false);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = -1;
                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
                // prefix, namespace
                // Declaration of prefixed namespace
            case 3:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(true);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(true);

                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
        }

        // Push namespace declarations onto the stack
        _prefixTable.pushScopeWithPrefixEntry(prefix, namespaceName, _prefixIndex, _namespaceNameIndex);

        b = read();
    }
    if (b != EncodingConstants.TERMINATOR) {
        throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.EIInamespaceNameNotTerminatedCorrectly"));
    }
    _currentNamespaceAIIsEnd = _namespaceAIIsIndex;

    b = read();
    switch(DecoderStateTables.EII(b)) {
        case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
            processEII(_elementNameTable._array[b], hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_MEDIUM:
            processEII(processEIIIndexMedium(b), hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_LARGE:
            processEII(processEIIIndexLarge(b), hasAttributes);
            break;
        case DecoderStateTables.EII_LITERAL:
        {
            final QualifiedName qn = processLiteralQualifiedName(
                    b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
                    _elementNameTable.getNext());
            _elementNameTable.add(qn);
            processEII(qn, hasAttributes);
            break;
        }
        default:
            throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEIIAfterAIIs"));
    }
}
 
Example #16
Source File: StAXDocumentParser.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected final void processEIIWithNamespaces(boolean hasAttributes) throws FastInfosetException, IOException {
    if (++_prefixTable._declarationId == Integer.MAX_VALUE) {
        _prefixTable.clearDeclarationIds();
    }

    _currentNamespaceAIIsStart = _namespaceAIIsIndex;
    String prefix = "", namespaceName = "";
    int b = read();
    while ((b & EncodingConstants.NAMESPACE_ATTRIBUTE_MASK) == EncodingConstants.NAMESPACE_ATTRIBUTE) {
        if (_namespaceAIIsIndex == _namespaceAIIsPrefix.length) {
            resizeNamespaceAIIs();
        }

        switch (b & EncodingConstants.NAMESPACE_ATTRIBUTE_PREFIX_NAME_MASK) {
            // no prefix, no namespace
            // Undeclaration of default namespace
            case 0:
                prefix = namespaceName =
                        _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // no prefix, namespace
                // Declaration of default namespace
            case 1:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] = "";
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(false);

                _prefixIndex = _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = -1;
                break;
                // prefix, no namespace
                // Undeclaration of namespace
            case 2:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(false);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] = "";

                _namespaceNameIndex = -1;
                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
                // prefix, namespace
                // Declaration of prefixed namespace
            case 3:
                prefix = _namespaceAIIsPrefix[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(true);
                namespaceName = _namespaceAIIsNamespaceName[_namespaceAIIsIndex] =
                        decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(true);

                _namespaceAIIsPrefixIndex[_namespaceAIIsIndex++] = _prefixIndex;
                break;
        }

        // Push namespace declarations onto the stack
        _prefixTable.pushScopeWithPrefixEntry(prefix, namespaceName, _prefixIndex, _namespaceNameIndex);

        b = read();
    }
    if (b != EncodingConstants.TERMINATOR) {
        throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.EIInamespaceNameNotTerminatedCorrectly"));
    }
    _currentNamespaceAIIsEnd = _namespaceAIIsIndex;

    b = read();
    switch(DecoderStateTables.EII(b)) {
        case DecoderStateTables.EII_NO_AIIS_INDEX_SMALL:
            processEII(_elementNameTable._array[b], hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_MEDIUM:
            processEII(processEIIIndexMedium(b), hasAttributes);
            break;
        case DecoderStateTables.EII_INDEX_LARGE:
            processEII(processEIIIndexLarge(b), hasAttributes);
            break;
        case DecoderStateTables.EII_LITERAL:
        {
            final QualifiedName qn = processLiteralQualifiedName(
                    b & EncodingConstants.LITERAL_QNAME_PREFIX_NAMESPACE_NAME_MASK,
                    _elementNameTable.getNext());
            _elementNameTable.add(qn);
            processEII(qn, hasAttributes);
            break;
        }
        default:
            throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEIIAfterAIIs"));
    }
}