|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.moesol.generator.ClassGeneratorVisitor
public abstract class ClassGeneratorVisitor
Field Summary | |
---|---|
protected Callable |
current_callable
|
Constructor Summary | |
---|---|
ClassGeneratorVisitor(Writer out,
TranslationContext ctx)
|
Method Summary | |
---|---|
protected Callable |
createCallable(Class a_class,
Method method)
Template method |
protected void |
extendConstructorProperties(Constructor ctor,
Properties p)
Template method |
protected void |
extendFieldProperties(Field field,
Properties p)
Template method |
protected void |
extendMethodProperties(Method method,
Properties p)
Template method |
protected String |
findConstructorTranslation(String prefix,
String type,
String suffix,
Callable callable)
Helper for derived classes. |
protected String |
findFieldTranslation(String prefix,
String type,
Field field)
Helper for derived classes. |
protected String |
findMethodTranslation(String prefix,
String type,
String suffix,
Callable callable)
Helper for derived classes. |
protected String |
findMeTranslation(String prefix,
String type,
Callable callable)
Helper for derived classes. |
protected String |
findParameterTranslation(String prefix,
String type,
Class parameter_type)
|
protected String |
findPropInitTranslation(String prefix,
String type,
Callable callable)
|
protected abstract String |
getFieldTemplateName(Field field)
Template method |
protected String |
getJniName(Callable callable)
|
protected String |
getJniOverload(Callable callable)
|
protected String |
getJniReturnError(Callable callable)
|
protected String |
getJniSelf(Callable callable)
Helper for derived classes. |
String |
getPassAppend()
|
protected String |
getPropertyName(Callable callable)
|
protected String |
getSeparator(Callable callable)
|
protected abstract String |
getTemplateName(Constructor ctor)
Template method |
protected abstract String |
getTemplateName(Method method)
Template method |
TranslationContext |
getTranslationContext()
|
protected String |
getTransProperty(String key)
Helper for derived classes. |
protected String |
queryMethodTranslation(String prefix,
String type,
String suffix,
Callable callable)
Helper for derived classes. |
protected String |
queryTranslation(String prefix,
String type,
String[] suffixes,
String errName)
|
void |
setPassAppend(String pass)
|
void |
setPassNumber(int pass_number)
|
protected boolean |
shouldGenerateConstructor(Constructor ctor)
Template method |
protected boolean |
shouldGenerateField(Field field)
Template method |
protected boolean |
shouldGenerateMethod(Method method)
Template method |
void |
visit(Class a_class)
override to change visit strategy |
void |
visitConstructor(Class c,
Constructor ctor)
|
void |
visitField(Class c,
Field field)
|
void |
visitMethod(Class a_class,
Method method)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Callable current_callable
Constructor Detail |
---|
public ClassGeneratorVisitor(Writer out, TranslationContext ctx)
Method Detail |
---|
public void visit(Class a_class) throws ApplyException
ApplyException
public void setPassNumber(int pass_number)
public void setPassAppend(String pass)
public String getPassAppend()
protected Callable createCallable(Class a_class, Method method) throws ApplyException
ApplyException
protected boolean shouldGenerateField(Field field)
protected void extendFieldProperties(Field field, Properties p) throws ApplyException
ApplyException
protected abstract String getFieldTemplateName(Field field) throws ApplyException
ApplyException
protected boolean shouldGenerateMethod(Method method) throws ApplyException
ApplyException
protected void extendMethodProperties(Method method, Properties p) throws ApplyException
ApplyException
protected abstract String getTemplateName(Method method) throws ApplyException
ApplyException
protected boolean shouldGenerateConstructor(Constructor ctor) throws ApplyException
ApplyException
protected void extendConstructorProperties(Constructor ctor, Properties p) throws ApplyException
ApplyException
protected abstract String getTemplateName(Constructor ctor) throws ApplyException
ApplyException
public TranslationContext getTranslationContext()
public void visitField(Class c, Field field) throws ApplyException
visitField
in interface ReflectVisitor
ApplyException
public void visitMethod(Class a_class, Method method) throws ApplyException
visitMethod
in interface ReflectVisitor
ApplyException
public void visitConstructor(Class c, Constructor ctor) throws ApplyException
visitConstructor
in interface ReflectVisitor
ApplyException
protected String getPropertyName(Callable callable)
protected String getSeparator(Callable callable)
protected String findFieldTranslation(String prefix, String type, Field field) throws ApplyException
ApplyException
protected String findMeTranslation(String prefix, String type, Callable callable) throws ApplyException
ApplyException
protected String findMethodTranslation(String prefix, String type, String suffix, Callable callable) throws ApplyException
ApplyException
protected String queryMethodTranslation(String prefix, String type, String suffix, Callable callable) throws ApplyException
ApplyException
protected String findConstructorTranslation(String prefix, String type, String suffix, Callable callable) throws ApplyException
prefix
- type
- suffix
- callable
-
ApplyException
protected String findParameterTranslation(String prefix, String type, Class parameter_type) throws ApplyException
ApplyException
protected String findPropInitTranslation(String prefix, String type, Callable callable) throws ApplyException
ApplyException
protected String queryTranslation(String prefix, String type, String[] suffixes, String errName) throws ApplyException
ApplyException
protected String getTransProperty(String key) throws ApplyException
ApplyException
protected String getJniSelf(Callable callable) throws ApplyException
ApplyException
protected String getJniReturnError(Callable callable)
protected String getJniName(Callable callable) throws ApplyException
ApplyException
protected String getJniOverload(Callable callable) throws ApplyException
ApplyException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |