JBoss Logging I18n Tools 1.0.0.Beta7

org.jboss.logging.model
Class ImplementationClassModel

java.lang.Object
  extended by org.jboss.logging.model.ClassModel
      extended by org.jboss.logging.model.ImplementationClassModel
Direct Known Subclasses:
MessageBundleImplementor, MessageLoggerImplementor

public abstract class ImplementationClassModel
extends ClassModel

An abstract code model to create the source file that implements the interface.

Essentially this uses the com.sun.codemodel.internal.JCodeModel to generate the source files with. This class is for convenience in generating default source files.

Author:
James R. Perkins

Constructor Summary
protected ImplementationClassModel(String interfaceName, MethodDescriptors methodDescriptors, String projectCode, ImplementationType type)
          Class constructor.
 
Method Summary
protected  com.sun.codemodel.internal.JCodeModel generateModel()
          Generate the code corresponding to this class model
 MethodDescriptors getMethodDescriptors()
          Returns the method descriptions.
 ImplementationType getType()
          Returns the implementation type.
protected  void initCause(com.sun.codemodel.internal.JVar result, com.sun.codemodel.internal.JClass returnField, com.sun.codemodel.internal.JBlock body, MethodDescriptor methodDesc, com.sun.codemodel.internal.JInvocation formatterMethod)
          Initialize the cause (Throwable) return type.
 
Methods inherited from class org.jboss.logging.model.ClassModel
addMessageMethod, addMessageMethod, create, getClassName, getCodeModel, getDefinedClass, getProjectCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImplementationClassModel

protected ImplementationClassModel(String interfaceName,
                                   MethodDescriptors methodDescriptors,
                                   String projectCode,
                                   ImplementationType type)
Class constructor.

Parameters:
interfaceName - the interface name to implement.
methodDescriptors - the method descriptions
projectCode - the project code to prepend messages with.
type - the type of the implementation.
Method Detail

getType

public final ImplementationType getType()
Returns the implementation type.

Returns:
the implementation type.

getMethodDescriptors

public final MethodDescriptors getMethodDescriptors()
Returns the method descriptions.

Returns:
the method descriptions.

generateModel

protected com.sun.codemodel.internal.JCodeModel generateModel()
                                                       throws IllegalStateException
Generate the code corresponding to this class model

Overrides:
generateModel in class ClassModel
Returns:
the generated code
Throws:
IllegalStateException - if the class has already been defined.

initCause

protected void initCause(com.sun.codemodel.internal.JVar result,
                         com.sun.codemodel.internal.JClass returnField,
                         com.sun.codemodel.internal.JBlock body,
                         MethodDescriptor methodDesc,
                         com.sun.codemodel.internal.JInvocation formatterMethod)
Initialize the cause (Throwable) return type.

Parameters:
result - the return variable
returnField - the return field
body - the body of the method
methodDesc - the method description
formatterMethod - the formatter method used to format the string cause

JBoss Logging I18n Tools 1.0.0.Beta7

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.