public String generate(Object argument) { final StringBuffer stringBuffer = new StringBuffer(); Property curProperty = (Property) argument; Package uml2Package = curProperty.getNearestPackage(); // String curPropertyGetAccessor=ModelHelper.getGetAccessor(curProperty); Class ownerClass = (Class) curProperty.getOwner(); // Property ownerClassIdProperty=EntityHelper.getIDProperty(ownerClass); // String ownerClassIdPropertyGetter=ClassHelper.getGetAccessor(ownerClassIdProperty); UmlClassByPropertyWrap named = new UmlClassByPropertyWrap(curProperty); Class uml2Class = ownerClass; stringBuffer.append(TEXT_1); List<Property> tabsList = ViewInputHelper.getTabsProperty(uml2Class); List<Property> contentTabPropertyList = ViewInputHelper.getViewInputContentTab(uml2Class); if (!tabsList.isEmpty() || !contentTabPropertyList.isEmpty()) { stringBuffer.append(TEXT_2); } stringBuffer.append(TEXT_3); Property idProperty = EntityHelper.getIDProperty(uml2Class); String idPropertyUncapSafeName = NameHelper.uncapSafeName(idProperty); List<Property> propertyList = new ArrayList<Property>(); List<Property> inputValidateList = ViewInputHelper.getInputPropertyForValidate(uml2Class); propertyList.addAll(inputValidateList); // List<Property> M2OSelectList=ViewInputHelper.getApplyM2OSelect(uml2Class); // List<Property> O2OSelectList=ViewInputHelper.getApplyO2OSelect(uml2Class); // List<Property> O2OSelectPageList=ViewInputHelper.getApplyO2OSelectPage(uml2Class); // List<Property> M2OSelectPageList=ViewInputHelper.getApplyM2OSelectPage(uml2Class); // propertyList.addAll(M2OSelectList); // propertyList.addAll(O2OSelectList); // propertyList.addAll(O2OSelectPageList); // propertyList.addAll(M2OSelectPageList); int count = 0; for (int i = 0; i < propertyList.size(); i++) { Property property = propertyList.get(i); if (ViewInputHelper.isViewInput_readonly(property)) { continue; } if (property.getName().equals(curProperty.getName())) { continue; } String jqueryValidate = PageHelper.getJqueryValidate(property); if (null != jqueryValidate) { String propertyCommentName = TypeHelper.getDocumentationOrName(property); if (!ClassHelper.isSimple(property) && null != jqueryValidate && !jqueryValidate.trim().equals("")) { // String propertySelectListKey=ViewInputHelper.getRelForListKey(property); Class propertyType = (Class) property.getType(); // String propertyTypeComment = TypeHelper.getDocumentationOrName(propertyType); Property propertyTypeIdProperty = EntityHelper.getIDProperty(propertyType); String propertyTypeIdPropertyUncapSafeName = NameHelper.uncapSafeName(propertyTypeIdProperty); stringBuffer.append(TEXT_4); if (count != 0) { stringBuffer.append(TEXT_5); } stringBuffer.append(TEXT_6); stringBuffer.append(NameHelper.getUncapName(property)); stringBuffer.append(TEXT_7); stringBuffer.append(propertyTypeIdPropertyUncapSafeName); stringBuffer.append(TEXT_8); stringBuffer.append(jqueryValidate); stringBuffer.append(TEXT_9); stringBuffer.append(++count); stringBuffer.append(TEXT_10); stringBuffer.append(propertyCommentName); stringBuffer.append(TEXT_11); } else { stringBuffer.append(TEXT_12); if (i != 0) { stringBuffer.append(TEXT_13); } stringBuffer.append(NameHelper.getUncapName(property)); stringBuffer.append(TEXT_14); stringBuffer.append(jqueryValidate); stringBuffer.append(TEXT_15); stringBuffer.append(++count); stringBuffer.append(TEXT_16); stringBuffer.append(propertyCommentName); } } stringBuffer.append(TEXT_17); } stringBuffer.append(TEXT_18); stringBuffer.append(named.getUrl(WebUrlName.saveOutJson)); stringBuffer.append(TEXT_19); List<Property> fileSimpleInputPropertyList = ViewInputHelper.getFileSimpleInputProperty(uml2Class); boolean firstLine = true; for (Iterator<Property> it = fileSimpleInputPropertyList.iterator(); it.hasNext(); ) { // process simpleProperty Property property = it.next(); // String propertyCommentName=TypeHelper.getDocumentationOrName(property); String propertyUncapSafeName = NameHelper.uncapSafeName(property); if (ClassHelper.isSimple(property)) { stringBuffer.append(TEXT_20); if (firstLine) { firstLine = false; } else { stringBuffer.append(TEXT_21); } stringBuffer.append(TEXT_22); stringBuffer.append(propertyUncapSafeName); stringBuffer.append(TEXT_23); stringBuffer.append(propertyUncapSafeName); stringBuffer.append(TEXT_24); } else if (ClassHelper.isOneToOne(property) || ClassHelper.isManyToOne(property)) { Type propertyType = property.getType(); Class propertyTypeClass = (Class) propertyType; // String relTargetClassCapName=NameHelper.getCapName(relTargetClass); // String relTargetClassUncapName=NameHelper.getUncapName(relTargetClass); // String relTargetClassCommentName=TypeHelper.getDocumentationOrName(propertyTypeClass); // String // relM2OAndO2OSelectPage=NamedUtil.getPropertyNamedUncap(propertyTypeClass,PropertyNamedRuleKind.relM2OAndO2OSelectPage); Property propertyTypeIdProperty = EntityHelper.getIDProperty(propertyTypeClass); String propertyTypeIdPropertyUncapSafeName = NameHelper.uncapSafeName(propertyTypeIdProperty); stringBuffer.append(TEXT_25); if (firstLine) { firstLine = false; } else { stringBuffer.append(TEXT_26); } stringBuffer.append(TEXT_27); stringBuffer.append(propertyUncapSafeName); stringBuffer.append(TEXT_28); stringBuffer.append(propertyTypeIdPropertyUncapSafeName); stringBuffer.append(TEXT_29); stringBuffer.append(propertyUncapSafeName); stringBuffer.append(TEXT_30); stringBuffer.append(propertyTypeIdPropertyUncapSafeName); stringBuffer.append(TEXT_31); } } stringBuffer.append(TEXT_32); stringBuffer.append(named.getUrl(WebUrlName.updateOutJson)); stringBuffer.append(TEXT_33); /** * *************************************************************** rel O2OSelectPage * M2OSelectPage /**************************************************************** */ List<Property> resultPropertyList = ViewInputHelper.getApplyM2OSelectPage(uml2Class); List<Property> m2oPropertyList = ViewListHelper.getViewListPropertiesFromM2o(uml2Class); List<Property> o2oPropertyList = ViewListHelper.getViewListPropertiesFromO2o(uml2Class); resultPropertyList.addAll(m2oPropertyList); resultPropertyList.addAll(o2oPropertyList); if (null != resultPropertyList && !resultPropertyList.isEmpty()) { for (Iterator<Property> iter = resultPropertyList.iterator(); iter.hasNext(); ) { Property property = iter.next(); if (property.getName().equals(curProperty.getName())) { continue; } String propertyUncapSafeName = NameHelper.uncapSafeName(property); Type propertyType = property.getType(); Class relTargetClass = (Class) propertyType; // String relTargetClassCapName=NameHelper.getCapName(relTargetClass); // String relTargetClassUncapName=NameHelper.getUncapName(relTargetClass); String relTargetClassCommentName = TypeHelper.getDocumentationOrName(relTargetClass); String relM2OAndO2OSelectPage = NamedUtil.getPropertyNamedUncap( relTargetClass, PropertyNamedRuleKind.relM2OAndO2OSelectPage); Property propertyTypeIdProperty = EntityHelper.getIDProperty(relTargetClass); String propertyTypeIdPropertyUncapSafeName = NameHelper.uncapSafeName(propertyTypeIdProperty); String listLabelPropertyUncapSafeName = ViewListHelper.getViewListLabelRelPropertyName(property); // String // listLabelPropertyComment=ViewListHelper.getViewListLabelRelPropertyComment(property); stringBuffer.append(TEXT_34); stringBuffer.append(relM2OAndO2OSelectPage); stringBuffer.append(TEXT_35); stringBuffer.append(relM2OAndO2OSelectPage); stringBuffer.append(TEXT_36); stringBuffer.append(relM2OAndO2OSelectPage); stringBuffer.append(TEXT_37); stringBuffer.append(relM2OAndO2OSelectPage); stringBuffer.append(TEXT_38); stringBuffer.append(relM2OAndO2OSelectPage); stringBuffer.append(TEXT_39); stringBuffer.append(relM2OAndO2OSelectPage); stringBuffer.append(TEXT_40); stringBuffer.append(relM2OAndO2OSelectPage); stringBuffer.append(TEXT_41); stringBuffer.append(relM2OAndO2OSelectPage); stringBuffer.append(TEXT_42); stringBuffer.append(relM2OAndO2OSelectPage); stringBuffer.append(TEXT_43); stringBuffer.append(relM2OAndO2OSelectPage); stringBuffer.append(TEXT_44); stringBuffer.append(relTargetClassCommentName); stringBuffer.append(TEXT_45); stringBuffer.append( MdaHelper.getModelUrlByRel( uml2Class, relTargetClass, WebUrlName.relM2OAndO2OSelectPage)); stringBuffer.append(TEXT_46); stringBuffer.append(relM2OAndO2OSelectPage); stringBuffer.append(TEXT_47); stringBuffer.append(relM2OAndO2OSelectPage); stringBuffer.append(TEXT_48); stringBuffer.append(propertyUncapSafeName); stringBuffer.append(TEXT_49); stringBuffer.append(propertyTypeIdPropertyUncapSafeName); stringBuffer.append(TEXT_50); stringBuffer.append(propertyUncapSafeName); stringBuffer.append(TEXT_51); stringBuffer.append(listLabelPropertyUncapSafeName); stringBuffer.append(TEXT_52); stringBuffer.append(relM2OAndO2OSelectPage); stringBuffer.append(TEXT_53); } } return stringBuffer.toString(); }