jaxx.compiler.decorators
Class DefaultCompiledObjectDecorator

java.lang.Object
  extended by jaxx.compiler.decorators.DefaultCompiledObjectDecorator
All Implemented Interfaces:
CompiledObjectDecorator
Direct Known Subclasses:
BoxedCompiledObjectDecorator, HelpRootCompiledObjectDecorator

public class DefaultCompiledObjectDecorator
extends java.lang.Object
implements CompiledObjectDecorator

The default compiledObjectDecorator.

Since:
1.2
Author:
tony

Constructor Summary
DefaultCompiledObjectDecorator()
           
 
Method Summary
protected  void addClientProperties(CompiledObject object, java.lang.StringBuffer code, java.lang.String eol)
           
 java.lang.String createCompleteSetupMethod(JAXXCompiler compiler, CompiledObject object, JavaFile javaFile)
          Obtain the setup code of the given object from the compiler to be inject in the generated method $completeSetup.
 boolean createInitializer(JAXXCompiler compiler, CompiledObject root, CompiledObject object, java.lang.StringBuffer code, boolean lastWasMethodCall)
          Create the initializer code for the given compiled object and inject it in the code.
 void finalizeCompiler(JAXXCompiler compiler, CompiledObject root, CompiledObject object, JavaFile javaFile, java.lang.String packageName, java.lang.String className, java.lang.String fullClassName)
          Finalize the given compiled object before any generation in the file.
 java.lang.String getCreationCode(JAXXCompiler compiler, CompiledObject object)
          Obtain the creation code of the given object from the compiler to inject in generate method $initialize or createXXX in not inline.
 java.lang.String getName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCompiledObjectDecorator

public DefaultCompiledObjectDecorator()
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface CompiledObjectDecorator
Returns:
the name of the decorator (match the content of a decorator attribute value in a JAXX file)

finalizeCompiler

public void finalizeCompiler(JAXXCompiler compiler,
                             CompiledObject root,
                             CompiledObject object,
                             JavaFile javaFile,
                             java.lang.String packageName,
                             java.lang.String className,
                             java.lang.String fullClassName)
Description copied from interface: CompiledObjectDecorator
Finalize the given compiled object before any generation in the file.

Specified by:
finalizeCompiler in interface CompiledObjectDecorator
Parameters:
compiler - the compiler to use
root - the root compiled object of the jaxx file
object - the compiled object to treate
javaFile - the file to treate
packageName - the package name
className - the (simple ?) class name
fullClassName - the fully class name

getCreationCode

public java.lang.String getCreationCode(JAXXCompiler compiler,
                                        CompiledObject object)
                                 throws CompilerException
Description copied from interface: CompiledObjectDecorator
Obtain the creation code of the given object from the compiler to inject in generate method $initialize or createXXX in not inline.

Specified by:
getCreationCode in interface CompiledObjectDecorator
Parameters:
compiler - the compiler to use
object - the compiled object to treate
Returns:
the code to inject in $initialize (or in the createXXX in not inline) method to create the given object
Throws:
CompilerException - if any pb

createCompleteSetupMethod

public java.lang.String createCompleteSetupMethod(JAXXCompiler compiler,
                                                  CompiledObject object,
                                                  JavaFile javaFile)
Description copied from interface: CompiledObjectDecorator
Obtain the setup code of the given object from the compiler to be inject in the generated method $completeSetup.

Specified by:
createCompleteSetupMethod in interface CompiledObjectDecorator
Parameters:
compiler - the compiler to use
object - the compiled object to treate
javaFile - the file to treate
Returns:
the code to inject in $completeSetup method in file

createInitializer

public boolean createInitializer(JAXXCompiler compiler,
                                 CompiledObject root,
                                 CompiledObject object,
                                 java.lang.StringBuffer code,
                                 boolean lastWasMethodCall)
Description copied from interface: CompiledObjectDecorator
Create the initializer code for the given compiled object and inject it in the code.

Specified by:
createInitializer in interface CompiledObjectDecorator
Parameters:
compiler - the compiler to use
root - the root compiled object of the jaxx file
object - the compiled object to treate
code - where to store code to inject
lastWasMethodCall - true if last instruction call was a method call
Returns:
true if the last instruction was a method call

addClientProperties

protected void addClientProperties(CompiledObject object,
                                   java.lang.StringBuffer code,
                                   java.lang.String eol)


Copyright © 2008-2010 CodeLutin. All Rights Reserved.