org.kuali.student.contract.model.impl
Class ServiceContractModelQDoxLoader

java.lang.Object
  extended by org.kuali.student.contract.model.impl.ServiceContractModelQDoxLoader
All Implemented Interfaces:
ServiceContractModel

public class ServiceContractModelQDoxLoader
extends Object
implements ServiceContractModel

Author:
nwright

Field Summary
private static String[] GETTER_METHODS_TO_SKIP
           
private static String LOCALE_KEY_LIST
           
private static String MESSAGE_GROUP_KEY_LIST
           
private  List<MessageStructure> messageStructures
           
private  List<ServiceMethod> serviceMethods
           
private  List<Service> services
           
private static String[] SETTER_METHODS_TO_SKIP
           
private  List<String> sourceDirectories
           
private static com.thoughtworks.qdox.model.JavaClass STRING_JAVA_CLASS
           
private  boolean validateKualiStudent
           
private  Map<String,XmlType> xmlTypeMap
           
 
Constructor Summary
ServiceContractModelQDoxLoader(List<String> sourceDirectories)
           
ServiceContractModelQDoxLoader(List<String> sourceDirectories, boolean validateKualiStudent)
           
 
Method Summary
private  void addMessageStructure(com.thoughtworks.qdox.model.JavaClass messageStructureJavaClass, String serviceKey)
           
private  void addServiceToList(XmlType xmlType, String serviceKey)
           
private  void addXmlTypeAndMessageStructure(com.thoughtworks.qdox.model.JavaClass messageStructureJavaClass, String serviceKey)
           
private  String calcCardinality(com.thoughtworks.qdox.model.JavaClass mainClass, com.thoughtworks.qdox.model.JavaMethod getterMethod, com.thoughtworks.qdox.model.JavaMethod setterMethod, com.thoughtworks.qdox.model.JavaField beanField, String shortName)
           
private  String calcComment(com.thoughtworks.qdox.model.JavaClass javaClass)
           
private  String calcComment(String comment)
           
private  String calcDescription(com.thoughtworks.qdox.model.JavaClass mainClass, com.thoughtworks.qdox.model.JavaMethod getterMethod, com.thoughtworks.qdox.model.JavaMethod setterMethod, com.thoughtworks.qdox.model.JavaField beanField)
           
private  String calcExceptionDescription(com.thoughtworks.qdox.model.JavaMethod serviceMethod, String exceptionType)
           
private  String calcImplementationNotes(com.thoughtworks.qdox.model.JavaMethod getterMethod, com.thoughtworks.qdox.model.JavaMethod setterMethod, com.thoughtworks.qdox.model.JavaField beanField)
           
private  List<String> calcIncludedServices(com.thoughtworks.qdox.model.JavaClass javaClass)
           
private  String calcJavaPackage(com.thoughtworks.qdox.model.JavaClass javaClass)
           
private  String calcMessageStructureDesc(com.thoughtworks.qdox.model.JavaClass javaClass)
           
private  String calcMethodComment(com.thoughtworks.qdox.model.JavaClass mainClass, com.thoughtworks.qdox.model.JavaMethod getterMethod, com.thoughtworks.qdox.model.JavaMethod setterMethod, com.thoughtworks.qdox.model.JavaField beanField)
           
private  String calcMethodCommentRecursively(com.thoughtworks.qdox.model.JavaClass mainClass, com.thoughtworks.qdox.model.JavaMethod method)
           
private  String calcMissing(String str)
           
private  String calcName(com.thoughtworks.qdox.model.JavaClass mainClass, com.thoughtworks.qdox.model.JavaMethod getterMethod, com.thoughtworks.qdox.model.JavaMethod setterMethod, com.thoughtworks.qdox.model.JavaField beanField, String shortName)
           
private  String calcNameFromNameEmbeddedInDescription(com.thoughtworks.qdox.model.JavaClass mainClass, com.thoughtworks.qdox.model.JavaMethod getterMethod, com.thoughtworks.qdox.model.JavaMethod setterMethod, com.thoughtworks.qdox.model.JavaField beanField)
           
private  String calcNameFromShortName(String shortName)
           
