|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.fluxion.datapublisher.beangen.BeanConfig
public class BeanConfig
A convenience class to make autogeneration of the database bean model easier.
Rather than generating all beans by writing all the code explicitly by hand,
one can specifiy various properties on this class and generate the beans
using the BeanWriter
class, passing a set of
BeanConfig
objects. Some code will still need to be hand
specified, as the resulting beans must contain database query logic. The
BeanConfig
layer should considerably simplify the process,
though.
BeanConfig
Constructor Summary | |
---|---|
BeanConfig()
|
Method Summary | |
---|---|
void |
addGetter(java.lang.String methodName,
java.lang.String returnType)
Method name should exclude the "get" part. |
void |
addGetterAndSetter(java.lang.String typeName)
Method name should exclude the get/set parts. |
void |
addMethod(java.lang.String methodName,
java.lang.String returnType)
|
void |
addMethodAnnotation(java.lang.String methodName,
java.lang.String annotationString)
Add an annotation to a given method. |
void |
addSetter(java.lang.String methodName)
Method name should exclude the set part. |
java.lang.String |
getClassName()
|
java.lang.Class |
getEntityAnn()
|
java.lang.Class |
getMetaAnn()
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getMethodAnnotations()
|
java.util.Map<java.lang.String,java.lang.String> |
getMethods()
|
java.lang.String |
getSchemaNameAnn()
|
java.lang.String |
getTableNameAnn()
|
void |
removeMethodAnnotation(java.lang.String methodName,
java.lang.String annotationString)
Remove an annotation from a given method. |
void |
setClassName(java.lang.String className)
Set the short bean name. |
void |
setEntityAnn(java.lang.Class entityAnn)
|
void |
setMetaAnn(java.lang.Class value)
Set the name of the structure being retrieved. |
void |
setMethodAnnotations(java.util.Map<java.lang.String,java.util.List<java.lang.String>> methodAnns)
Add an annotation to a given method. |
void |
setMethods(java.util.Map<java.lang.String,java.lang.String> methodNames)
Set the map of methods (which is actually a map of String methodName -> String returnType) for this bean. |
void |
setSchemaNameAnn(java.lang.String schemaNameAnn)
|
void |
setTableNameAnn(java.lang.String tableNameAnn)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BeanConfig()
Method Detail |
---|
public java.lang.Class getEntityAnn()
public void setEntityAnn(java.lang.Class entityAnn)
public java.lang.String getSchemaNameAnn()
public void setSchemaNameAnn(java.lang.String schemaNameAnn)
public java.lang.String getTableNameAnn()
public void setTableNameAnn(java.lang.String tableNameAnn)
public java.lang.Class getMetaAnn()
public void setMetaAnn(java.lang.Class value)
net.sourceforge.fluxion.datapublisher.sql.meta.TableAnn
(generated by the owl2constants-plugin).
value
- the annotation class to use to annotate this beanpublic java.lang.String getClassName()
public void setClassName(java.lang.String className)
BeanConfig
object handles
capitalisation of the first character and the addition of the "Bean" to the
end of the class name, so the shortened name of the bean (e.g. the table
name itself) should be supplied.
className
- the name of this bean classpublic java.util.Map<java.lang.String,java.lang.String> getMethods()
public void setMethods(java.util.Map<java.lang.String,java.lang.String> methodNames)
methodNames
- the set of all methods to usepublic void addMethod(java.lang.String methodName, java.lang.String returnType)
public void addGetter(java.lang.String methodName, java.lang.String returnType)
methodName
- the name of the method to createreturnType
- the return type for the methodpublic void addSetter(java.lang.String methodName)
methodName
- the name of the method to createpublic void addGetterAndSetter(java.lang.String typeName)
typeName
- the "Type" to create getter and setter methods for -
roughly corresponds to the name of the field that will be
generatedpublic void addMethodAnnotation(java.lang.String methodName, java.lang.String annotationString)
methodName
- the name of the methodannotationString
- the string describing the annotation to setpublic void removeMethodAnnotation(java.lang.String methodName, java.lang.String annotationString)
methodName
- the name of the methodannotationString
- the string describing the annotation to setpublic void setMethodAnnotations(java.util.Map<java.lang.String,java.util.List<java.lang.String>> methodAnns)
methodAnns
- the map of annotations to method for the bean being
configuredpublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> getMethodAnnotations()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |