|
ozone core API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The builder part of the builder director pattern.
Provides a common interface for building class related structures.
ClassBuilders are commonly used together with a ClassDirector.
This nicely separates the concerns of what is being built and what
the source of directions is.
ClassDirector
Nested Class Summary | |
static class |
ClassBuilder.Parameter
Represents a parameter. |
Method Summary | |
void |
beginClass(int modifier,
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 |
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 |
Method Detail |
public void init(MessageWriter msgWriter)
msgWriter
- The writer the builder should use to report messages.public void beginClass(int modifier, java.lang.String fullName, java.lang.String superClass, java.lang.String[] interfaces) throws BuilderException
modifier
- 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
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
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
BuilderException
|
ozone core API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |