Package javolution.xml.stream

Examples of javolution.xml.stream.XMLStreamException


         *
         * @return the attributes mapping.
         */
        public Attributes getAttributes() throws XMLStreamException {
            if (_isReaderAtNext)
                throw new XMLStreamException(
                        "Attributes should be read before content");
            return _reader.getAttributes();
        }
View Full Code Here


         * @return the value for the specified attribute or <code>null</code>
         *         if the attribute is not found.
         */
        public CharArray getAttribute(String name) throws XMLStreamException {
            if (_isReaderAtNext)
                throw new XMLStreamException(
                        "Attributes should be read before reading content");
            return _reader.getAttributeValue(null, name);
        }
View Full Code Here

                throws XMLStreamException {
            CharArray value = getAttribute(name);
            if (value == null)
                return defaultValue;
            if (value.length() != 1)
                throw new XMLStreamException(
                        "Single character expected (read '" + value + "')");
            return value.charAt(0);
        }
View Full Code Here

                return defaultValue;
            // Parses attribute value.
            Class<?> type = defaultValue.getClass();
            TextFormat<?> format = TextContext.getFormat(type);
            if (format == null)
                throw new XMLStreamException("No TextFormat defined for "
                        + type);
            return (T) format.parse(value);
        }
View Full Code Here

                _writer.close();
                reset();
            }

        } catch (IOException e) {
            throw new XMLStreamException(e);
        }
    }
View Full Code Here

            } else if (_reader != null) {
                _reader.close();
                reset();
            }
        } catch (IOException e) {
            throw new XMLStreamException(e);
        }
    }
View Full Code Here

        } else {
            try {
                _encoding = encoding;
                setOutput(new OutputStreamWriter(out, encoding));
            } catch (UnsupportedEncodingException e) {
                throw new XMLStreamException(e);
            }
        }
    }
View Full Code Here

    // Implements XMLStreamWriter interface.
    public void writeStartElement(CharSequence localName)
            throws XMLStreamException {
        if (localName == null)
            throw new XMLStreamException("Local name cannot be null");
        writeNewElement(null, localName, null);
    }
View Full Code Here

    // Implements XMLStreamWriter interface.
    public void writeStartElement(CharSequence namespaceURI,
            CharSequence localName) throws XMLStreamException {
        if (localName == null)
            throw new XMLStreamException("Local name cannot be null");
        if (namespaceURI == null)
            throw new XMLStreamException("Namespace URI cannot be null");
        writeNewElement(null, localName, namespaceURI);
    }
View Full Code Here

    // Implements XMLStreamWriter interface.
    public void writeStartElement(CharSequence prefix, CharSequence localName,
            CharSequence namespaceURI) throws XMLStreamException {
        if (localName == null)
            throw new XMLStreamException("Local name cannot be null");
        if (namespaceURI == null)
            throw new XMLStreamException("Namespace URI cannot be null");
        if (prefix == null)
            throw new XMLStreamException("Prefix cannot be null");
        writeNewElement(prefix, localName, namespaceURI);
    }
View Full Code Here

TOP

Related Classes of javolution.xml.stream.XMLStreamException

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.