|
ozone core API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ozoneDB.tools.OPP.srcgen.builder.FactoryBuilder
Most of the code was lifted out of the FactoryGenerator written by Leo Mekenkamp. The FactoryGenerator was in turn based on the ProxyGenerator The FactoryBuilder is in fact half of the FactoryGenerate, the generating part. The rest of the FactoryGenerator had to do with browsing a class for constructors etc. That part is moved to a director, thus separating concerns.
Nested Class Summary |
Nested classes inherited from class org.ozoneDB.tools.OPP.srcgen.ClassBuilder |
ClassBuilder.Parameter |
Field Summary | |
private java.lang.String[] |
interfaces
|
private MessageWriter |
msgWriter
|
private java.io.PrintWriter |
out
|
private OutputStreamFactory |
outputFactory
|
private java.lang.String |
postfix
|
Constructor Summary | |
FactoryBuilder(OutputStreamFactory outputFactory,
java.lang.String postfix)
|
Method Summary | |
void |
beginClass(int modifer,
java.lang.String fullName,
java.lang.String superClass,
java.lang.String[] interfaces)
Called for each new class. |
void |
endClass()
Called at the end of each generated class. |
void |
init(MessageWriter msgWriter)
Initializes the builder for each new build. |
void |
makeConstructor(int modifier,
ClassBuilder.Parameter[] parameters,
java.lang.String[] exceptions)
Called for each constructor in the current class |
private void |
makeCreateInternal(java.lang.String implementationClass,
java.lang.String type)
|
private void |
makeGlobalHeader(java.lang.String implementationClass)
|
private void |
makeLocalHeader(java.lang.String simpleClassName)
|
void |
makeMethod(int modifier,
java.lang.String name,
ClassBuilder.Parameter[] parameters,
java.lang.String returnType,
java.lang.String[] exceptions,
int lockLevel)
Called for each method in the current class |
private void |
makeObjectForHandle(java.lang.String type)
|
private void |
makeObjectForName(java.lang.String type)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private OutputStreamFactory outputFactory
private java.lang.String postfix
private java.io.PrintWriter out
private java.lang.String[] interfaces
private MessageWriter msgWriter
Constructor Detail |
public FactoryBuilder(OutputStreamFactory outputFactory, java.lang.String postfix)
Method Detail |
private void makeCreateInternal(java.lang.String implementationClass, java.lang.String type)
private void makeGlobalHeader(java.lang.String implementationClass)
private void makeLocalHeader(java.lang.String simpleClassName)
private void makeObjectForHandle(java.lang.String type)
private void makeObjectForName(java.lang.String type)
public void init(MessageWriter msgWriter)
ClassBuilder
init
in interface ClassBuilder
msgWriter
- The writer the builder should use to report messages.public void beginClass(int modifer, java.lang.String fullName, java.lang.String superClass, java.lang.String[] interfaces) throws BuilderException
ClassBuilder
beginClass
in interface ClassBuilder
modifer
- The modifiers for this classfullName
- The full name including package path of this classsuperClass
- The full name including package pathh for this classinterfaces
- The interfaces implemented by this class
BuilderException
public void makeConstructor(int modifier, ClassBuilder.Parameter[] parameters, java.lang.String[] exceptions) throws BuilderException
ClassBuilder
makeConstructor
in interface ClassBuilder
modifier
- The modifier for this constructorparameters
- The parameters for this constructorexceptions
- The exceptions thrown by this constructor
BuilderException
public void makeMethod(int modifier, java.lang.String name, ClassBuilder.Parameter[] parameters, java.lang.String returnType, java.lang.String[] exceptions, int lockLevel) throws BuilderException
ClassBuilder
makeMethod
in interface ClassBuilder
modifier
- The modifiers for the methodname
- The name of the methodparameters
- The parameter list for the methodreturnType
- The return type of the method, use null for voidexceptions
- The exceptions thrown by the methodlockLevel
- The lock level for this method
BuilderException
public void endClass() throws BuilderException
ClassBuilder
endClass
in interface ClassBuilder
BuilderException
|
ozone core API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |