/** * Internal method for throwing a stream exception that indicates * that given method can not be called because the cursor does * not point to event of expected type. This can be either because * cursor is invalid (doesn't point to any event), or because * it points to "wrong" event type. Distinction is reflected * in the exception message. */ protected XMLStreamException _notAccessible(String method) throws XMLStreamException { if (_childCursor != null) { return constructStreamException("Can not call '"+method+"(): cursor does not point to a valid node, as it has an active open child cursor."); } return constructStreamException("Can not call '"+method+"(): cursor does not point to a valid node (curr event "+getCurrEventDesc()+"; cursor state " +getStateDesc()+")"); }
protected XMLStreamException _wrongState(String method, SMEvent expState) throws XMLStreamException { return constructStreamException("Can not call '"+method+"()' when cursor is not positioned over "+expState+" but "+currentEventStr()); }
void _throwUnexpectedEndDoc() throws XMLStreamException { throw new IllegalStateException("Unexpected END_DOCUMENT encountered (root = "+isRootCursor() +"; reader impl "+_getStreamReader().getClass().getName()+"); location: " +_streamReader.getLocation()); }
_throwWrongEndElem(endDepth, depth); _throwUnexpectedEndDoc();
TypedXMLStreamException _constructTypedException(String value, IllegalArgumentException rootCause, String msg) { return new TypedXMLStreamException(value, msg, _getStreamReader().getLocation(), rootCause); }
void _throwUnexpectedEndDoc() throws XMLStreamException { throw new IllegalStateException("Unexpected END_DOCUMENT encountered (root = "+isRootCursor() +"; reader impl "+_getStreamReader().getClass().getName()+"); location: " +_streamReader.getLocation()); }
_throwWrongEndElem(endDepth, depth); _throwUnexpectedEndDoc();
TypedXMLStreamException _constructTypedException(String value, IllegalArgumentException rootCause, String msg) { return new TypedXMLStreamException(value, msg, _getStreamReader().getLocation(), rootCause); }
/** * Internal method for throwing a stream exception that indicates * that given method can not be called because the cursor does * not point to event of expected type. This can be either because * cursor is invalid (doesn't point to any event), or because * it points to "wrong" event type. Distinction is reflected * in the exception message. */ protected XMLStreamException _notAccessible(String method) throws XMLStreamException { if (_childCursor != null) { return constructStreamException("Can not call '"+method+"(): cursor does not point to a valid node, as it has an active open child cursor."); } return constructStreamException("Can not call '"+method+"(): cursor does not point to a valid node (curr event "+getCurrEventDesc()+"; cursor state " +getStateDesc()+")"); }
protected XMLStreamException _wrongState(String method, SMEvent expState) throws XMLStreamException { return constructStreamException("Can not call '"+method+"()' when cursor is not positioned over "+expState+" but "+currentEventStr()); }