public class DataAccessRegistration extends Object
Constructor and Description |
---|
DataAccessRegistration() |
Modifier and Type | Method and Description |
---|---|
DataAccessRegistration |
build(String appTargetPath)
Ensure all required fields are set and valid, hydrate any other fields with
defaults.
|
String |
getAbsolutePath() |
String |
getBucket()
The bucket is the shorthand by which the controller will be accessed from templates,
from DalRegistry.get(), etc.
|
Class<? extends ModelController> |
getControllerClass() |
DynamicModelDefinition |
getDynamicModelDefinition() |
String |
getItemArrayName() |
Class<? extends Model> |
getModelClass() |
String |
getNameSpace() |
String |
getPath() |
Class<? extends Persister> |
getPersisterClass() |
String |
getRelativePath() |
Class<? extends Stash> |
getStashClass()
The class to use for the data stash.
|
String |
getTableName() |
String |
getTemplatePath() |
void |
hydratePaths(String appTargetPath)
Parse the target path and hydrate the absolute and relative path fields.
|
boolean |
isDatabaseBacked() |
boolean |
isMultiplePerFile() |
boolean |
isShouldWatch() |
boolean |
isSyncAllToMemory() |
boolean |
isUseDataFolder() |
boolean |
isWritable() |
DataAccessRegistration |
setBucket(String bucket)
The bucket is the shorthand by which the controller will be accessed from templates,
from DalRegistry.get(), etc.
|
DataAccessRegistration |
setControllerClass(Class<? extends ModelController> controllerClass)
The ModelController subclass to be associated with this registration
|
DataAccessRegistration |
setDatabaseBacked(boolean databaseBacked)
True if the registration should use the database, false if it should use the
file system.
|
DataAccessRegistration |
setDynamicModelDefinition(DynamicModelDefinition dynamicModelDefinition)
Used for defining a model via Javascript
|
DataAccessRegistration |
setItemArrayName(String itemArrayName)
If isMultiplePerFile() is true, this is the name of the array of the objects.
|
DataAccessRegistration |
setModelClass(Class<? extends Model> modelClass)
The data model to be used with this registration
|
DataAccessRegistration |
setMultiplePerFile(boolean multiplePerFile)
True for file-based data stores if there are multiple objects per file, instead of one file per object
|
DataAccessRegistration |
setNameSpace(String nameSpace) |
DataAccessRegistration |
setPath(String path)
For file based registrations, the path to the folder with the data.
|
DataAccessRegistration |
setPersisterClass(Class<? extends Persister> persisterClass)
The Persister subclass to use for this registration
|
DataAccessRegistration |
setShouldWatch(boolean shouldWatch)
Should the file system be watched for changes, and reload changes automatically?
|
DataAccessRegistration |
setStashClass(Class<? extends Stash> stashClass) |
DataAccessRegistration |
setSyncAllToMemory(boolean syncAllToMemory)
Should all objects from the data store be synced to local memory? Defaults to true.
|
DataAccessRegistration |
setTableName(String tableName)
The database table for the data, for DB backed registrations
|
DataAccessRegistration |
setTemplatePath(String templatePath)
For displayable registrations, the default template to use for rendering the object.
|
DataAccessRegistration |
setUseDataFolder(boolean useDataFolder)
If true, relative path will be relative to the app-data folder, not the project folder.
|
DataAccessRegistration |
setWritable(boolean writable)
Is Stallion allowed to write to the datastore, or is it read only?
|
public DataAccessRegistration()
public DataAccessRegistration build(String appTargetPath)
appTargetPath
- public void hydratePaths(String appTargetPath)
appTargetPath
- public Class<? extends ModelController> getControllerClass()
public DataAccessRegistration setControllerClass(Class<? extends ModelController> controllerClass)
public Class<? extends Model> getModelClass()
public DataAccessRegistration setModelClass(Class<? extends Model> modelClass)
public DataAccessRegistration setPath(String path)
public String getRelativePath()
public String getAbsolutePath()
public String getTableName()
public DataAccessRegistration setTableName(String tableName)
public Class<? extends Persister> getPersisterClass()
public DataAccessRegistration setPersisterClass(Class<? extends Persister> persisterClass)
public boolean isWritable()
public DataAccessRegistration setWritable(boolean writable)
writable
- public boolean isShouldWatch()
public DataAccessRegistration setShouldWatch(boolean shouldWatch)
public String getNameSpace()
public DataAccessRegistration setNameSpace(String nameSpace)
public String getBucket()
public String getTemplatePath()
public DataAccessRegistration setTemplatePath(String templatePath)
public boolean isUseDataFolder()
public DataAccessRegistration setUseDataFolder(boolean useDataFolder)
useDataFolder
- public DataAccessRegistration setBucket(String bucket)
public DynamicModelDefinition getDynamicModelDefinition()
public DataAccessRegistration setDynamicModelDefinition(DynamicModelDefinition dynamicModelDefinition)
dynamicModelDefinition
- public boolean isMultiplePerFile()
public DataAccessRegistration setMultiplePerFile(boolean multiplePerFile)
public String getItemArrayName()
public DataAccessRegistration setItemArrayName(String itemArrayName)
itemArrayName
- public Class<? extends Stash> getStashClass()
public DataAccessRegistration setStashClass(Class<? extends Stash> stashClass)
public boolean isSyncAllToMemory()
public DataAccessRegistration setSyncAllToMemory(boolean syncAllToMemory)
public boolean isDatabaseBacked()
public DataAccessRegistration setDatabaseBacked(boolean databaseBacked)
databaseBacked
- Copyright © 2016. All rights reserved.