StarUML的Java扩展
This extension for StarUML(http://staruml.io) support to generate Java code from UML model and to reverse Java code to UML model. Install this extension from Extension Manager of StarUML.
This extensions do not provide perfect reverse engineering which is a test and temporal feature. If you need a complete reverse engineering feature, please check other professional reverse engineering tools.
This extension is based on Java 1.7 Specification.
Tools > Java > Generate Code...
)Belows are the rules to convert from UML model elements to Java source codes.
.java
file)visibility
to one of modifiers public
, protected
, private
and none.isAbstract
property to abstract
modifier.isFinalSpecialization
and isLeaf
property to final
modifier.visibility
property to one of modifiers public
, protected
, private
and none.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.defaultValue
property to initial value.visibility
property to one of modifiers public
, protected
, private
and none.name
property to method identifier.isAbstract
property to abstract
modifier.isStatic
property to static
modifier.direction
= return
to return type of method. When no return parameter, void
is used.isReadOnly
= true
to final
modifier of parameter..java
file)visibility
property to one of modifiers public
, protected
, private
and none..java
file)visibility
property to one of modifiers public
, protected
, private
and none.visibility
property to one of modifiers public
, protected
, private
and none.name
property to field identifier.type
property to field type.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.extends
).implements
).Tools > Java > Reverse Code...
)JavaReverse
model will be created in the Project.Belows are the rules to convert from Java source code to UML model elements.
name
property.public
, protected
and private
to visibility
property.abstract
modifier to isAbstract
property.final
modifier to isLeaf
property.<<constructor>>
.Field type to type
property.
type
property has the primitive type name as string.T[]
(array), java.util.List<T>
, java.util.Set<T>
or its decendants: type
property refers to T
with multiplicity *
.T
(User-Defined Types) : type
property refers to the T
type.type
property has the type name as string.Access modifier public
, protected
and private
to visibility
property.
static
modifier to isStatic
property.final
modifier to isLeaf
and isReadOnly
property.transient
modifier to a Tag with name="transient"
and checked=true
.volatile
modifier to a Tag with name="volatile"
and checked=true
.defaultValue
property.Field type to end2.reference
property.
T[]
(array), java.util.List<T>
, java.util.Set<T>
or its decendants: reference
property refers to T
with multiplicity *
.T
(User-Defined Types) : reference
property refers to the T
type.Access modifier public
, protected
and private
to visibility
property.
public
, protected
and private
to visibility
property.static
modifier to isStatic
property.abstract
modifier to isAbstract
property.final
modifier to isLeaf
property.synchronized
modifier to concurrency="concurrent"
property.native
modifier to a Tag with name="native"
and checked=true
.strictfp
modifier to a Tag with name="strictfp"
and checked=true
.throws
clauses to raisedExceptions
property.name
property.public
, protected
and private
to visibility
property.name
property.public
, protected
and private
to visibility
property.<<annotationType>>
.name="default"
).Licensed under the MIT license (see LICENSE file).