public class Factory extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
counter |
protected HashMap<String,Node> |
quid_map
Register created objects by the quid of the petal object
|
Modifier | Constructor and Description |
---|---|
protected |
Factory() |
Modifier and Type | Method and Description |
---|---|
void |
addAssociation(Class class1,
Role role1,
Class class2,
Role role2,
Class assoc_class)
Simply maps association to a newly generated class that maintains the
connections.
|
void |
addField(Class c,
Field field)
add a Field to the given class c
|
void |
addImplementedInterface(Class c,
Class super_class)
add implemented interfaces based on the petal equivalents
|
void |
addMethod(Class c,
Method m)
add a method to the given class
|
void |
addObject(String quid,
Node obj) |
void |
addRealizedClass(Class c,
Class super_class)
Alias for addImplementedInterface()
|
void |
addSuperClass(Class c,
Class super_class)
add the superclass based on the petal equivalents
|
void |
addUsedClass(Class c,
Class used_class,
UsesRelationship rel) |
Class |
createClass(Class clazz,
Package p)
create a Class based on the given petal Clazz
|
Class |
createClass(Class clazz,
String name,
Package pack,
String acc,
boolean is_interface)
create a Class
|
Field |
createField(ClassAttribute attr)
create a field based on a petal attribute
|
Field |
createField(ClassAttribute attr,
String name,
String type,
String acc,
String init)
create a field based on the given petal attribute
|
Method |
createMethod(Operation op)
create a method from the given operation
|
Method |
createMethod(Operation op,
String name,
String type,
String acc,
List params)
create a method
|
Package |
createPackage(ClassCategory category)
create a package for the given category
|
Parameter |
createParameter(Parameter p)
create a parameter base on a petal parameter
|
Parameter |
createParameter(String name,
String type)
create a parameter
|
Method[] |
createSetGetMethods(String name,
String type)
create the setter and getter methods
|
protected Dimension |
getCardinality(Role role)
get the cardinality for a given Role
|
protected String |
getClassName(Class clazz)
get the class name for the given clazz
|
static Factory |
getInstance() |
Node |
getObject(String quid) |
Collection<Node> |
getObjects()
get the objects
|
void |
removeObject(String quid) |
static void |
setInstance(Factory f) |
protected HashMap<String,Node> quid_map
protected int counter
public void removeObject(String quid)
public Collection<Node> getObjects()
public static Factory getInstance()
public static void setInstance(Factory f)
protected String getClassName(Class clazz)
clazz
- - the clazz to get the name forpublic Class createClass(Class clazz, String name, Package pack, String acc, boolean is_interface)
clazz
- name
- pack
- acc
- is_interface
- public Class createClass(Class clazz, Package p)
clazz
- p
- public Package createPackage(ClassCategory category)
category
- public Method createMethod(Operation op, String name, String type, String acc, List params)
op
- name
- type
- acc
- params
- public Method createMethod(Operation op)
op
- public Parameter createParameter(String name, String type)
name
- type
- public Parameter createParameter(Parameter p)
p
- public Field createField(ClassAttribute attr, String name, String type, String acc, String init)
attr
- name
- type
- acc
- init
- public Field createField(ClassAttribute attr)
attr
- public void addSuperClass(Class c, Class super_class)
c
- super_class
- public final void addImplementedInterface(Class c, Class super_class)
c
- super_class
- public void addRealizedClass(Class c, Class super_class)
public Method[] createSetGetMethods(String name, String type)
name
- type
- protected Dimension getCardinality(Role role)
role
- public void addAssociation(Class class1, Role role1, Class class2, Role role2, Class assoc_class)
public void addUsedClass(Class c, Class used_class, UsesRelationship rel)
public void addField(Class c, Field field)
c
- field
- Copyright © 2018 BITPlan GmbH. All rights reserved.