Package com.sun.msv.util

Examples of com.sun.msv.util.StringRef


       
           
        Acceptor child = acceptor.createChildAcceptor(sti,null);
        if(child==null) {
            // some required elements were missing. report errors
            StringRef ref = new StringRef();
            child = acceptor.createChildAcceptor(sti,ref);
            context.reportEvent(target,ref.str);
        }
       
        if(o instanceof RIElement) {
View Full Code Here


        if(text.length()!=0) {
            final String txt = new String(text);
            if(!current.onText2( txt, this, null, characterType )) {
                // error
                // diagnose error, if possible
                StringRef err = new StringRef();
                current.onText2( txt, this, err, null );
                   
                // report an error
                errorHandler.error( new ValidityViolation(locator,
                    localizeMessage( ERR_UNEXPECTED_TEXT, null ),
View Full Code Here

            case Acceptor.STRING_STRICT :
                final String txt = new String(text);
                if (!current.onText2(txt, this, null, characterType)) {
                    // error
                    // diagnose error, if possible
                    StringRef err = new StringRef();
                    characterType.types = null;
                    current.onText2(txt, this, err, characterType);
   
                    // report an error
                    onError(err, localizeMessage(ERR_UNEXPECTED_TEXT, null), new ErrorInfo.BadText(text));
View Full Code Here

            // no child element matchs this one
            if (com.sun.msv.driver.textui.Debug.debug)
                System.out.println("-- no children accepted: error recovery");
   
            // let acceptor recover from this error.
            StringRef ref = new StringRef();
            next = current.createChildAcceptor(sti, ref);
   
            ValidityViolation vv =
                onError(
                    ref,
                    localizeMessage(ERR_UNEXPECTED_STARTTAG, new Object[] { qName }),
                    new ErrorInfo.BadTagName(sti));
   
            if (next == null) {
                if (com.sun.msv.driver.textui.Debug.debug)
                    System.out.println("-- unable to recover");
                throw new ValidationUnrecoverableException(vv);
            }
        }
   
        onNextAcceptorReady(sti, next);
   
        // feed attributes
        final int len = atts.getLength();
        for (int i = 0; i < len; i++)
            feedAttribute(next, atts.getURI(i), atts.getLocalName(i), atts.getQName(i), atts.getValue(i));
   
        // call the endAttributes
        if (!next.onEndAttributes(sti, null)) {
            // error.
            if (com.sun.msv.driver.textui.Debug.debug)
                System.out.println("-- required attributes missing: error recovery");
   
            // let the acceptor recover from the error.
            StringRef ref = new StringRef();
            next.onEndAttributes(sti, ref);
            onError(
                ref,
                localizeMessage(ERR_MISSING_ATTRIBUTE, new Object[] { qName }),
                new ErrorInfo.MissingAttribute(sti));
View Full Code Here

            // error
            if (com.sun.msv.driver.textui.Debug.debug)
                System.out.println("-- bad attribute: error recovery");
   
            // let the acceptor recover from the error.
            StringRef ref = new StringRef();
            child.onAttribute2(uri, localName, qName, value, this, ref, null);
            onError(
                ref,
                localizeMessage(ERR_UNEXPECTED_ATTRIBUTE, new Object[] { qName }),
                new ErrorInfo.BadAttribute(sti, qName, uri, localName, value));
View Full Code Here

   
        verifyText();
   
        if (!current.isAcceptState(null) && panicLevel == 0) {
            // error diagnosis
            StringRef errRef = new StringRef();
            current.isAcceptState(errRef);
            onError(
                errRef,
                localizeMessage(ERR_UNCOMPLETED_CONTENT, new Object[] { qName }),
                new ErrorInfo.IncompleteContentModel(qName, namespaceUri, localName));
            // error recovery: pretend as if this state is satisfied
            // fall through is enough
        }
        Acceptor child = current;
   
        // pop context
        current = stack.acceptor;
        stringCareLevel = stack.stringCareLevel;
        panicLevel = Math.max(panicLevel, stack.panicLevel);
        stack = stack.previous;
   
        if (!current.stepForward(child, null)) {
            // error
            StringRef ref = new StringRef();
            current.stepForward(child, ref); // force recovery
   
            onError(ref, localizeMessage(ERR_UNEXPECTED_ELEMENT, new Object[] { qName }), null);
        } else
            panicLevel = Math.max(panicLevel - 1, 0);
View Full Code Here

        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);
        }
    }
View Full Code Here

        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);
View Full Code Here

            this, null, null )) {
           
            // either the name was incorrect (which is quite unlikely),
            // or the value was wrong.
            // report an error
            StringRef ref = new StringRef();
            acceptor.onAttribute2( attNamespaceUri, attLocalName, attLocalName,
            buf.toString(), this, ref, null );
           
            context.reportEvent(target,ref.str);
        }
View Full Code Here

    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)
View Full Code Here

TOP

Related Classes of com.sun.msv.util.StringRef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.