public QName getQName(int index) { if (index < 0 || index >= mAttrCount) { throwIndex(index); } return mAttributes[index].getQName(); }
/** * Method called when we get an EOF within content tree */ protected void throwUnexpectedEOF() throws WstxException { throwUnexpectedEOF("; was expecting a close tag for element <"+mElementStack.getTopElementDesc()+">"); }
public byte[] getAttributeAsBinary(int index, Base64Variant v) throws XMLStreamException { return mAttrCollector.decodeBinary(index, v, _base64Decoder(), this); }
protected void handleIncompleteEntityProblem(WstxInputSource closing) throws XMLStreamException { String top = mElementStack.isEmpty() ? "[ROOT]" : mElementStack.getTopElementDesc(); throwParseError("Unexpected end of entity expansion for entity &{0}; was expecting a close tag for element <{1}>", closing.getEntityId(), top); }
protected final char getNextInCurrAfterWS(String errorMsg) throws XMLStreamException { return getNextInCurrAfterWS(errorMsg, getNextCharFromCurrent(errorMsg)); }
public String getAttributeValue(String nsURI, String localName) { int ix = findAttributeIndex(nsURI, localName); return (ix < 0) ? null : getAttributeValue(ix); }
public String getAttributeNamespace(int index) { return getAttrCollector().getURI(index); }
public String getAttributeLocalName(int index) { return getAttrCollector().getLocalName(index); }
public String getAttributePrefix(int index) { return getAttrCollector().getPrefix(index); }
public String getAttributeValue(int index) { return getAttrCollector().getValue(index); }
/** * Method called to report a problem with */ protected XMLStreamException _constructUnexpectedInTyped(int nextToken) { if (nextToken == START_ELEMENT) { return _constructTypeException("Element content can not contain child START_ELEMENT when using Typed Access methods", null); } return _constructTypeException("Expected a text token, got "+tokenTypeDesc(nextToken), null); }
public String getNsPrefix(int index) { if (index < 0 || index >= mNsCount) { throwIndex(index); } // for NS decls, local name is stored in prefix return mNamespaces[index].mLocalName; }
protected void safeEnsureFinishToken() { if (mTokenState < mStTextThreshold) { safeFinishToken(); } }
public void reportProblem(XMLValidationProblem problem) throws XMLStreamException { mReporter.reportValidationProblem(problem); }
public XMLValidator stopValidatingAgainst(XMLValidationSchema schema) throws XMLStreamException { return mElementStack.stopValidatingAgainst(schema); }
protected CompactStartElement(Location loc, QName name, BaseNsContext nsCtxt, ElemAttrs attrs) { super(loc, name, nsCtxt); mAttrs = attrs; mRawAttrs = (attrs == null) ? null : attrs.getRawAttrs(); }
/** * @return Number of open elements in the stack; 0 when parser is in * prolog/epilog, 1 inside root element and so on. */ public int getDepth() { /* Note: we can not necessarily use mCurrDepth, since it is * directly synchronized to the input (to catch unbalanced entity * expansion WRT element nesting), and not to actual token values * returned. */ return mElementStack.getDepth(); }
/** * This problem gets reported if an entity tries to expand to * a close tag matching start tag that did not came from the same * entity (but from parent). */ protected void handleGreedyEntityProblem(WstxInputSource input) throws XMLStreamException { String top = mElementStack.isEmpty() ? "[ROOT]" : mElementStack.getTopElementDesc(); throwParseError("Improper GE/element nesting: entity &" +input.getEntityId()+" contains closing tag for <"+top+">"); }
public String getPrefix(int index) { if (index < 0 || index >= mAttrCount) { throwIndex(index); } return mAttributes[index].mPrefix; }
public String getLocalName(int index) { if (index < 0 || index >= mAttrCount) { throwIndex(index); } return mAttributes[index].mLocalName; }