Class BrAPISchemaReader
java.lang.Object
org.brapi.schematools.core.brapischema.BrAPISchemaReader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreadDirectories(Path schemaDirectory) Reads the schema module directories within a parent directory.readSchema(String schema, String module) Reads a single object type from an JSON schema string.readSchema(Path schemaPath, String module) Reads a single object type from an JSON schema.
-
Constructor Details
-
BrAPISchemaReader
public BrAPISchemaReader()
-
-
Method Details
-
readDirectories
public List<BrAPIObjectType> readDirectories(Path schemaDirectory) throws BrAPISchemaReaderException Reads the schema module directories within a parent directory. Each directory in the parent directory is a module and the JSON schemas in the directories are object types- Parameters:
schemaDirectory- the parent directory that holds all the module directories- Returns:
- a list of BrAPIObjectType with one type per JSON Schema
- Throws:
BrAPISchemaReaderException- if there is a problem reading the directories or JSON schemas
-
readSchema
Reads a single object type from an JSON schema. If the JSON schema contain more than one type definition only the first is returned- Parameters:
schemaPath- a JSON schema filemodule- the module in which the object resides- Returns:
- BrAPIObjectType with one type per JSON Schema
- Throws:
BrAPISchemaReaderException- if there is a problem reading the JSON schema
-
readSchema
Reads a single object type from an JSON schema string. If the JSON schema contain more than one type definition only the first is returned- Parameters:
schema- a JSON schema stringmodule- the module in which the object resides- Returns:
- BrAPIObjectType with one type per JSON Schema
- Throws:
BrAPISchemaReaderException- if there is a problem reading the JSON schema
-