protected void createAttribute( IClass clazz, Type type, MemberdefType memberdefType, IClass findClass, boolean isAssociation) throws InvalidEditingException { IAttribute attribute = null; boolean memberEnd = false; if (LanguageManager.PRIMITIVE_TYPE.contains(type.getNamespaceClass().clazz)) { attribute = this.basicModelEditor.createAttribute( clazz, type.getName(), type.getNamespaceClass().clazz); } else if (!isEmpty(type.getTemplates())) { attribute = this.basicModelEditor.createAttribute( clazz, type.getName(), astahModelUtil.clearNamespace(type.getTemplateParameter())); } else { if (findClass == null) { if (type.getNamespaceClass() != null && !isEmpty(type.getNamespaceClass().clazz)) { IPackage pkg = this.astahModelUtil.getModelWithPath( IPackage.class, project, type.getNamespaceClass().namespace); if (pkg == null) { pkg = project; } findClass = this.basicModelEditor.createClass(pkg, type.getNamespaceClass().clazz); if (isAssociation) { attribute = this.createAssosiation(clazz, type, findClass); memberEnd = true; } else { attribute = this.basicModelEditor.createAttribute(clazz, type.getName(), findClass); } } } else { if (isAssociation) { attribute = this.createAssosiation(clazz, type, findClass); memberEnd = true; } else { attribute = this.basicModelEditor.createAttribute(clazz, type.getName(), findClass); } } } if (attribute == null) { return; } this.setLanguage(CPLUS_ATTRIBUTE, attribute); // 属性のその他属性を作成 attribute.setStatic(type.isStatic()); attribute.setVisibility(type.getVisiblity()); attribute.setDefinition(this.parseDescription(memberdefType.getDetaileddescription())); if (!isEmpty(type.getTypeModifier())) { attribute.setTypeModifier(type.getTypeModifier()); } if (!memberEnd && type.isConst()) { this.createTaggedValue(attribute, "jude.c_plus.const", "true"); } if (!memberEnd && type.isVolatile()) { this.createTaggedValue(attribute, "jude.c_plus.volatile", "true"); } if (!memberEnd && type.isMutable()) { this.createTaggedValue(attribute, "jude.c_plus.mutable", "true"); } }
protected void createParameter(IOperation operation, List<ParamType> params) throws InvalidEditingException, ProjectNotFoundException { for (ParamType param : params) { IParameter parameter = null; Type type = this.typeUtil.createMemberParamType(param); if (LanguageManager.PRIMITIVE_TYPE.contains(type.getNamespaceClass().clazz)) { parameter = createParameter( this.basicModelEditor, operation, type.getName(), type.getNamespaceClass().clazz); } else if (!isEmpty(type.getTemplates())) { parameter = createParameter( this.basicModelEditor, operation, type.getName(), astahModelUtil.clearNamespace(type.getTemplateParameter())); } else { IClass findClass = this.findClass(type); if (findClass == null) { if (type.getNamespaceClass() != null && !isEmpty(type.getNamespaceClass().clazz)) { parameter = createParameter( this.basicModelEditor, operation, type.getName(), type.getNamespaceClass().clazz); } } else { parameter = createParameter(this.basicModelEditor, operation, type.getName(), findClass); } } if (parameter != null) { this.setLanguage(CPLUS_PARAMETER, parameter); parameter.setTypeModifier(type.getTypeModifier()); } } }