public Location getValidationLocation() { return mReporter.getLocation(); }
rep.reportProblem(null, ErrorConsts.WT_ATTR_DECL, ErrorConsts.W_DTD_DUP_ATTR, attrName, mName); return old; rep.throwParseError("Invalid id attribute \"{0}\" for element <{1}>: already had id attribute \""+mIdAttr.getName()+"\"", attrName, mName); rep.throwParseError("Invalid notation attribute '"+attrName+"' for element <"+mName+">: already had notation attribute '"+mNotationAttr.getName()+"'");
public void reportProblem(XMLValidationProblem problem) throws XMLStreamException { mReporter.reportValidationProblem(problem); }
/** * Method that can be used to get the specified attribute value, * by getting it written using Writer passed in. Can potentially * save one String allocation, since no (temporary) Strings need * to be created. */ /* protected final void writeValue(int index, Writer w) throws IOException { mValueBuilder.getEntry(index, w); } */ protected void throwDupAttr(InputProblemReporter rep, int index) throws XMLStreamException { rep.throwParseError("Duplicate attribute '"+getQName(index)+"'."); } }
rep.reportProblem(intElem.getLocation(), ErrorConsts.WT_ENT_DECL, ErrorConsts.W_UNDEFINED_ELEM,
mReporter.throwParseError(ErrorConsts.ERR_NS_REDECL_XMLNS); } else if (prefix == "xml") { mReporter.throwParseError(ErrorConsts.ERR_NS_REDECL_XML, nsUri, null); mReporter.throwParseError(ErrorConsts.ERR_NS_REDECL_XML_URI, prefix, null); } else if (nsUri == XMLConstants.XMLNS_ATTRIBUTE_NS_URI) { mReporter.throwParseError(ErrorConsts.ERR_NS_REDECL_XMLNS_URI); mReporter.throwParseError(ErrorConsts.ERR_NS_REDECL_XML_URI, prefix, null); } else if (nsUri.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) { mReporter.throwParseError(ErrorConsts.ERR_NS_REDECL_XMLNS_URI); mReporter.throwParseError(ErrorConsts.ERR_NS_UNDECLARED, prefix, null);
rep.reportProblem(ErrorConsts.WT_ENT_DECL, ErrorConsts.W_UNDEFINED_ELEM, extElem.getDisplayName(), null,
rep.reportProblem(ErrorConsts.WT_ATTR_DECL, ErrorConsts.W_DTD_DUP_ATTR, attrName, mName); return old; rep.throwParseError("Invalid id attribute '"+attrName+"' for element <"+mName+">: already had id attribute '"+mIdAttr.getName()+"'"); rep.throwParseError("Invalid notation attribute '"+attrName+"' for element <"+mName+">: already had notation attribute '"+mNotationAttr.getName()+"'");
/** * Method called during parsing of DTD schema, to report a problem. * Note that unlike during actual validation, we have no option of * just gracefully listing problems and ignoring them; an exception * is always thrown. */ protected String reportValidationProblem(InputProblemReporter rep, String msg) throws XMLStreamException { rep.reportValidationProblem("Attribute definition '"+mName+"': "+msg); return null; } }
String uri = ns.findLastFromMap(prefix); if (uri == null) { rep.throwParseError(ErrorConsts.ERR_NS_UNDECLARED_FOR_ATTR, prefix, attr.mLocalName);
Location loc = rep.getLocation(); String lexical = new String(buf, start, (ptr-start)); throw new TypedXMLStreamException(lexical, iae.getMessage(), loc, iae);
rep.reportProblem(ErrorConsts.WT_ENT_DECL, ErrorConsts.W_UNDEFINED_ELEM, extElem.getDisplayName(), null,
rep.reportProblem(ErrorConsts.WT_ATTR_DECL, ErrorConsts.W_DTD_DUP_ATTR, attrName, mName); return old; rep.throwParseError("Invalid id attribute '"+attrName+"' for element <"+mName+">: already had id attribute '"+mIdAttr.getName()+"'"); rep.throwParseError("Invalid notation attribute '"+attrName+"' for element <"+mName+">: already had notation attribute '"+mNotationAttr.getName()+"'");
protected void checkEntity(InputProblemReporter rep, String id, EntityDecl ent) throws XMLStreamException { if (ent == null) { rep.reportValidationProblem("Referenced entity '"+id+"' not defined"); } else if (ent.isParsed()) { rep.reportValidationProblem("Referenced entity '"+id+"' is not an unparsed entity"); } }
protected void throwDupAttr(InputProblemReporter rep, int index) throws XMLStreamException { rep.throwParseError("Duplicate attribute '"+getQName(index)+"'."); } }
public final byte[] decodeBinary(int index, Base64Variant v, CharArrayBase64Decoder dec, InputProblemReporter rep) throws XMLStreamException { if (index < 0 || index >= mAttrCount) { throwIndex(index); } /* No point in trying to use String representation, even if one * available, faster to process from char[] */ Attribute attr = mAttributes[index]; char[] cbuf = mValueBuilder.getCharBuffer(); int start = attr.mValueStartOffset; int end = getValueStartOffset(index+1); int len = end-start; dec.init(v, true, cbuf, start, len, null); try { return dec.decodeCompletely(); } catch (IllegalArgumentException iae) { // Need to convert to a checked stream exception String lexical = new String(cbuf, start, len); throw new TypedXMLStreamException(lexical, iae.getMessage(), rep.getLocation(), iae); } }
rep.reportProblem(intElem.getLocation(), ErrorConsts.WT_ENT_DECL, ErrorConsts.W_UNDEFINED_ELEM,
rep.reportProblem(null, ErrorConsts.WT_ATTR_DECL, ErrorConsts.W_DTD_DUP_ATTR, attrName, mName); return old; rep.throwParseError("Invalid id attribute \"{0}\" for element <{1}>: already had id attribute \""+mIdAttr.getName()+"\"", attrName, mName); rep.throwParseError("Invalid notation attribute '"+attrName+"' for element <"+mName+">: already had notation attribute '"+mNotationAttr.getName()+"'");
public void reportProblem(XMLValidationProblem problem) throws XMLStreamException { mReporter.reportValidationProblem(problem); }
protected void throwDupAttr(InputProblemReporter rep, int index) throws XMLStreamException { rep.throwParseError("Duplicate attribute '"+getQName(index)+"'."); } }