private  String calcNameFromTag(com.thoughtworks.qdox.model.JavaMethod getterMethod, com.thoughtworks.qdox.model.JavaMethod setterMethod, com.thoughtworks.qdox.model.JavaField beanField)
           
private  boolean calcOverridden(com.thoughtworks.qdox.model.JavaClass mainClass, com.thoughtworks.qdox.model.JavaMethod getterMethod)
           
private  String calcParameterDescription(com.thoughtworks.qdox.model.JavaMethod method, String parameterName)
           
private  String calcPrimitive(com.thoughtworks.qdox.model.JavaClass javaClass)
           
private  String calcReadOnly(com.thoughtworks.qdox.model.JavaMethod getterMethod, com.thoughtworks.qdox.model.JavaMethod setterMethod, com.thoughtworks.qdox.model.JavaField beanField)
           
private  com.thoughtworks.qdox.model.JavaClass calcRealJavaClass(com.thoughtworks.qdox.model.JavaParameter param)
           
private  com.thoughtworks.qdox.model.JavaClass calcRealJavaClass(com.thoughtworks.qdox.model.Type type)
           
private  com.thoughtworks.qdox.model.JavaClass calcRealJavaClassOfGetterReturn(com.thoughtworks.qdox.model.JavaMethod getterMethod)
           
private  com.thoughtworks.qdox.model.JavaClass calcRealJavaClassOfSetterFirstParam(com.thoughtworks.qdox.model.JavaMethod setterMethod)
           
private  String calcRequired(com.thoughtworks.qdox.model.JavaMethod getterMethod, com.thoughtworks.qdox.model.JavaMethod setterMethod, com.thoughtworks.qdox.model.JavaField beanField)
           
private  String calcReturnDescription(com.thoughtworks.qdox.model.JavaMethod serviceMethod)
           
private  String calcServiceUrl(com.thoughtworks.qdox.model.JavaClass serviceClass)
           
private  String calcShortNameFromGetter(com.thoughtworks.qdox.model.JavaMethod method)
           
private  String calcShortNameFromSetter(com.thoughtworks.qdox.model.JavaMethod method)
           
private  String calcType(com.thoughtworks.qdox.model.JavaClass javaClass)
           
private  String calcType(com.thoughtworks.qdox.model.JavaClass mainClass, com.thoughtworks.qdox.model.JavaMethod getterMethod, com.thoughtworks.qdox.model.JavaMethod setterMethod, com.thoughtworks.qdox.model.JavaField beanField, String shortName)
           
private  String calcType(com.thoughtworks.qdox.model.JavaParameter parameter)
           
private  String calcType(com.thoughtworks.qdox.model.Type type)
           
private  String calcTypeOfGetterMethodReturn(com.thoughtworks.qdox.model.JavaMethod getterMethod)
           
private  String calcTypeOfSetterMethodFirstParam(com.thoughtworks.qdox.model.JavaMethod setterMethod)
           
private  String calcVersion(com.thoughtworks.qdox.model.JavaClass javaClass)
           
private  String calcVersion(String comment)
           
private  String calcXmlAttribute(com.thoughtworks.qdox.model.JavaField beanField)
           
private  void checkIfExists(String sourceDirectory)
           
private  String dump(com.thoughtworks.qdox.model.DocletTag tag)
           
private  com.thoughtworks.qdox.model.JavaField findField(com.thoughtworks.qdox.model.JavaClass javaClass, String name)
           
private  com.thoughtworks.qdox.model.JavaField findField(com.thoughtworks.qdox.model.JavaClass javaClass, String shortName, com.thoughtworks.qdox.model.JavaMethod setterMethod)
           
private  com.thoughtworks.qdox.model.JavaMethod findGetterMethod(com.thoughtworks.qdox.model.JavaClass msClass, String shortName)
           
private  com.thoughtworks.qdox.model.JavaMethod findInterfaceMethod(com.thoughtworks.qdox.model.JavaClass mainClass, com.thoughtworks.qdox.model.JavaMethod method)
           
private  com.thoughtworks.qdox.model.JavaMethod findMethodOnInterfaceRecursively(com.thoughtworks.qdox.model.JavaClass infcClass, String callSig)
           
