Package org.jvnet.fastinfoset

Examples of org.jvnet.fastinfoset.FastInfosetException


            decodeUtf8StringAsCharBuffer(_characterContentChunkTable._array, charactersOffset);
            _characterContentChunkTable.add(_charBufferLength);
            try {
                _contentHandler.characters(_characterContentChunkTable._array, charactersOffset, _charBufferLength);
            } catch (SAXException e) {
                throw new FastInfosetException("processCII", e);
            }
        } else {
            decodeUtf8StringAsCharBuffer();
            try {
                _contentHandler.characters(_charBuffer, 0, _charBufferLength);
            } catch (SAXException e) {
                throw new FastInfosetException("processCII", e);
            }
        }
    }
View Full Code Here


                default:
                    throw new IOException(CommonResourceBundle.getInstance().getString("message.decodingAIIs"));
            }
           
            if (name.prefixIndex > 0 && _prefixTable._currentInScope[name.prefixIndex] != name.namespaceNameIndex) {
                throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.AIIqNameNotInScope"));
            }
           
            _duplicateAttributeVerifier.checkForDuplicateAttribute(name.attributeHash, name.attributeId);
           
            // [normalized value] of AII
View Full Code Here

                }
               
                try {
                    _lexicalHandler.comment(_charBuffer, 0, _charBufferLength);
                } catch (SAXException e) {
                    throw new FastInfosetException("processCommentII", e);
                }
                break;
            case NISTRING_ENCODING_ALGORITHM:
                throw new IOException(CommonResourceBundle.getInstance().getString("message.commentIIAlgorithmNotSupported"));
            case NISTRING_INDEX:
                final CharArray ca = _v.otherString.get(_integer);
               
                try {
                    _lexicalHandler.comment(ca.ch, ca.start, ca.length);
                } catch (SAXException e) {
                    throw new FastInfosetException("processCommentII", e);
                }
                break;
            case NISTRING_EMPTY_STRING:
                try {
                    _lexicalHandler.comment(_charBuffer, 0, 0);
                } catch (SAXException e) {
                    throw new FastInfosetException("processCommentII", e);
                }
                break;
        }
    }
View Full Code Here

                    _v.otherString.add(new CharArrayString(data));
                }
                try {
                    _contentHandler.processingInstruction(target, data);
                } catch (SAXException e) {
                    throw new FastInfosetException("processProcessingII", e);
                }
                break;
            case NISTRING_ENCODING_ALGORITHM:
                throw new IOException(CommonResourceBundle.getInstance().getString("message.processingIIWithEncodingAlgorithm"));
            case NISTRING_INDEX:
                try {
                    _contentHandler.processingInstruction(target, _v.otherString.get(_integer).toString());
                } catch (SAXException e) {
                    throw new FastInfosetException("processProcessingII", e);
                }
                break;
            case NISTRING_EMPTY_STRING:
                try {
                    _contentHandler.processingInstruction(target, "");
                } catch (SAXException e) {
                    throw new FastInfosetException("processProcessingII", e);
                }
                break;
        }
    }
View Full Code Here

                Object array = processBuiltInEncodingAlgorithmAsObject();
               
                try {
                    _algorithmHandler.object(null, _identifier, array);
                } catch (SAXException e) {
                    throw new FastInfosetException(e);
                }
            } else {
                StringBuffer buffer = new StringBuffer();
                processBuiltInEncodingAlgorithmAsCharacters(buffer);
               
                try {
                    _contentHandler.characters(buffer.toString().toCharArray(), 0, buffer.length());
                } catch (SAXException e) {
                    throw new FastInfosetException(e);
                }
            }
           
            if (addToTable) {
                StringBuffer buffer = new StringBuffer();
                processBuiltInEncodingAlgorithmAsCharacters(buffer);
                _characterContentChunkTable.add(buffer.toString().toCharArray(), buffer.length());
            }
        } else if (_identifier == EncodingAlgorithmIndexes.CDATA) {
            // Set back buffer position to start of encoded string
            _octetBufferOffset -= _octetBufferLength;
            decodeUtf8StringIntoCharBuffer();
           
            try {
                _lexicalHandler.startCDATA();
                _contentHandler.characters(_charBuffer, 0, _charBufferLength);
                _lexicalHandler.endCDATA();
            } catch (SAXException e) {
                throw new FastInfosetException(e);
            }
           
            if (addToTable) {
                _characterContentChunkTable.add(_charBuffer, _charBufferLength);
            }
        } else if (_identifier >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START && _algorithmHandler != null) {
            final String URI = _v.encodingAlgorithm.get(_identifier - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START);
            if (URI == null) {
                throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
                        getString("message.URINotPresent", new Object[]{Integer.valueOf(_identifier)}));
            }
           
            final EncodingAlgorithm ea = (EncodingAlgorithm)_registeredEncodingAlgorithms.get(URI);
            if (ea != null) {
                final Object data = ea.decodeFromBytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
                try {
                    _algorithmHandler.object(URI, _identifier, data);
                } catch (SAXException e) {
                    throw new FastInfosetException(e);
                }
            } else {
                try {
                    _algorithmHandler.octets(URI, _identifier, _octetBuffer, _octetBufferStart, _octetBufferLength);
                } catch (SAXException e) {
                    throw new FastInfosetException(e);
                }
            }
            if (addToTable) {
                throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.addToTableNotSupported"));
            }
View Full Code Here

                    _primitiveHandler.uuids(builtInAlgorithmState.longArray, 0, length);
                    break;
                case EncodingAlgorithmIndexes.CDATA:
                    throw new UnsupportedOperationException("CDATA");
                default:
                    throw new FastInfosetException(CommonResourceBundle.getInstance().
                            getString("message.unsupportedAlgorithm", new Object[]{Integer.valueOf(_identifier)}));
            }
        } catch (SAXException e) {
            throw new FastInfosetException(e);
        }
    }
View Full Code Here

                    }
                   
                    _internalState = INTERNAL_STATE_END_DOCUMENT;
                    return _eventType = END_DOCUMENT;
                default:
                    throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEII"));
            }
        } catch (IOException e) {
            resetOnError();
            logger.log(Level.FINE, "next() exception", e);
            throw new XMLStreamException(e);
View Full Code Here

                    return ENTITY_REFERENCE;
                case DecoderStateTables.TERMINATOR_DOUBLE:
                case DecoderStateTables.TERMINATOR_SINGLE:
                    return (_stackCount != -1) ? END_ELEMENT : END_DOCUMENT;
                default:
                    throw new FastInfosetException(
                            CommonResourceBundle.getInstance().getString("message.IllegalStateDecodingEII"));
            }
        } catch (IOException e) {
            throw new XMLStreamException(e);
        } catch (FastInfosetException e) {
View Full Code Here

            _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"));
        }
    }
View Full Code Here

        }
    }
   
    protected final void processEII(QualifiedName name, boolean hasAttributes) throws FastInfosetException, IOException {
        if (_prefixTable._currentInScope[name.prefixIndex] != name.namespaceNameIndex) {
            throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.qnameOfEIINotInScope"));
        }
       
        _eventType = START_ELEMENT;
        _qualifiedName = name;
       
View Full Code Here

TOP

Related Classes of org.jvnet.fastinfoset.FastInfosetException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.