protected String tokenTypeDesc(int type) { return ErrorConsts.tokenTypeDesc(type); }
protected String getErrorDesc(int errorType, int currEvent) { // Defaults are mostly fine, except we can easily add event type desc switch (errorType) { case ERR_GETELEMTEXT_NOT_START_ELEM: return ErrorConsts.ERR_STATE_NOT_STELEM+", got "+ErrorConsts.tokenTypeDesc(currEvent); case ERR_GETELEMTEXT_NON_TEXT_EVENT: return "Expected a text token, got "+ErrorConsts.tokenTypeDesc(currEvent); case ERR_NEXTTAG_NON_WS_TEXT: return "Only all-whitespace CHARACTERS/CDATA (or SPACE) allowed for nextTag(), got "+ErrorConsts.tokenTypeDesc(currEvent); case ERR_NEXTTAG_WRONG_TYPE: return "Got "+ErrorConsts.tokenTypeDesc(currEvent)+", instead of START_ELEMENT, END_ELEMENT or SPACE"; } return null; }
protected void reportInvalidContent(int evtType) throws XMLStreamException { switch (mVldContent) { case XMLValidator.CONTENT_ALLOW_NONE: reportValidationProblem(ErrorConsts.ERR_VLD_EMPTY, getTopElementDesc(), ErrorConsts.tokenTypeDesc(evtType)); break; case XMLValidator.CONTENT_ALLOW_WS: reportValidationProblem(ErrorConsts.ERR_VLD_NON_MIXED, getTopElementDesc()); break; case XMLValidator.CONTENT_ALLOW_VALIDATABLE_TEXT: case XMLValidator.CONTENT_ALLOW_ANY_TEXT: /* Not 100% sure if this should ever happen... depends on * interpretation of 'any' content model? */ reportValidationProblem(ErrorConsts.ERR_VLD_ANY, getTopElementDesc(), ErrorConsts.tokenTypeDesc(evtType)); break; default: // should never occur: reportValidationProblem("Internal error: trying to report invalid content for "+evtType); } }
reportValidationProblem(ErrorConsts.ERR_VLD_EMPTY, mElementStack.getTopElementDesc(), ErrorConsts.tokenTypeDesc(evtType)); break; case XMLValidator.CONTENT_ALLOW_WS: ErrorConsts.tokenTypeDesc(evtType)); break; default: // should never occur:
return next; throwParseError("Received event "+ErrorConsts.tokenTypeDesc(next) +", instead of START_ELEMENT or END_ELEMENT.");
if (be == null) { // incorrect state throw new WstxException("Trying to create START_ELEMENT when current event is " +ErrorConsts.tokenTypeDesc(sr.getEventType()), loc); case ATTRIBUTE: throw new WstxException("Internal error: should not get " +ErrorConsts.tokenTypeDesc(r.getEventType())); default: throw new IllegalStateException("Unrecognized event type "+r.getEventType()+".");
protected String tokenTypeDesc(int type) { return ErrorConsts.tokenTypeDesc(type); }
protected String tokenTypeDesc(int type) { return ErrorConsts.tokenTypeDesc(type); }
protected String tokenTypeDesc(int type) { return ErrorConsts.tokenTypeDesc(type); }
protected String tokenTypeDesc(int type) { return ErrorConsts.tokenTypeDesc(type); }
protected String tokenTypeDesc(int type) { return ErrorConsts.tokenTypeDesc(type); }
protected String tokenTypeDesc(int type) { return ErrorConsts.tokenTypeDesc(type); }
private void throwNotTextual(int type) { throw new IllegalStateException("Not a textual event (" +ErrorConsts.tokenTypeDesc(mCurrEvent)+")"); }
private void throwNotTextual(int type) { throw new IllegalStateException("Not a textual event (" +ErrorConsts.tokenTypeDesc(mCurrEvent)+")"); }
private void throwNotTextual(int type) { throw new IllegalStateException("Not a textual event (" +ErrorConsts.tokenTypeDesc(mCurrEvent)+")"); }
public String getLocalName() { if (mCurrEvent == START_ELEMENT || mCurrEvent == END_ELEMENT) { return safeGetLocalName(mCurrNode); } if (mCurrEvent == ENTITY_REFERENCE) { return mCurrNode.getNodeName(); } throw new IllegalStateException("Current state ("+ErrorConsts.tokenTypeDesc(mCurrEvent)+") not START_ELEMENT, END_ELEMENT or ENTITY_REFERENCE"); }
public String toString() { return "["+ErrorConsts.tokenTypeDesc(getEventType())+"]"; }
public String getLocalName() { if (mCurrEvent == START_ELEMENT || mCurrEvent == END_ELEMENT) { return safeGetLocalName(mCurrNode); } if (mCurrEvent == ENTITY_REFERENCE) { return mCurrNode.getNodeName(); } throw new IllegalStateException("Current state ("+ErrorConsts.tokenTypeDesc(mCurrEvent)+") not START_ELEMENT, END_ELEMENT or ENTITY_REFERENCE"); }
public String getLocalName() { if (mCurrEvent == START_ELEMENT || mCurrEvent == END_ELEMENT) { return safeGetLocalName(mCurrNode); } if (mCurrEvent == ENTITY_REFERENCE) { return mCurrNode.getNodeName(); } throw new IllegalStateException("Current state ("+ErrorConsts.tokenTypeDesc(mCurrEvent)+") not START_ELEMENT, END_ELEMENT or ENTITY_REFERENCE"); }
public String toString() { return "["+ErrorConsts.tokenTypeDesc(getEventType())+"]"; }