private  com.thoughtworks.qdox.model.JavaMethod findSetterMethod(com.thoughtworks.qdox.model.JavaClass msClass, String shortName)
           
private  com.thoughtworks.qdox.model.JavaMethod findSuperMethod(com.thoughtworks.qdox.model.JavaMethod method)
           
private  String getAccessorType(com.thoughtworks.qdox.model.Annotation[] annotations)
           
private  String getAccessorType(com.thoughtworks.qdox.model.JavaMethod method)
           
private  com.thoughtworks.qdox.model.Annotation getAnnotation(com.thoughtworks.qdox.model.JavaMethod getterMethod, com.thoughtworks.qdox.model.JavaMethod setterMethod, com.thoughtworks.qdox.model.JavaField beanField, String type)
           
private  String getCoreConstants(String shortName)
           
private  Set<String> getFieldsUsingPropOrder(com.thoughtworks.qdox.model.JavaClass messageStructureJavaClass)
           
private  com.thoughtworks.qdox.model.JavaClass getMatchingInfc(com.thoughtworks.qdox.model.JavaClass javaClass)
           
 List<MessageStructure> getMessageStructures()
          Get Message Structure Definitions
 List<ServiceMethod> getServiceMethods()
          Get service methods
 List<Service> getServices()
          get the service definitions
private  String getShortNameFromElements(String shortName, com.thoughtworks.qdox.model.JavaClass messageStructureJavaClass)
           
private  Set<String> getShortNames(com.thoughtworks.qdox.model.JavaClass messageStructureJavaClass)
           
 List<String> getSourceNames()
           
 List<XmlType> getXmlTypes()
          load xml types
private  String initLower(String str)
           
private  String initUpper(String str)
           
private  boolean isCollection(com.thoughtworks.qdox.model.JavaClass javaClass)
           
private  boolean isCollection(com.thoughtworks.qdox.model.Type type)
           
private  boolean isCommentNotEmpty(String desc)
           
private  boolean isComplex(com.thoughtworks.qdox.model.JavaClass javaClass)
           
private  boolean isGetterMethodToProcess(com.thoughtworks.qdox.model.JavaMethod method, String className)
           
private  boolean isReturnACollection(com.thoughtworks.qdox.model.JavaClass mainClass, com.thoughtworks.qdox.model.JavaMethod getterMethod, com.thoughtworks.qdox.model.JavaMethod setterMethod, com.thoughtworks.qdox.model.JavaField beanField, String shortName)
           
private  boolean isServiceToProcess(com.thoughtworks.qdox.model.JavaClass javaClass)
           
private  boolean isSetterMethodToProcess(com.thoughtworks.qdox.model.JavaMethod method, String className)
           
 boolean isValidateKualiStudent()
           
private  void parse()
           
private  String[] parseCommentVersion(String commentVersion)
           
private  String[] parseNameDesc(String nameDesc)
           
 void setValidateKualiStudent(boolean validateKualiStudent)
           
private  String stripQuotes(String str)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALE_KEY_LIST

private static final String LOCALE_KEY_LIST
See Also:
Constant Field Values

MESSAGE_GROUP_KEY_LIST

private static final String MESSAGE_GROUP_KEY_LIST
See Also:
Constant Field Values

STRING_JAVA_CLASS

private static final com.thoughtworks.qdox.model.JavaClass STRING_JAVA_CLASS

sourceDirectories

private List<String> sourceDirectories

services

private List<Service> services

serviceMethods

private List<ServiceMethod> serviceMethods

xmlTypeMap

private Map<String,XmlType> xmlTypeMap

messageStructures

private List<MessageStructure> messageStructures

validateKualiStudent

private boolean validateKualiStudent

SETTER_METHODS_TO_SKIP

private static final String[] SETTER_METHODS_TO_SKIP

GETTER_METHODS_TO_SKIP

private static final String[] GETTER_METHODS_TO_SKIP
Constructor Detail

ServiceContractModelQDoxLoader

public ServiceContractModelQDoxLoader(List<String> sourceDirectories)

ServiceContractModelQDoxLoader

public ServiceContractModelQDoxLoader(List<String> sourceDirectories,
                                      boolean validateKualiStudent)
