org.argouml.uml.reveng.java
Class Modeller

java.lang.Object
  extended byorg.argouml.uml.reveng.java.Modeller

public class Modeller
extends java.lang.Object

Modeller maps Java source code(parsed/recognised by ANTLR) to UML model elements, it applies some of the semantics in JSR26.


Field Summary
protected static org.apache.log4j.Category cat
           
 
Constructor Summary
Modeller(java.lang.Object model, DiagramInterface diagram, Import _import, boolean noAssociations, boolean arraysAsDatatype, java.lang.String fileName)
          Create a new modeller.
 
Method Summary
 void addAnonymousClass(java.lang.String type)
          Called from the parser when an anonymous inner class is found.
 void addAttribute(short modifiers, java.lang.String typeSpec, java.lang.String name, java.lang.String initializer, java.lang.String javadoc)
          Called from the parser when an attribute is found.
 void addBodyToOperation(java.lang.Object op, java.lang.String body)
          Called from the parser to add a method body to an operation.
 void addCall(java.lang.String method, java.lang.String obj)
           
 void addClass(java.lang.String name, short modifiers, java.lang.String superclassName, java.util.Vector interfaces, java.lang.String javadoc)
          Called from the parser when a class declaration is found.
 void addComponent()
          This is a mapping from a Java compilation Unit -> a UML component.
 void addImport(java.lang.String name)
          Called from the parser when an import clause is found.
 void addInterface(java.lang.String name, short modifiers, java.util.Vector interfaces, java.lang.String javadoc)
          Called from the parser when an interface declaration is found.
 java.lang.Object addOperation(short modifiers, java.lang.String returnType, java.lang.String name, java.util.Vector parameters, java.lang.String javadoc)
          Called from the parser when an operation is found.
 void addPackage(java.lang.String name)
          Called from the parser when a package clause is found.
 void popClassifier()
          Called from the parser when a classifier is completely parsed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cat

protected static org.apache.log4j.Category cat
Constructor Detail

Modeller

public Modeller(java.lang.Object model,
                DiagramInterface diagram,
                Import _import,
                boolean noAssociations,
                boolean arraysAsDatatype,
                java.lang.String fileName)
Create a new modeller.

Parameters:
model - The model to work with.
Method Detail

addComponent

public void addComponent()
This is a mapping from a Java compilation Unit -> a UML component. Classes are resident in a component. Imports are relationships between components and other classes / packages.

See JSR 26.


addPackage

public void addPackage(java.lang.String name)
Called from the parser when a package clause is found.

Parameters:
name - The name of the package.

addImport

public void addImport(java.lang.String name)
Called from the parser when an import clause is found.

Parameters:
name - The name of the import. Can end with a '*'.

addClass

public void addClass(java.lang.String name,
                     short modifiers,
                     java.lang.String superclassName,
                     java.util.Vector interfaces,
                     java.lang.String javadoc)
Called from the parser when a class declaration is found.

Parameters:
name - The name of the class.
modifiers - A sequence of class modifiers.
interfaces - Zero or more strings with the names of implemented interfaces. Can be fully qualified or just a simple interface name.
javadoc - The javadoc comment. null or "" if no comment available.

addAnonymousClass

public void addAnonymousClass(java.lang.String type)
Called from the parser when an anonymous inner class is found.

Parameters:
type - The type of this anonymous class.

addInterface

public void addInterface(java.lang.String name,
                         short modifiers,
                         java.util.Vector interfaces,
                         java.lang.String javadoc)
Called from the parser when an interface declaration is found.

Parameters:
name - The name of the interface.
modifiers - A sequence of interface modifiers.
interfaces - Zero or more strings with the names of extended interfaces. Can be fully qualified or just a simple interface name.
javadoc - The javadoc comment. "" if no comment available.

popClassifier

public void popClassifier()
Called from the parser when a classifier is completely parsed.


addOperation

public java.lang.Object addOperation(short modifiers,
                                     java.lang.String returnType,
                                     java.lang.String name,
                                     java.util.Vector parameters,
                                     java.lang.String javadoc)
Called from the parser when an operation is found.

Parameters:
modifiers - A sequence of operation modifiers.
returnType - The return type of the operation.
name - The name of the operation as a string
parameters - A number of vectors, each representing a parameter.
javadoc - The javadoc comment. null or "" if no comment available.
Returns:
The operation.

addBodyToOperation

public void addBodyToOperation(java.lang.Object op,
                               java.lang.String body)
Called from the parser to add a method body to an operation. (An operation will have exactly one Java body.)

Parameters:
op - An operation.
body - A method body.

addAttribute

public void addAttribute(short modifiers,
                         java.lang.String typeSpec,
                         java.lang.String name,
                         java.lang.String initializer,
                         java.lang.String javadoc)
Called from the parser when an attribute is found.

Parameters:
modifiers - A sequence of attribute modifiers.
typeSpec - The attribute's type.
initializer - The initial value of the attribute.
javadoc - The javadoc comment. null or "" if no comment available.

addCall

public void addCall(java.lang.String method,
                    java.lang.String obj)


ArgoUML © 1996-2003 (20040125)ArgoUML Project HomeArgoUML Cookbook