예제 #1
0
 private String getOperationType(UMLElement element, String typeId) throws ContractException {
   if ("List".equals(element.getName())) {
     String setId = JDHelper.getNewId();
     this.insertSet(setId, element.getName(), CommonElementsPackage.JAVAVOID);
     return setId;
   } else {
     String operationType = queryType(element.getName());
     if (operationType == null || "null".equals(operationType)) {
       operationType = typeId;
     }
     return operationType;
   }
 }
예제 #2
0
 private String getParameterType(UMLOperation operation, UMLElement parameter)
     throws ContractException {
   try {
     String parameterType = operation.getParameterType(parameter.getId());
     UMLElement pElement = (UMLElement) parser.getDataTypes().get(processID(parameterType));
     if (pElement != null) {
       // Eh um DataType
       if ("List".equals(pElement.getName())) {
         String setId = JDHelper.getNewId();
         this.insertSet(setId, pElement.getName(), CommonElementsPackage.JAVAVOID);
         parameterType = setId;
       } else {
         parameterType = queryType(pElement.getName());
         if (parameterType != null) {
           return parameterType;
         }
       }
     }
     return processID(operation.getParameterType(parameter.getId()));
   } catch (Exception ex) {
     throw new ContractException("Can't recover parameter type", ex);
   }
 }