Method Detail

isValidateKualiStudent

public boolean isValidateKualiStudent()

setValidateKualiStudent

public void setValidateKualiStudent(boolean validateKualiStudent)

getServiceMethods

public List<ServiceMethod> getServiceMethods()
Description copied from interface: ServiceContractModel
Get service methods

Specified by:
getServiceMethods in interface ServiceContractModel
Returns:

getSourceNames

public List<String> getSourceNames()
Specified by:
getSourceNames in interface ServiceContractModel

getServices

public List<Service> getServices()
Description copied from interface: ServiceContractModel
get the service definitions

Specified by:
getServices in interface ServiceContractModel
Returns:
list of services known to the metadata

getXmlTypes

public List<XmlType> getXmlTypes()
Description copied from interface: ServiceContractModel
load xml types

Specified by:
getXmlTypes in interface ServiceContractModel
Returns:

getMessageStructures

public List<MessageStructure> getMessageStructures()
Description copied from interface: ServiceContractModel
Get Message Structure Definitions

Specified by:
getMessageStructures in interface ServiceContractModel
Returns:

dump

private String dump(com.thoughtworks.qdox.model.DocletTag tag)

checkIfExists

private void checkIfExists(String sourceDirectory)

parse

private void parse()

isServiceToProcess

private boolean isServiceToProcess(com.thoughtworks.qdox.model.JavaClass javaClass)

calcIncludedServices

private List<String> calcIncludedServices(com.thoughtworks.qdox.model.JavaClass javaClass)

calcParameterDescription

private String calcParameterDescription(com.thoughtworks.qdox.model.JavaMethod method,
                                        String parameterName)

calcExceptionDescription

private String calcExceptionDescription(com.thoughtworks.qdox.model.JavaMethod serviceMethod,
                                        String exceptionType)

calcReturnDescription

private String calcReturnDescription(com.thoughtworks.qdox.model.JavaMethod serviceMethod)

calcServiceUrl

private String calcServiceUrl(com.thoughtworks.qdox.model.JavaClass serviceClass)

addXmlTypeAndMessageStructure

private void addXmlTypeAndMessageStructure(com.thoughtworks.qdox.model.JavaClass messageStructureJavaClass,
                                           String serviceKey)

calcJavaPackage

private String calcJavaPackage(com.thoughtworks.qdox.model.JavaClass javaClass)

calcMessageStructureDesc

private String calcMessageStructureDesc(com.thoughtworks.qdox.model.JavaClass javaClass)

getMatchingInfc

private com.thoughtworks.qdox.model.JavaClass getMatchingInfc(com.thoughtworks.qdox.model.JavaClass javaClass)

calcPrimitive

private String calcPrimitive(com.thoughtworks.qdox.model.JavaClass javaClass)

initLower

private String initLower(String str)

initUpper

private String initUpper(String str)

getShortNames

private Set<String> getShortNames(com.thoughtworks.qdox.model.JavaClass messageStructureJavaClass)

getFieldsUsingPropOrder

private Set<String> getFieldsUsingPropOrder(com.thoughtworks.qdox.model.JavaClass messageStructureJavaClass)

getShortNameFromElements

private String getShortNameFromElements(String shortName,
                                        com.thoughtworks.qdox.model.JavaClass messageStructureJavaClass)

getCoreConstants

private String getCoreConstants(String shortName)

addMessageStructure

private void addMessageStructure(com.thoughtworks.qdox.model.JavaClass messageStructureJavaClass,
                                 String serviceKey)

calcOverridden

private boolean calcOverridden(com.thoughtworks.qdox.model.JavaClass mainClass,
                               com.thoughtworks.qdox.model.JavaMethod getterMethod)

calcComment

private String calcComment(com.thoughtworks.qdox.model.JavaClass javaClass)

calcComment

private String calcComment(String comment)

calcVersion

private String calcVersion(com.thoughtworks.qdox.model.JavaClass javaClass)

calcVersion

private String calcVersion(String comment)

parseCommentVersion

private String[] parseCommentVersion(String commentVersion)

getAnnotation

