org.kuali.student.jpa.mojo
Class JpaImplServiceWriter

java.lang.Object
  extended by org.kuali.student.contract.writer.XmlWriter
      extended by org.kuali.student.contract.writer.JavaClassWriter
          extended by org.kuali.student.jpa.mojo.JpaImplServiceWriter

public class JpaImplServiceWriter
extends JavaClassWriter

Author:
nwright

Nested Class Summary
protected static class JpaImplServiceWriter.MethodType
          The standard type of methods used in our Service contract.
 
Field Summary
protected  ModelFinder finder
           
protected  List<ServiceMethod> methods
           
protected  ServiceContractModel model
           
protected  String servKey
          Name of the service being operated on.
 
Constructor Summary
JpaImplServiceWriter(ServiceContractModel model, String directory, String rootPackage, String servKey, List<ServiceMethod> methods, boolean isR1)
           
JpaImplServiceWriter(ServiceContractModel model, String directory, String rootPackage, String servKey, List<ServiceMethod> methods, boolean isR1, String packageName, String className)
           
 
Method Summary
static String calcClassName(String servKey)
          Given the service key (name), returns a calculated class name for the jpa impl.
protected  JpaImplServiceWriter.MethodType calcMethodType(ServiceMethod method)
          Analyses the method and returns a MethodType enum that describes what type of method this is.
protected  String calcObjectName(ServiceMethod method)
           
static String calcPackage(String servKey, String rootPackage)
          Returns the jpa implementation package name.
static String calcServiceInterfaceClassName(String servKey)
           
protected static String fixServKey(String servKey)
           
protected  String initLower(String str)
           
 void write()
          Write out the entire file
 
Methods inherited from class org.kuali.student.contract.writer.JavaClassWriter
closeBrace, getBody, getClassName, getDirectory, getFileName, getPackageName, getRootDirectory, importsAdd, indentPrintWrappedComment, openBrace, setPackageName, writeHeader, writeImports, writeJavaClassAndImportsOutToFile
 
Methods inherited from class org.kuali.student.contract.writer.XmlWriter
decrementIndent, escapeXML, getIndent, getOut, incrementIndent, indent, indent, indentPrint, indentPrintln, print, println, setIndent, setOut, writeAttribute, writeComment, writeCommentBox, writeTag, writeTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected ServiceContractModel model

finder

protected ModelFinder finder

servKey

protected String servKey
Name of the service being operated on. If it is a RICE service it is prefixed with RICE. [11:32:18 AM] Norman Wright: short name... I think it gets it by taking the java class SimpleName and stripping off the word "Service" and I think making it lower case. [11:32:24 AM] Norman Wright: so OrganizationService becomes organization


methods

protected List<ServiceMethod> methods
Constructor Detail

JpaImplServiceWriter

public JpaImplServiceWriter(ServiceContractModel model,
                            String directory,
                            String rootPackage,
                            String servKey,
                            List<ServiceMethod> methods,
                            boolean isR1)

JpaImplServiceWriter

public JpaImplServiceWriter(ServiceContractModel model,
                            String directory,
                            String rootPackage,
                            String servKey,
                            List<ServiceMethod> methods,
                            boolean isR1,
                            String packageName,
                            String className)
Method Detail

calcPackage

public static String calcPackage(String servKey,
                                 String rootPackage)
Returns the jpa implementation package name.

Parameters:
servKey -
rootPackage -
Returns:

fixServKey

protected static String fixServKey(String servKey)

calcClassName

public static String calcClassName(String servKey)
Given the service key (name), returns a calculated class name for the jpa impl.


calcServiceInterfaceClassName

public static String calcServiceInterfaceClassName(String servKey)

calcMethodType

protected JpaImplServiceWriter.MethodType calcMethodType(ServiceMethod method)
Analyses the method and returns a MethodType enum that describes what type of method this is.


write

public void write()
Write out the entire file


initLower

protected String initLower(String str)

calcObjectName

protected String calcObjectName(ServiceMethod method)


Copyright © 2004–2014 The Kuali Foundation. All rights reserved.