public class WGSchemaDefinition
extends java.lang.Object
Constructor and Description |
---|
WGSchemaDefinition() |
Modifier and Type | Method and Description |
---|---|
void |
addDocumentDefinition(WGSchemaDocumentDefinition docDef)
Adds a document definition to the schema
|
java.util.List<WGSchemaDocumentDefinition> |
getDocumentDefinitions()
Returns the document definitions of the schema
|
java.util.Map<java.lang.String,WGSchemaDocumentDefinition> |
getDocumentDefinitionsCache()
Returns a map of document definitions, mapped by their document keys
|
double |
getVersion()
Returns the version of the schema definition format, matching the OpenWGA version that introduced it
|
void |
importSchema(WGSchemaDefinition schemaDef) |
boolean |
isCreateDefaultLanguage()
Determines if a language document for the platform default language should be automatically created
|
static WGSchemaDefinition |
read(java.io.InputStream in)
Read a serialized schema definition from an input stream
|
void |
setCreateDefaultLanguage(boolean createDefaultLanguage)
Sets if a language document for the platform default language should be automatically created
|
void |
setDocumentDefinitions(java.util.List<WGSchemaDocumentDefinition> documentDefinitions)
Sets the document definitions of this schema
|
void |
setVersion(double version)
Sets the version of the schema format
|
void |
validate()
Validates the schema for logical errors
|
void |
write(java.io.OutputStream out)
Serializes the schema definition to an output stream.
|
public static WGSchemaDefinition read(java.io.InputStream in) throws java.lang.Exception
in
- The data streamjava.lang.Exception
public void write(java.io.OutputStream out) throws java.lang.Exception
read(InputStream)
.out
- The stream to write the schema to.java.lang.Exception
public void validate() throws WGSchemaValidationException, WGAPIException
WGSchemaValidationException
- If an error is foundWGAPIException
public boolean isCreateDefaultLanguage()
public void setCreateDefaultLanguage(boolean createDefaultLanguage)
public java.util.Map<java.lang.String,WGSchemaDocumentDefinition> getDocumentDefinitionsCache()
public void addDocumentDefinition(WGSchemaDocumentDefinition docDef)
public java.util.List<WGSchemaDocumentDefinition> getDocumentDefinitions()
public void setDocumentDefinitions(java.util.List<WGSchemaDocumentDefinition> documentDefinitions)
public double getVersion()
public void setVersion(double version)
public void importSchema(WGSchemaDefinition schemaDef)