001 package com.thaiopensource.relaxng.parse; 002 003 import org.relaxng.datatype.ValidationContext; 004 005 public interface SchemaBuilder { 006 ParsedPattern makeChoice(ParsedPattern[] patterns, int nPatterns, Location loc, Annotations anno) throws BuildException; 007 ParsedPattern makeInterleave(ParsedPattern[] patterns, int nPatterns, Location loc, Annotations anno) throws BuildException; 008 ParsedPattern makeGroup(ParsedPattern[] patterns, int nPatterns, Location loc, Annotations anno) throws BuildException; 009 ParsedPattern makeOneOrMore(ParsedPattern p, Location loc, Annotations anno) throws BuildException; 010 ParsedPattern makeZeroOrMore(ParsedPattern p, Location loc, Annotations anno) throws BuildException; 011 ParsedPattern makeOptional(ParsedPattern p, Location loc, Annotations anno) throws BuildException; 012 ParsedPattern makeList(ParsedPattern p, Location loc, Annotations anno) throws BuildException; 013 ParsedPattern makeMixed(ParsedPattern p, Location loc, Annotations anno) throws BuildException; 014 ParsedPattern makeEmpty(Location loc, Annotations anno); 015 ParsedPattern makeNotAllowed(Location loc, Annotations anno); 016 ParsedPattern makeText(Location loc, Annotations anno); 017 ParsedPattern makeAttribute(ParsedNameClass nc, ParsedPattern p, Location loc, Annotations anno) throws BuildException; 018 ParsedPattern makeElement(ParsedNameClass nc, ParsedPattern p, Location loc, Annotations anno) throws BuildException; 019 DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, Location loc) throws BuildException; 020 ParsedPattern makeValue(String datatypeLibrary, String type, String value, Context c, String ns, 021 Location loc, Annotations anno) throws BuildException; 022 Grammar makeGrammar(Scope parent); 023 ParsedPattern annotate(ParsedPattern p, Annotations anno) throws BuildException; 024 ParsedNameClass annotate(ParsedNameClass nc, Annotations anno) throws BuildException; 025 ParsedPattern annotateAfter(ParsedPattern p, ParsedElementAnnotation e) throws BuildException; 026 ParsedNameClass annotateAfter(ParsedNameClass nc, ParsedElementAnnotation e) throws BuildException; 027 ParsedPattern commentAfter(ParsedPattern p, CommentList comments) throws BuildException; 028 ParsedNameClass commentAfter(ParsedNameClass nc, CommentList comments) throws BuildException; 029 ParsedPattern makeExternalRef(String uri, String ns, Scope scope, 030 Location loc, Annotations anno) throws BuildException, IllegalSchemaException; 031 ParsedNameClass makeChoice(ParsedNameClass[] nameClasses, int nNameClasses, Location loc, Annotations anno); 032 033 static final String INHERIT_NS = new String("#inherit"); 034 ParsedNameClass makeName(String ns, String localName, String prefix, Location loc, Annotations anno); 035 ParsedNameClass makeNsName(String ns, Location loc, Annotations anno); 036 /** 037 * Caller must enforce constraints on except. 038 */ 039 ParsedNameClass makeNsName(String ns, ParsedNameClass except, Location loc, Annotations anno); 040 ParsedNameClass makeAnyName(Location loc, Annotations anno); 041 /** 042 * Caller must enforce constraints on except. 043 */ 044 ParsedNameClass makeAnyName(ParsedNameClass except, Location loc, Annotations anno); 045 Location makeLocation(String systemId, int lineNumber, int columnNumber); 046 Annotations makeAnnotations(CommentList comments, Context context); 047 ElementAnnotationBuilder makeElementAnnotationBuilder(String ns, String localName, String prefix, 048 Location loc, CommentList comments, Context context); 049 CommentList makeCommentList(); 050 ParsedPattern makeErrorPattern(); 051 ParsedNameClass makeErrorNameClass(); 052 boolean usesComments(); 053 }