ozone core API

org.ozoneDB.tools.OPP.srcgen
Interface ClassBuilder

All Known Implementing Classes:
CompositeBuilder, FactoryBuilder, MethodNameUpgradingClassBuilderDecorator, OcdBuilder, ProxyBuilder

public interface ClassBuilder

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.

Author:
Joakim Ohlrogge
See Also:
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

init

public void init(MessageWriter msgWriter)
Initializes the builder for each new build. This method may be called several times during the lifetime of the builder but only once for each build. This method may be used reset any internal state that the builder may have.

Parameters:
msgWriter - The writer the builder should use to report messages.

beginClass

public void beginClass(int modifier,
                       java.lang.String fullName,
                       java.lang.String superClass,
                       java.lang.String[] interfaces)
                throws BuilderException
Called for each new class. May be called moore than once if the class has inner classes.

Parameters:
modifier - The modifiers for this class
fullName - The full name including package path of this class
superClass - The full name including package pathh for this class
interfaces - The interfaces implemented by this class
Throws:
BuilderException

makeConstructor

public void makeConstructor(int modifier,
                            ClassBuilder.Parameter[] parameters,
                            java.lang.String[] exceptions)
                     throws BuilderException
Called for each constructor in the current class

Parameters:
modifier - The modifier for this constructor
parameters - The parameters for this constructor
exceptions - The exceptions thrown by this constructor
Throws:
BuilderException

makeMethod

public void makeMethod(int modifier,
                       java.lang.String name,
                       ClassBuilder.Parameter[] parameters,
                       java.lang.String returnType,
                       java.lang.String[] exceptions,
                       int lockLevel)
                throws BuilderException
Called for each method in the current class

Parameters:
modifier - The modifiers for the method
name - The name of the method
parameters - The parameter list for the method
returnType - The return type of the method, use null for void
exceptions - The exceptions thrown by the method
lockLevel - The lock level for this method
Throws:
BuilderException

endClass

public void endClass()
              throws BuilderException
Called at the end of each generated class. Must be called once and once only for each beginClass.

Throws:
BuilderException

ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.