org.kuali.student.jpa.mojo
Class JpaEntityWriter

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.JpaEntityWriter

public class JpaEntityWriter
extends JavaClassWriter

Author:
nwright

Nested Class Summary
protected static class JpaEntityWriter.MethodType
          The standard type of methods used in our Service contract.
 
Field Summary
protected  ModelFinder finder
           
protected  ServiceContractModel model
           
protected  String servKey
          Name of the service being operated on.
 
Constructor Summary
JpaEntityWriter(ServiceContractModel model, String directory, String rootPackage, String servKey, List<ServiceMethod> methods, XmlType xmlType, boolean isR1)
           
JpaEntityWriter(ServiceContractModel model, String directory, String rootPackage, String servKey, List<ServiceMethod> methods, XmlType xmlType, boolean isR1, String packageName, String className)
           
 
Method Summary
static String calcClassName(String servKey, XmlType xmlType)
          Given the service key (name), returns a calculated class name for the jpa impl.
static String calcInfcName(XmlType xmlType)
           
protected  JpaEntityWriter.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.
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

Constructor Detail

JpaEntityWriter

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

JpaEntityWriter

public JpaEntityWriter(ServiceContractModel model,
                       String directory,
                       String rootPackage,
                       String servKey,
                       List<ServiceMethod> methods,
                       XmlType xmlType,
                       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,
                                   XmlType xmlType)
Given the service key (name), returns a calculated class name for the jpa impl.


calcInfcName

public static String calcInfcName(XmlType xmlType)

calcMethodType

protected JpaEntityWriter.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.