net.shibboleth.utilities.java.support.xml
Class SchemaBuilder

java.lang.Object
  extended by net.shibboleth.utilities.java.support.xml.SchemaBuilder

public final class SchemaBuilder
extends Object

A helper class for building Schema from a set of input.


Nested Class Summary
static class SchemaBuilder.SchemaLanguage
          Language of the schema files.
 
Field Summary
private static Logger LOG
          Class logger.
 
Constructor Summary
private SchemaBuilder()
          Constructor.
 
Method Summary
static Schema buildSchema(SchemaBuilder.SchemaLanguage lang, File... schemaFilesOrDirectories)
          Builds a schema from the given schema sources.
static Schema buildSchema(SchemaBuilder.SchemaLanguage lang, InputStream... schemaSources)
          Builds a schema from the given schema sources.
private static Schema buildSchema(SchemaBuilder.SchemaLanguage lang, List<? extends Source> schemaSources)
          Builds a schema from the given schema sources.
static Schema buildSchema(SchemaBuilder.SchemaLanguage lang, Resource... schemaSources)
          Builds a schema from the given schema sources.
static Schema buildSchema(SchemaBuilder.SchemaLanguage lang, String... schemaFilesOrDirectories)
          Builds a schema from the given schema sources.
private static void getSchemaFiles(SchemaBuilder.SchemaLanguage lang, List<File> accumulatedSchemaFiles, File... schemaFilesOrDirectories)
          Gets all of the schema files in the given set of readable files, directories or subdirectories.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG
Class logger.

Constructor Detail

SchemaBuilder

private SchemaBuilder()
Constructor.

Method Detail

buildSchema

@Nonnull
public static Schema buildSchema(@Nonnull
                                         SchemaBuilder.SchemaLanguage lang,
                                         @Nonnull@NotEmpty@NullableElements
                                         String... schemaFilesOrDirectories)
                          throws SAXException
Builds a schema from the given schema sources.

Parameters:
lang - schema language, must not be null
schemaFilesOrDirectories - files or directories which contains schema sources
Returns:
the constructed schema
Throws:
SAXException - thrown if there is a problem converting the schema sources in to a schema

buildSchema

@Nonnull
public static Schema buildSchema(@Nonnull
                                         SchemaBuilder.SchemaLanguage lang,
                                         @Nonnull@NotEmpty@NullableElements
                                         File... schemaFilesOrDirectories)
                          throws SAXException
Builds a schema from the given schema sources.

Parameters:
lang - schema language, must not be null
schemaFilesOrDirectories - files or directories which contains schema sources
Returns:
the constructed schema
Throws:
SAXException - thrown if there is a problem converting the schema sources in to a schema

buildSchema

@Nonnull
public static Schema buildSchema(@Nonnull
                                         SchemaBuilder.SchemaLanguage lang,
                                         @Nonnull@NotEmpty@NullableElements
                                         Resource... schemaSources)
                          throws SAXException
Builds a schema from the given schema sources.

Parameters:
lang - schema language
schemaSources - schema source resources
Returns:
the constructed schema
Throws:
SAXException - thrown if there is a problem converting the schema sources in to a schema

buildSchema

@Nonnull
public static Schema buildSchema(@Nonnull
                                         SchemaBuilder.SchemaLanguage lang,
                                         @Nonnull@NotEmpty@NullableElements
                                         InputStream... schemaSources)
                          throws SAXException
Builds a schema from the given schema sources.

Parameters:
lang - schema language
schemaSources - schema sources
Returns:
the constructed schema
Throws:
SAXException - thrown if there is a problem converting the schema sources in to a schema

getSchemaFiles

private static void getSchemaFiles(@Nonnull
                                   SchemaBuilder.SchemaLanguage lang,
                                   @Nonnull
                                   List<File> accumulatedSchemaFiles,
                                   @Nonnull
                                   File... schemaFilesOrDirectories)
Gets all of the schema files in the given set of readable files, directories or subdirectories.

Parameters:
lang - schema language
schemaFilesOrDirectories - files and directories which may contain schema files
accumulatedSchemaFiles - list that accumulates the schema files

buildSchema

@Nonnull
private static Schema buildSchema(@Nonnull
                                          SchemaBuilder.SchemaLanguage lang,
                                          @Nonnull@NotEmpty@NullableElements
                                          List<? extends Source> schemaSources)
                           throws SAXException
Builds a schema from the given schema sources.

Parameters:
lang - schema language
schemaSources - schema sources
Returns:
the constructed schema
Throws:
SAXException - thrown if there is a problem converting the schema sources in to a schema


Copyright © 1999-2012. All Rights Reserved.