private com.thoughtworks.qdox.model.Annotation getAnnotation(com.thoughtworks.qdox.model.JavaMethod getterMethod,
                                                             com.thoughtworks.qdox.model.JavaMethod setterMethod,
                                                             com.thoughtworks.qdox.model.JavaField beanField,
                                                             String type)

calcRequired

private String calcRequired(com.thoughtworks.qdox.model.JavaMethod getterMethod,
                            com.thoughtworks.qdox.model.JavaMethod setterMethod,
                            com.thoughtworks.qdox.model.JavaField beanField)

calcReadOnly

private String calcReadOnly(com.thoughtworks.qdox.model.JavaMethod getterMethod,
                            com.thoughtworks.qdox.model.JavaMethod setterMethod,
                            com.thoughtworks.qdox.model.JavaField beanField)

calcImplementationNotes

private String calcImplementationNotes(com.thoughtworks.qdox.model.JavaMethod getterMethod,
                                       com.thoughtworks.qdox.model.JavaMethod setterMethod,
                                       com.thoughtworks.qdox.model.JavaField beanField)

calcNameFromShortName

private String calcNameFromShortName(String shortName)

calcName

private String calcName(com.thoughtworks.qdox.model.JavaClass mainClass,
                        com.thoughtworks.qdox.model.JavaMethod getterMethod,
                        com.thoughtworks.qdox.model.JavaMethod setterMethod,
                        com.thoughtworks.qdox.model.JavaField beanField,
                        String shortName)

calcNameFromTag

private String calcNameFromTag(com.thoughtworks.qdox.model.JavaMethod getterMethod,
                               com.thoughtworks.qdox.model.JavaMethod setterMethod,
                               com.thoughtworks.qdox.model.JavaField beanField)

calcNameFromNameEmbeddedInDescription

private String calcNameFromNameEmbeddedInDescription(com.thoughtworks.qdox.model.JavaClass mainClass,
                                                     com.thoughtworks.qdox.model.JavaMethod getterMethod,
                                                     com.thoughtworks.qdox.model.JavaMethod setterMethod,
                                                     com.thoughtworks.qdox.model.JavaField beanField)

parseNameDesc

private String[] parseNameDesc(String nameDesc)

calcDescription

private String calcDescription(com.thoughtworks.qdox.model.JavaClass mainClass,
                               com.thoughtworks.qdox.model.JavaMethod getterMethod,
                               com.thoughtworks.qdox.model.JavaMethod setterMethod,
                               com.thoughtworks.qdox.model.JavaField beanField)

calcMethodComment

private String calcMethodComment(com.thoughtworks.qdox.model.JavaClass mainClass,
                                 com.thoughtworks.qdox.model.JavaMethod getterMethod,
                                 com.thoughtworks.qdox.model.JavaMethod setterMethod,
                                 com.thoughtworks.qdox.model.JavaField beanField)

calcMethodCommentRecursively

private String calcMethodCommentRecursively(com.thoughtworks.qdox.model.JavaClass mainClass,
                                            com.thoughtworks.qdox.model.JavaMethod method)

findSuperMethod

private com.thoughtworks.qdox.model.JavaMethod findSuperMethod(com.thoughtworks.qdox.model.JavaMethod method)

findInterfaceMethod

private com.thoughtworks.qdox.model.JavaMethod findInterfaceMethod(com.thoughtworks.qdox.model.JavaClass mainClass,
                                                                   com.thoughtworks.qdox.model.JavaMethod method)

findMethodOnInterfaceRecursively

private com.thoughtworks.qdox.model.JavaMethod findMethodOnInterfaceRecursively(com.thoughtworks.qdox.model.JavaClass infcClass,
                                                                                String callSig)

isCommentNotEmpty

private boolean isCommentNotEmpty(String desc)

getAccessorType

private String getAccessorType(com.thoughtworks.qdox.model.JavaMethod method)

getAccessorType

private String getAccessorType(com.thoughtworks.qdox.model.Annotation[] annotations)

stripQuotes

private String stripQuotes(String str)

calcMissing

private String calcMissing(String str)

addServiceToList

private void addServiceToList(XmlType xmlType,
                              String serviceKey)

calcXmlAttribute

