Permalink
Browse files

Generate AnnotationTypes and refactor some codes

  • Loading branch information...
1 parent ec55e2e commit 5bb2b532a9cd6edba52c1cc012a3c3348a760018 @niklauslee niklauslee committed Aug 12, 2014
View
Oops, something went wrong.
View
Oops, something went wrong.
View
@@ -0,0 +1,19 @@
+Copyright (c) 2014 MKLab. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
View
@@ -28,10 +28,10 @@ Belows are the rules to convert from UML model elements to Java source codes.
### UMLAttribute
-* converted to _Java Member Variable_.
+* converted to _Java Field_.
* `visibility` property to one of modifiers `public`, `protected`, `private` and none.
-* `name` property to member variable identifier.
-* `type` property to member variable type.
+* `name` property to field identifier.
+* `type` property to field type.
* `multiplicity` property to array type.
* `isStatic` property to `static` modifier.
* `isLeaf` property to `final` modifier.
@@ -66,10 +66,10 @@ Belows are the rules to convert from UML model elements to Java source codes.
### UMLAssociationEnd
-* converted to _Java Member Variable_.
+* converted to _Java Field_.
* `visibility` property to one of modifiers `public`, `protected`, `private` and none.
-* `name` property to member variable identifier.
-* `type` property to member variable type.
+* `name` property to field identifier.
+* `type` property to field type.
* If `multiplicity` is one of `0..*`, `1..*`, `*`, then collection type (`java.util.List<>` when `isOrdered` = `true` or `java.util.Set<>`) is used.
* `defaultValue` property to initial value.
* Documentation property to JavaDoc comment.
@@ -177,3 +177,8 @@ Belows are the rules to convert from Java source code to UML model elements.
* converted to _UMLClass_ with stereotype `<<annotationType>>`.
* Annotation type elements to _UMLOperation_. (Default value to a Tag with `name="default"`).
* JavaDoc comment to Documentation.
+
+
+---
+
+Licensed under the MIT license (see LICENSE file).
View
@@ -23,6 +23,7 @@
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50, regexp: true */
/*global define, $, _, window, staruml, type, appshell, document */
+
define(function (require, exports, module) {
"use strict";
@@ -53,7 +54,8 @@ define(function (require, exports, module) {
CMD_JAVA_CONFIGURE = 'java.configure';
/**
- * CommandManager.execute로부터 파라미터를 받아서 코드 생성 가능하게 한다.
+ * Command Handler for Java Generate
+ *
* @param {Element} base
* @param {string} path
* @param {Object} options
@@ -63,7 +65,7 @@ define(function (require, exports, module) {
var result = new $.Deferred();
// If options is not passed, get from preference
- options = (options ? options : JavaPreferences.getGenOptions());
+ options = options || JavaPreferences.getGenOptions();
// If base is not assigned, popup ElementPicker
if (!base) {
@@ -116,19 +118,15 @@ define(function (require, exports, module) {
}
/**
- * CommandManager.execute로부터 파라미터를 받아서 코드 역공학이 가능하게 한다.
- * e.g.) options = {
- * path: "/User/niklaus/...",
- * files: [ "....java", ".java" ],
- * typeHiarachy: true
- * packageOverview: true
- * packageStructure: true
- * }
- * 파라미터가 없으면 baseModel, targetDir을 사용한다.
- * Must return $.Promise
+ * Command Handler for Java Reverse
+ *
+ * @param {string} basePath
+ * @param {Object} options
+ * @return {$.Promise}
*/
function _handleReverse(basePath, options) {
var result = new $.Deferred();
+
// If options is not passed, get from preference
options = JavaPreferences.getRevOptions();
@@ -150,6 +148,10 @@ define(function (require, exports, module) {
return result.promise();
}
+
+ /**
+ * Popup PreferenceDialog with Java Preference Schema
+ */
function _handleConfigure() {
CommandManager.execute(Commands.FILE_PREFERENCES, JavaPreferences.getId());
}
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 5bb2b53

Please sign in to comment.