ozone core API

org.ozoneDB.tools.OPP.srcgen.builder
Class OcdBuilder

java.lang.Object
  extended byorg.ozoneDB.tools.OPP.srcgen.builder.OcdBuilder
All Implemented Interfaces:
ClassBuilder

public class OcdBuilder
extends java.lang.Object
implements ClassBuilder

A builder that builds OCD:s

Author:
Joakim Ohlrogge To change this template use Options | File Templates.

Nested Class Summary
 
Nested classes inherited from class org.ozoneDB.tools.OPP.srcgen.ClassBuilder
ClassBuilder.Parameter
 
Field Summary
private  MessageWriter msgWriter
           
private  org.ozoneDB.tools.OPP.castor.OzoneClassDescriptor ocd
           
private  OutputStreamFactory osf
           
private  java.io.Writer wr
           
 
Constructor Summary
OcdBuilder(OutputStreamFactory osf)
           
 
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
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wr

private java.io.Writer wr

ocd

private org.ozoneDB.tools.OPP.castor.OzoneClassDescriptor ocd

osf

private OutputStreamFactory osf

msgWriter

private MessageWriter msgWriter
Constructor Detail

OcdBuilder

public OcdBuilder(OutputStreamFactory osf)
Method Detail

init

public void init(MessageWriter msgWriter)
Description copied from interface: ClassBuilder
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.

Specified by:
init in interface ClassBuilder
Parameters:
msgWriter - The writer the builder should use to report messages.

beginClass

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

Specified by:
beginClass in interface ClassBuilder
Parameters:
modifer - 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)
Description copied from interface: ClassBuilder
Called for each constructor in the current class

Specified by:
makeConstructor in interface ClassBuilder
Parameters:
modifier - The modifier for this constructor
parameters - The parameters for this constructor
exceptions - The exceptions thrown by this constructor

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
Description copied from interface: ClassBuilder
Called for each method in the current class

Specified by:
makeMethod in interface ClassBuilder
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
Description copied from interface: ClassBuilder
Called at the end of each generated class. Must be called once and once only for each beginClass.

Specified by:
endClass in interface ClassBuilder
Throws:
BuilderException

ozone core API

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