private String calcXmlAttribute(com.thoughtworks.qdox.model.JavaField beanField)

findField

private com.thoughtworks.qdox.model.JavaField findField(com.thoughtworks.qdox.model.JavaClass javaClass,
                                                        String shortName,
                                                        com.thoughtworks.qdox.model.JavaMethod setterMethod)

findField

private com.thoughtworks.qdox.model.JavaField findField(com.thoughtworks.qdox.model.JavaClass javaClass,
                                                        String name)

findGetterMethod

private com.thoughtworks.qdox.model.JavaMethod findGetterMethod(com.thoughtworks.qdox.model.JavaClass msClass,
                                                                String shortName)

findSetterMethod

private com.thoughtworks.qdox.model.JavaMethod findSetterMethod(com.thoughtworks.qdox.model.JavaClass msClass,
                                                                String shortName)

isSetterMethodToProcess

private boolean isSetterMethodToProcess(com.thoughtworks.qdox.model.JavaMethod method,
                                        String className)

isGetterMethodToProcess

private boolean isGetterMethodToProcess(com.thoughtworks.qdox.model.JavaMethod method,
                                        String className)

calcShortNameFromSetter

private String calcShortNameFromSetter(com.thoughtworks.qdox.model.JavaMethod method)

calcShortNameFromGetter

private String calcShortNameFromGetter(com.thoughtworks.qdox.model.JavaMethod method)

calcCardinality

private String calcCardinality(com.thoughtworks.qdox.model.JavaClass mainClass,
                               com.thoughtworks.qdox.model.JavaMethod getterMethod,
                               com.thoughtworks.qdox.model.JavaMethod setterMethod,
                               com.thoughtworks.qdox.model.JavaField beanField,
                               String shortName)

isReturnACollection

private boolean isReturnACollection(com.thoughtworks.qdox.model.JavaClass mainClass,
                                    com.thoughtworks.qdox.model.JavaMethod getterMethod,
                                    com.thoughtworks.qdox.model.JavaMethod setterMethod,
                                    com.thoughtworks.qdox.model.JavaField beanField,
                                    String shortName)

isCollection

private boolean isCollection(com.thoughtworks.qdox.model.Type type)

isCollection

private boolean isCollection(com.thoughtworks.qdox.model.JavaClass javaClass)

calcType

private String calcType(com.thoughtworks.qdox.model.JavaClass mainClass,
                        com.thoughtworks.qdox.model.JavaMethod getterMethod,
                        com.thoughtworks.qdox.model.JavaMethod setterMethod,
                        com.thoughtworks.qdox.model.JavaField beanField,
                        String shortName)

calcTypeOfGetterMethodReturn

private String calcTypeOfGetterMethodReturn(com.thoughtworks.qdox.model.JavaMethod getterMethod)

calcTypeOfSetterMethodFirstParam

private String calcTypeOfSetterMethodFirstParam(com.thoughtworks.qdox.model.JavaMethod setterMethod)

calcType

private String calcType(com.thoughtworks.qdox.model.JavaParameter parameter)

calcType

private String calcType(com.thoughtworks.qdox.model.Type type)

calcType

private String calcType(com.thoughtworks.qdox.model.JavaClass javaClass)

calcRealJavaClassOfGetterReturn

private com.thoughtworks.qdox.model.JavaClass calcRealJavaClassOfGetterReturn(com.thoughtworks.qdox.model.JavaMethod getterMethod)

calcRealJavaClassOfSetterFirstParam

private com.thoughtworks.qdox.model.JavaClass calcRealJavaClassOfSetterFirstParam(com.thoughtworks.qdox.model.JavaMethod setterMethod)

calcRealJavaClass

private com.thoughtworks.qdox.model.JavaClass calcRealJavaClass(com.thoughtworks.qdox.model.JavaParameter param)

calcRealJavaClass

private com.thoughtworks.qdox.model.JavaClass calcRealJavaClass(com.thoughtworks.qdox.model.Type type)

isComplex

private boolean isComplex(com.thoughtworks.qdox.model.JavaClass javaClass)


Copyright © 2007-2012 The Kuali Foundation. All Rights Reserved.