static SchemaCollection parse(Parseable<Pattern, NameClass, SourceLocation, ElementAnnotationBuilderImpl, CommentListImpl, AnnotationsImpl> parseable, String uri, ErrorHandler eh, DatatypeLibraryFactory dlf, boolean commentsNeedTrimming) throws IllegalSchemaException, IOException, SAXException { try { SchemaCollection sc = new SchemaCollection(); SchemaBuilderImpl sb = new SchemaBuilderImpl(parseable, eh, sc.getSchemaDocumentMap(), dlf, commentsNeedTrimming); sc.setMainUri(uri); sb.parse(parseable, uri); if (sb.hadError) throw new IllegalSchemaException(); return sc; } catch (BuildException e) { Throwable t = e.getCause(); if (t instanceof IOException) throw (IOException)t; if (t instanceof RuntimeException) throw (RuntimeException)t; if (t instanceof SAXException) throw (SAXException)t; if (t instanceof Exception) throw new SAXException((Exception)t); throw new SAXException(t.getClass().getName() + " thrown"); } }
static public Pattern parse(Parseable<Pattern, NameClass, Locator, VoidValue, CommentListImpl, AnnotationsImpl> parseable, ErrorHandler eh, DatatypeLibraryFactory datatypeLibraryFactory, SchemaPatternBuilder pb, boolean isAttributesPattern) throws IllegalSchemaException, IOException, SAXException { try { SchemaBuilderImpl sb = new SchemaBuilderImpl(parseable, eh, new BuiltinDatatypeLibraryFactory(datatypeLibraryFactory), pb); Pattern pattern = parseable.parse(sb, new RootScope(sb)); if (isAttributesPattern) pattern = sb.wrapAttributesPattern(pattern); return sb.expandPattern(pattern); } catch (BuildException e) { throw unwrapBuildException(e); } }
static public Pattern parse(Parseable<Pattern, NameClass, Locator, VoidValue, CommentListImpl, AnnotationsImpl> parseable, ErrorHandler eh, DatatypeLibraryFactory datatypeLibraryFactory, SchemaPatternBuilder pb, boolean isAttributesPattern) throws IllegalSchemaException, IOException, SAXException { try { SchemaBuilderImpl sb = new SchemaBuilderImpl(parseable, eh, new BuiltinDatatypeLibraryFactory(datatypeLibraryFactory), pb); Pattern pattern = parseable.parse(sb, new RootScope(sb)); if (isAttributesPattern) pattern = sb.wrapAttributesPattern(pattern); return sb.expandPattern(pattern); } catch (BuildException e) { throw unwrapBuildException(e); } }