public class Schematic extends DocumentFactory
Modifier and Type | Field and Description |
---|---|
static String |
TYPE_FIELD |
DEFAULT_FACTORY
Constructor and Description |
---|
Schematic() |
Modifier and Type | Method and Description |
---|---|
static SchemaLibrary |
createSchemaLibrary()
Create an in-memory schema library.
|
static SchemaLibrary |
createSchemaLibrary(String name)
Create an in-memory schema library.
|
static <T extends SchematicDb> |
getDb(Document document)
Returns a DB with the given configuration document
Document . |
static <T extends SchematicDb> |
getDb(Document document,
ClassLoader cl)
Returns a DB with the given type and configuration document, by delegating to all the available
SchematicDbProvider
services. |
static <T extends SchematicDb> |
getDb(InputStream configInputStream)
Returns a DB with reads the given input stream as a configuration document
Document . |
newArray, newArray, newArray, newArray, newDocument, newDocument, newDocument, newDocument, newDocument, newDocument
public static final String TYPE_FIELD
public static <T extends SchematicDb> T getDb(InputStream configInputStream) throws ParsingException, RuntimeException
Document
. This document is
expected to contain a type field
to indicate the type
of DB.ParsingException
- if the given input stream is not a valid JSON documentRuntimeException
getDb(Document, ClassLoader)
public static <T extends SchematicDb> T getDb(Document document) throws RuntimeException
Document
. This document is expected to contain
a type field
to indicate the type of DB.RuntimeException
getDb(Document, ClassLoader)
public static <T extends SchematicDb> T getDb(Document document, ClassLoader cl) throws RuntimeException
SchematicDbProvider
services. This document is expected to contain a type field
to indicate the typedocument
- a Document
containing the configuration of a particular DB type; may not be nullcl
- a ClassLoader
instance to be used when searching for available DB provider.SchematicDb
instance with the given alias, never null
RuntimeException
- if a DB with the given alias cannot be found or it fails during initializationpublic static SchemaLibrary createSchemaLibrary()
public static SchemaLibrary createSchemaLibrary(String name)
name
- the name of the library; may be null if a default name is to be usedCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.