Package java.lang

Examples of java.lang.IllegalStateException


            if (_current != null) {
                _next = _current._next;
                _map.remove(_current._key);
                _current = null;
            } else {
                throw new IllegalStateException();
            }
        }
View Full Code Here


            if (_current != null) {
                _next = _current._next;
                _map.remove(_current._key);
                _current = null;
            } else {
                throw new IllegalStateException();
            }
        }
View Full Code Here

            if (_current != null) {
                _next = _current._next;
                _map.remove(_current._key);
                _current = null;
            } else {
                throw new IllegalStateException();
            }
        }
View Full Code Here

     * @see    javolution.io.UTF8ByteBufferReader
     * @see    javolution.io.CharSequenceReader
     */
    public void setInput(Reader reader) throws XMLStreamException {
        if (_reader != null)
            throw new IllegalStateException("Reader not closed or reset");
        _reader = reader;
        try { // Reads prolog (if there)
            int readCount = reader.read(_readBuffer, _startOffset,
                    _readBuffer.length - _startOffset);
            _readCount = (readCount >= 0) ? readCount + _startOffset
View Full Code Here

     * @return returns the number of attributes.
     * @throws IllegalStateException if not a START_ELEMENT.
     */
    public Attributes getAttributes() {
        if (_eventType != XMLStreamConstants.START_ELEMENT)
            throw new IllegalStateException("Not a start element");
        return _attributes;
    }
View Full Code Here

                && (_text.length() > 0);
    }

    public boolean isAttributeSpecified(int index) {
        if (_eventType != XMLStreamConstants.START_ELEMENT)
            throw new IllegalStateException("Not a start element");
        return _attributes.getValue(index) != null;
    }
View Full Code Here

                    + NAMES_OF_EVENTS[_eventType] + ")");
        return eventType;
    }

    private IllegalStateException illegalState(String msg) {
        return new IllegalStateException(msg + " ("
                + NAMES_OF_EVENTS[_eventType] + ")");
    }
View Full Code Here

     * @param context the context being entered.
     * @throws IllegalStateException if this context is currently in use.
     */
    public static final void enter(Context context) {
        if (context._owner != null)
            throw new IllegalStateException("Context is currently in use");
        Context current = Context.getCurrentContext();
        context._outer = current;
        context._owner = Thread.currentThread();
        context._allocator = context instanceof AllocatorContext ? (AllocatorContext) context : current._allocator;
        Context.CURRENT.set(context);
View Full Code Here

     */
    public static void exit(Class <? extends Context>  contextType) {
        Context context = Context.getCurrentContext();
        Context outer = context._outer;
        if (outer == null)
            throw new IllegalStateException("Cannot exit root context");
        if (context._owner != Thread.currentThread())
            throw new IllegalStateException("The current thread is not the context owner");
        if (!contextType.isInstance(context))
            throw new ClassCastException("Current context is an instance of " + context.getClass().getName());
        try {
            context.exitAction();
        } finally {
View Full Code Here

        public void set(Object o) {
            if (_currentIndex >= 0) {
                _table.set(_currentIndex, o);
            } else {
                throw new IllegalStateException();
            }
        }
View Full Code Here

TOP

Related Classes of java.lang.IllegalStateException

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.