|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object velosurf.sql.ConfigLoader
public class ConfigLoader
A model configuration loader for the Database object.
Field Summary | |
---|---|
private static java.util.regex.Pattern |
attributeResultSyntax
Syntax checker pattern for the result attribute of <attribute > tags. |
private Database |
database
Database. |
private boolean |
warnedAboutAttributeTagDeprecation
|
private XIncludeResolver |
xincludeResolver
< xi:include > tag resolver. |
Constructor Summary | |
---|---|
ConfigLoader(Database db)
Constructor. |
|
ConfigLoader(Database db,
XIncludeResolver xincludeResolver)
Constructor. |
Method Summary | |
---|---|
private java.lang.String |
adaptCase(java.lang.String str)
Adapt the case to match chosen database case policy. |
private boolean |
checkSyntax(java.lang.String paramName,
java.lang.String paramValue,
java.lang.String[] possibleValues)
Check the syntax of a parameter in the config file. |
private void |
defineActions(org.jdom.Element parent,
Entity entity)
Define actions. |
private void |
defineAttributes(org.jdom.Element parent,
Entity entity)
Define Velosurf attributes. |
private void |
defineConstraints(org.jdom.Element element,
Entity entity)
Define constraints. |
private void |
defineEntities(org.jdom.Element database)
Define entities. |
private void |
defineForeignKeys(org.jdom.Element parent,
Entity entity)
Define foreign keys. |
static boolean |
isTransaction(org.jdom.Element element)
Check whether the action defined by this XML tree is a simple action or a transaction. |
void |
loadConfig(java.io.InputStream config)
Main method of the ConfigLoader. |
private static int |
parseCaching(java.lang.String caching)
Parse a caching value. |
private void |
setDatabaseAttributes(org.jdom.Element database)
Parses database XML attributes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Database database
private XIncludeResolver xincludeResolver
xi:include
> tag resolver.
private static final java.util.regex.Pattern attributeResultSyntax
result
attribute of <attribute
> tags.
private boolean warnedAboutAttributeTagDeprecation
Constructor Detail |
---|
public ConfigLoader(Database db)
db
- databasepublic ConfigLoader(Database db, XIncludeResolver xincludeResolver)
db
- databasexincludeResolver
- <xi:include
> tag resolverMethod Detail |
---|
public void loadConfig(java.io.InputStream config) throws java.lang.Exception
config
- the model configuration input stream
java.lang.Exception
private java.lang.String adaptCase(java.lang.String str)
str
- string to adapt
private void setDatabaseAttributes(org.jdom.Element database)
database
- parent elementprivate void defineAttributes(org.jdom.Element parent, Entity entity) throws java.sql.SQLException
parent
- parent XML elemententity
- parent entity
java.sql.SQLException
private void defineForeignKeys(org.jdom.Element parent, Entity entity)
parent
- parent XML elemententity
- parent entityprivate void defineActions(org.jdom.Element parent, Entity entity)
parent
- parent XML elemententity
- parent entityprivate void defineEntities(org.jdom.Element database) throws java.lang.Exception
database
- database XML element
java.lang.Exception
private void defineConstraints(org.jdom.Element element, Entity entity) throws java.lang.Exception
element
- parent XML elemententity
- parent entity
java.lang.Exception
private boolean checkSyntax(java.lang.String paramName, java.lang.String paramValue, java.lang.String[] possibleValues)
paramName
- name of the parameterparamValue
- value of the parameterpossibleValues
- possible values for the parameter
private static int parseCaching(java.lang.String caching)
caching
- string describing the type of caching
public static boolean isTransaction(org.jdom.Element element)
element
- XML tree defining an action
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |