All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sun.msv.verifier.regexp.ComplexAcceptorBaseImpl Maven / Gradle / Ivy

There is a newer version: 2.2.5.1
Show newest version
/*
 * @(#)$Id: ComplexAcceptorBaseImpl.java,v 1.10 2003/06/09 20:37:46 kk122374 Exp $
 *
 * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved.
 * 
 * This software is the proprietary information of Sun Microsystems, Inc.  
 * Use is subject to license terms.
 * 
 */
package com.sun.msv.verifier.regexp;

import com.sun.msv.grammar.ElementExp;
import com.sun.msv.grammar.Expression;
import com.sun.msv.grammar.IDContextProvider2;
import com.sun.msv.util.DatatypeRef;
import com.sun.msv.util.StartTagInfo;
import com.sun.msv.util.StringRef;
import com.sun.msv.verifier.Acceptor;

/**
 * base implementation of ComplexAcceptor.
 * 
 * @author Kohsuke KAWAGUCHI
 */
public abstract class ComplexAcceptorBaseImpl extends ContentModelAcceptor
{
    protected final Expression[]    contents;
    
    public ComplexAcceptorBaseImpl(
        REDocumentDeclaration docDecl, Expression combined, Expression[] contents,
        boolean ignoreUndeclaredAttributes ) {
        
        super( docDecl, combined, ignoreUndeclaredAttributes );
        this.contents = contents;
    }

    /** eats string literal */
    public final boolean onText2( String literal, IDContextProvider2 context, StringRef refErr, DatatypeRef refType ) {
        if(!super.onText2(literal,context,refErr,refType))    return false;
        
        final StringToken token = new StringToken(docDecl,literal,context);
        final ResidualCalculator res = docDecl.resCalc;
        
        // some may become invalid, but at least one always remain valid
        for( int i=0; i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy