private void reportError(String msg, Location loc) throws XMLStreamException { XMLValidationProblem prob = new XMLValidationProblem(loc, msg, XMLValidationProblem.SEVERITY_ERROR); prob.setReporter(this); mContext.reportProblem(prob); } }
public XMLValidator stopValidatingAgainst(XMLValidationSchema schema) throws XMLStreamException { XMLValidator[] results = new XMLValidator[2]; if (ValidatorPair.removeValidator(mValidator, schema, results)) { // found XMLValidator found = results[0]; mValidator = results[1]; found.validationCompleted(false); return found; } return null; }
public final void validateText(String contents, boolean lastTextSegment) throws XMLStreamException { mValidator.validateText(contents, lastTextSegment); }
protected XMLValidator addValidator(XMLValidator vld) { if (mValidator == null) { mValidator = vld; } else { mValidator = new ValidatorPair(mValidator, vld); } return vld; }
public String getValue(String uri, String localName) { return mContext.getAttributeValue(uri, localName); } }
/** * Default implementation just indicates it does not know of such * attributes; this because that requires DTD information that only * some implementations have. */ public final int getIdAttributeIndex() { if (mIdAttrIndex >= 0) { return mIdAttrIndex; } return (mValidator == null) ? -1 : mValidator.getIdAttrIndex(); }
/** * Default implementation just indicates it does not know of such * attributes; this because that requires DTD information that only * some implementations have. */ public final int getNotationAttributeIndex() { return (mValidator == null) ? -1 : mValidator.getNotationAttrIndex(); }
public String getBaseUri() { return mContext.getBaseUri(); }
public int getIndex(String uri, String localName) { return mContext.findAttributeIndex(uri, localName); }
public String getLocalName(int index) { return mContext.getAttributeLocalName(index); }
public String getURI(int index) { return mContext.getAttributeNamespace(index); }
/** * @return Schema (DTD, RNG, W3C Schema) based type of the attribute * in specified index */ public final String getAttributeType(int index) { if (index == mIdAttrIndex && index >= 0) { // second check to ensure -1 is not passed return "ID"; } return (mValidator == null) ? WstxInputProperties.UNKNOWN_ATTR_TYPE : mValidator.getAttributeType(index); } }
public String resolveNamespacePrefix(String prefix) { return mContext.getNamespaceURI(prefix); }
public int getLength() { return mContext.getAttributeCount(); }
public boolean isUnparsedEntity(String entityName) { return mContext.isUnparsedEntityDeclared(entityName); }
public String getType(int index) { return mContext.getAttributeType(index); }
public void reportUndeclared(ValidationContext ctxt, XMLValidator dtd) throws XMLStreamException { String msg = MessageFormat.format(ErrorConsts.ERR_DTD_UNDECLARED_ENTITY, new Object[] { (mIsPe ? "parsed" : "general"), mName }); XMLValidationProblem prob = new XMLValidationProblem (mLocation, msg, XMLValidationProblem.SEVERITY_FATAL); prob.setReporter(dtd); ctxt.reportProblem(prob); } }
public XMLValidator stopValidatingAgainst(XMLValidator validator) throws XMLStreamException { XMLValidator[] results = new XMLValidator[2]; if (ValidatorPair.removeValidator(mValidator, validator, results)) { // found XMLValidator found = results[0]; mValidator = results[1]; found.validationCompleted(false); return found; } return null; }
public String getValue(int index) { return mContext.getAttributeValue(index); }
protected void doReportValidationProblem(String msg, Location loc) throws XMLStreamException { if (loc == null) { loc = getLocation(); } XMLValidationProblem prob = new XMLValidationProblem(loc, msg, XMLValidationProblem.SEVERITY_ERROR); prob.setReporter(this); mContext.reportProblem(prob); }