mStartTag.reinit(uri, localName, qname, mAttributeProxy, this); mCurrAcceptor = mCurrAcceptor.createChildAcceptor(mStartTag, mErrorRef);
if (!acc.isAcceptState(mErrorRef) || mErrorRef.str != null) { reportError(mErrorRef); if (!mCurrAcceptor.stepForward(acc, mErrorRef) || mErrorRef.str != null) { reportError(mErrorRef); int stringChecks = mCurrAcceptor.getStringCareLevel(); switch (stringChecks) { case Acceptor.STRING_PROHIBITED: // only WS
public String validateAttribute(String localName, String uri, String prefix, String value) throws XMLStreamException { mCurrAttrLocalName = localName; mCurrAttrPrefix = prefix; if (mCurrAcceptor != null) { String qname = localName; // for now, let's assume we don't need prefixed version DatatypeRef typeRef = null; // for now, let's not care /* 31-Mar-2006, TSa: MSV seems to require empty String for empty/no * namespace, not null. */ if (uri == null) { uri = ""; } if (!mCurrAcceptor.onAttribute2(uri, localName, qname, value, this, mErrorRef, typeRef) || mErrorRef.str != null) { reportError(mErrorRef); } if (mProblem != null) { // pending problems (to throw exception on)? XMLValidationProblem p = mProblem; mProblem = null; mContext.reportProblem(p); } } /* No normalization done by RelaxNG, is there? (at least nothing * visible to callers that is) */ return null; }
public int validateElementAndAttributes() throws XMLStreamException { // Not handling any attributes mCurrAttrLocalName = mCurrAttrPrefix = ""; if (mCurrAcceptor != null) { /* start tag info is still intact here (only attributes sent * since child acceptor was created) */ if (!mCurrAcceptor.onEndAttributes(mStartTag, mErrorRef) || mErrorRef.str != null) { reportError(mErrorRef); } int stringChecks = mCurrAcceptor.getStringCareLevel(); switch (stringChecks) { case Acceptor.STRING_PROHIBITED: // only WS return XMLValidator.CONTENT_ALLOW_WS; case Acceptor.STRING_IGNORE: // anything (mixed content models) return XMLValidator.CONTENT_ALLOW_ANY_TEXT; case Acceptor.STRING_STRICT: // validatable (data-oriented) return XMLValidator.CONTENT_ALLOW_VALIDATABLE_TEXT; default: throw new IllegalArgumentException("Internal error: unexpected string care level value return by MSV: "+stringChecks); } } // If no acceptor, we are recovering, no need or use to validate text return CONTENT_ALLOW_ANY_TEXT; }
Acceptor child = acceptor.createChildAcceptor(sti,null); if(child==null) { child = acceptor.createChildAcceptor(sti,ref); context.reportEvent(target,ref.str); if(!child.onAttribute2( rie.____jaxb_ri____getNamespaceURI(), rie.____jaxb_ri____getLocalName(), child.onEndAttributes(sti,null); if(!acceptor.stepForward(child,null)) {
public void endElement() throws SAXException { writePendingText(); if(!acceptor.isAcceptState(null)) { // some required elements are missing // report error StringRef ref = new StringRef(); acceptor.isAcceptState(ref); context.reportEvent(target,ref.str); } // pop the acceptor Acceptor child = acceptor; acceptor = (Acceptor)stack.pop(); if(!acceptor.stepForward( child, null )) { // some required elements are missing. // report an error StringRef ref = new StringRef(); acceptor.stepForward( child, ref ); // force recovery and obtain an error message. context.reportEvent(target,ref.str); } context.getNamespaceContext().endElement(); }
Acceptor next = current.createChildAcceptor(sti, null); next = current.createChildAcceptor(sti, ref); if (!next.onEndAttributes(sti, null)) { next.onEndAttributes(sti, ref); onError( ref, stringCareLevel = next.getStringCareLevel(); if (stringCareLevel == Acceptor.STRING_IGNORE) characterType.types = new Datatype[] { StringType.theInstance };
void doValidateText(TextAccumulator textAcc) throws XMLStreamException { if (mCurrAcceptor != null) { String str = textAcc.getAndClear(); DatatypeRef typeRef = null; if (!mCurrAcceptor.onText2(str, this, mErrorRef, typeRef) || mErrorRef.str != null) { reportError(mErrorRef); } } }
public void endAttributes() throws SAXException { if(!acceptor.onEndAttributes( null, null )) { // some required attributes are missing. // report a validation error // Note that we don't know which property of this object // causes this error. StringRef ref = new StringRef(); StartTagInfo sti = new StartTagInfo( currentElementUri,currentElementLocalName,currentElementLocalName, emptyAttributes,this); acceptor.onEndAttributes( sti, ref ); context.reportEvent(target,ref.str); } }
/** performs the validation to the object specified in the constructor. */ private void _validate() throws SAXException { // validate attributes target.serializeAttributes(this); endAttribute(); // validate content model target.serializeElements(this); writePendingText(); if(!acceptor.isAcceptState(null)) { // some elements are missing // report error StringRef ref = new StringRef(); acceptor.isAcceptState(ref); context.reportEvent(target,ref.str); } }
public Object getCurrentElementType() { return current.getOwnerType(); }
Acceptor child = acceptor.createChildAcceptor(sti,null); if(child==null) { child = acceptor.createChildAcceptor(sti,ref); context.reportEvent(target,ref.str); if(!child.onAttribute2( rie.____jaxb_ri____getNamespaceURI(), rie.____jaxb_ri____getLocalName(), child.onEndAttributes(sti,null); if(!acceptor.stepForward(child,null)) {
public void endElement() throws SAXException { writePendingText(); if(!acceptor.isAcceptState(null)) { // some required elements are missing // report error StringRef ref = new StringRef(); acceptor.isAcceptState(ref); context.reportEvent(target,ref.str); } // pop the acceptor Acceptor child = acceptor; acceptor = (Acceptor)stack.pop(); if(!acceptor.stepForward( child, null )) { // some required elements are missing. // report an error StringRef ref = new StringRef(); acceptor.stepForward( child, ref ); // force recovery and obtain an error message. context.reportEvent(target,ref.str); } context.getNamespaceContext().endElement(); }
Acceptor next = current.createChildAcceptor(sti, null); next = current.createChildAcceptor(sti, ref); if (!next.onEndAttributes(sti, null)) { next.onEndAttributes(sti, ref); onError( ref, stringCareLevel = next.getStringCareLevel(); if (stringCareLevel == Acceptor.STRING_IGNORE) characterType.types = new Datatype[] { StringType.theInstance };
public int validateElementAndAttributes() throws XMLValidationException { if (mCurrAcceptor != null) { /* start tag info is still intact here (only attributes sent * since child acceptor was created) */ if (!mCurrAcceptor.onEndAttributes(mStartTag, mErrorRef) || mErrorRef.str != null) { reportError(mErrorRef); } int stringChecks = mCurrAcceptor.getStringCareLevel(); switch (stringChecks) { case Acceptor.STRING_PROHIBITED: // only WS return XMLValidator.CONTENT_ALLOW_WS; case Acceptor.STRING_IGNORE: // anything (mixed content models) return XMLValidator.CONTENT_ALLOW_ANY_TEXT; case Acceptor.STRING_STRICT: // validatable (data-oriented) return XMLValidator.CONTENT_ALLOW_VALIDATABLE_TEXT; default: throw new IllegalArgumentException("Internal error: unexpected string care level value return by MSV: "+stringChecks); } } // If no acceptor, we are recovering, no need or use to validate text return CONTENT_ALLOW_ANY_TEXT; }
private void writePendingText() throws SAXException { // assert(textBuf!=null); if(!acceptor.onText2( buf.toString(), this, null, null )) { // this text is invalid. // report an error StringRef ref = new StringRef(); acceptor.onText2( buf.toString(), this, ref, null ); context.reportEvent(target,ref.str); } if(buf.length()>1024) buf = new StringBuffer(); else buf.setLength(0); }
public void endAttributes() throws SAXException { if(!acceptor.onEndAttributes( null, null )) { // some required attributes are missing. // report a validation error // Note that we don't know which property of this object // causes this error. StringRef ref = new StringRef(); StartTagInfo sti = new StartTagInfo( currentElementUri,currentElementLocalName,currentElementLocalName, emptyAttributes,this); acceptor.onEndAttributes( sti, ref ); context.reportEvent(target,ref.str); } }
/** performs the validation to the object specified in the constructor. */ private void _validate() throws SAXException { context.getNamespaceContext().startElement(); // validate attributes target.serializeURIs(this); endNamespaceDecls(); target.serializeAttributes(this); endAttributes(); // validate content model target.serializeBody(this); writePendingText(); context.getNamespaceContext().endElement(); if(!acceptor.isAcceptState(null)) { // some elements are missing // report error StringRef ref = new StringRef(); acceptor.isAcceptState(ref); context.reportEvent(target,ref.str); } }
public Object getCurrentElementType() { return current.getOwnerType(); }
Acceptor child = acceptor.createChildAcceptor(sti,null); if(child==null) { child = acceptor.createChildAcceptor(sti,ref); context.reportEvent(target,ref.str); if(!child.onAttribute2( rie.____jaxb_ri____getNamespaceURI(), rie.____jaxb_ri____getLocalName(), child.onEndAttributes(sti,null); if(!acceptor.stepForward(child,null)) {