public XMLValidator createValidator(ValidationContext ctxt) throws XMLStreamException { REDocumentDeclaration dd = new REDocumentDeclaration(mGrammar); return new GenericMsvValidator(this, ctxt, dd); } }
public final boolean onAttribute2( String namespaceURI, String localName, String qName, String value, IDContextProvider2 context, StringRef refErr, DatatypeRef refType ) { // instead of creating a new object each time, // use a cached copy. docDecl.attToken.reinit( namespaceURI,localName,qName, new StringToken(docDecl,value,context,refType) ); return onAttribute( docDecl.attToken, refErr ); }
public boolean onEndAttributes( StartTagInfo sti, StringRef refErr ) { if(!super.onEndAttributes(sti,refErr)) return false; for( int i=0; i<contents.length; i++ ) contents[i] = docDecl.attPruner.prune(contents[i]); return true; } }
/** * creates an object that validates the specified expression. */ public REDocumentDeclaration( Expression topLevel, ExpressionPool pool ) { this.topLevel = topLevel; this.pool = pool; resCalc = new ResidualCalculator(pool); attFeeder = new AttributeFeeder(this); attPicker = new AttributePicker(pool); attPruner = new AttributePruner(pool); attRemover = new AttributeRemover(pool); cccec = new CombinedChildContentExpCreator(pool); ecc = new ElementsOfConcernCollector(); attToken = new AttributeToken(this,null,null,null,null); }
/** 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<contents.length; i++ ) contents[i] = res.calcResidual( contents[i], token ); return true; }
protected boolean onAttribute( AttributeToken token, StringRef refErr ) { if(!super.onAttribute(token,refErr)) return false; for( int i=0; i<contents.length; i++ ) contents[i] = docDecl.attFeeder.feed( contents[i], token, ignoreUndeclaredAttributes ); return true; }
public int getStringCareLevel() { // if the value is cached, return cached value. // otherwise, calculate it now. OptimizationTag ot = (OptimizationTag)expression.verifierTag; if(ot==null) expression.verifierTag = ot = new OptimizationTag(); if(ot.stringCareLevel==OptimizationTag.STRING_NOTCOMPUTED) ot.stringCareLevel = StringCareLevelCalculator.calc(expression); return ot.stringCareLevel; }
public final boolean onAttribute2( String namespaceURI, String localName, String qName, String value, IDContextProvider2 context, StringRef refErr, DatatypeRef refType ) { // instead of creating a new object each time, // use a cached copy. docDecl.attToken.reinit( namespaceURI,localName,qName, new StringToken(docDecl,value,context,refType) ); return onAttribute( docDecl.attToken, refErr ); }
/** 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<contents.length; i++ ) contents[i] = res.calcResidual( contents[i], token ); return true; }
public boolean onEndAttributes( StartTagInfo sti, StringRef refErr ) { if(!super.onEndAttributes(sti,refErr)) return false; for( int i=0; i<contents.length; i++ ) contents[i] = docDecl.attPruner.prune(contents[i]); return true; } }
protected boolean onAttribute( AttributeToken token, StringRef refErr ) { if(!super.onAttribute(token,refErr)) return false; for( int i=0; i<contents.length; i++ ) contents[i] = docDecl.attFeeder.feed( contents[i], token, ignoreUndeclaredAttributes ); return true; }
public int getStringCareLevel() { // if the value is cached, return cached value. // otherwise, calculate it now. OptimizationTag ot = (OptimizationTag)expression.verifierTag; if(ot==null) expression.verifierTag = ot = new OptimizationTag(); if(ot.stringCareLevel==OptimizationTag.STRING_NOTCOMPUTED) ot.stringCareLevel = StringCareLevelCalculator.calc(expression); return ot.stringCareLevel; }
public final boolean onAttribute2( String namespaceURI, String localName, String qName, String value, IDContextProvider2 context, StringRef refErr, DatatypeRef refType ) { // instead of creating a new object each time, // use a cached copy. docDecl.attToken.reinit( namespaceURI,localName,qName, new StringToken(docDecl,value,context,refType) ); return onAttribute( docDecl.attToken, refErr ); }
/** 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<contents.length; i++ ) contents[i] = res.calcResidual( contents[i], token ); return true; }
public boolean onEndAttributes( StartTagInfo sti, StringRef refErr ) { if(!super.onEndAttributes(sti,refErr)) return false; for( int i=0; i<contents.length; i++ ) contents[i] = docDecl.attPruner.prune(contents[i]); return true; } }
protected boolean onAttribute( AttributeToken token, StringRef refErr ) { if(!super.onAttribute(token,refErr)) return false; for( int i=0; i<contents.length; i++ ) contents[i] = docDecl.attFeeder.feed( contents[i], token, ignoreUndeclaredAttributes ); return true; }
public int getStringCareLevel() { // if the value is cached, return cached value. // otherwise, calculate it now. OptimizationTag ot = (OptimizationTag)expression.verifierTag; if(ot==null) expression.verifierTag = ot = new OptimizationTag(); if(ot.stringCareLevel==OptimizationTag.STRING_NOTCOMPUTED) ot.stringCareLevel = StringCareLevelCalculator.calc(expression); return ot.stringCareLevel; }
public final boolean onAttribute2( String namespaceURI, String localName, String qName, String value, IDContextProvider2 context, StringRef refErr, DatatypeRef refType ) { // instead of creating a new object each time, // use a cached copy. docDecl.attToken.reinit( namespaceURI,localName,qName, new StringToken(docDecl,value,context,refType) ); return onAttribute( docDecl.attToken, refErr ); }
/** 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<contents.length; i++ ) contents[i] = res.calcResidual( contents[i], token ); return true; }
public boolean onEndAttributes( StartTagInfo sti, StringRef refErr ) { if(!super.onEndAttributes(sti,refErr)) return false; for( int i=0; i<contents.length; i++ ) contents[i] = docDecl.attPruner.prune(contents[i]); return true; } }