Package com.sun.msv.verifier.regexp

Examples of com.sun.msv.verifier.regexp.ResidualCalculator


       
        if( defaultedAttributes.size()==0 )
            return;    // no default attribute is used. no need for the check.
       
        Iterator itr = defaultedAttributes.entrySet().iterator();
        ResidualCalculator resCalc = new ResidualCalculator(reader.pool);
           
        while( itr.hasNext() ) {
            Map.Entry item = (Map.Entry)itr.next();
            AttributeExp exp = (AttributeExp)item.getKey();
            String value = (String)item.getValue();
                   
            // tests if the name class is simple
            if(!(exp.nameClass instanceof SimpleNameClass))
                reportCompError(
                    new Locator[]{reader.getDeclaredLocationOf(exp)},
                    CERR_DEFVALUE_NAME_IS_NOT_SIMPLE);
                   
            // tests if there is no context-dependent datatypes
            try {
                exp.exp.visit( contextDependentTypeChecker );
            } catch( Abort a ) {
                continue;    // abort further check. this error is already reported.
            }
                   
            // tests if the default value matches the content model of this attribute
            StringToken token = new StringToken(resCalc,value,null,null);
            if(!resCalc.calcResidual( exp.exp, token ).isEpsilonReducible() ) {
                // the default value was rejected by the content model.
                reportCompError(
                    new Locator[]{reader.getDeclaredLocationOf(exp)},
                    CERR_DEFVALUE_INVALID, new Object[]{value});
            }
View Full Code Here


       
        if( defaultedAttributes.size()==0 )
            return;    // no default attribute is used. no need for the check.
       
        Iterator itr = defaultedAttributes.entrySet().iterator();
        ResidualCalculator resCalc = new ResidualCalculator(reader.pool);
           
        while( itr.hasNext() ) {
            Map.Entry item = (Map.Entry)itr.next();
            AttributeExp exp = (AttributeExp)item.getKey();
            String value = (String)item.getValue();
                   
            // tests if the name class is simple
            if(!(exp.nameClass instanceof SimpleNameClass))
                reportCompError(
                    new Locator[]{reader.getDeclaredLocationOf(exp)},
                    CERR_DEFVALUE_NAME_IS_NOT_SIMPLE);
                   
            // tests if there is no context-dependent datatypes
            try {
                exp.exp.visit( contextDependentTypeChecker );
            } catch( Abort a ) {
                continue;    // abort further check. this error is already reported.
            }
                   
            // tests if the default value matches the content model of this attribute
            StringToken token = new StringToken(resCalc,value,null,null);
            if(!resCalc.calcResidual( exp.exp, token ).isEpsilonReducible() ) {
                // the default value was rejected by the content model.
                reportCompError(
                    new Locator[]{reader.getDeclaredLocationOf(exp)},
                    CERR_DEFVALUE_INVALID, new Object[]{value});
            }
View Full Code Here

TOP

Related Classes of com.sun.msv.verifier.regexp.ResidualCalculator

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.