org.argouml.uml
Class ProfileJava

java.lang.Object
  extended byorg.argouml.uml.Profile
      extended byorg.argouml.uml.ProfileJava

public class ProfileJava
extends Profile

This class implements the abstract class Profile for use in modelling Java language projects. Eventually, this class may be replaced by a configurable profile. TODO: (MVW) I see only little Java specific stuff here. Most of this should be moved to a ProfileUML.java file, which should be used by default. TODO: (MVW) Document the use of "argo.defaultModel" in the argo.user.properties file.


Field Summary
private  Object defaultModel
           
private static ProfileJava instance
           
private static Logger LOG
           
 
Constructor Summary
private ProfileJava()
           
 
Method Summary
private  void buildPath(StringBuffer buffer, Object element, String pathSep)
           
protected  String defaultAssocEndName(Object assocEnd, Object namespace)
           
protected  String defaultAssocName(Object assoc, Object ns)
          This function creates a default association name from its ends.
protected  String defaultGeneralizationName(Object gen, Object namespace)
           
protected  String defaultName(Object element, Object namespace)
           
 String formatCollection(Iterator iter, Object namespace)
          This method produces a string the represents the collection of model elements in the context of the specified namespace.
 String formatElement(Object element, Object namespace)
          This method produces a string that represents the specific model element in the context of the specified namespace.
protected  String getElementSeparator()
           
protected  String getEmptyCollection()
           
static ProfileJava getInstance()
           
protected  String getPathSeparator()
           
 Object getProfileModel()
           
static Object loadProfileModel()
          This function loads the model object containing the default model from either property "argo.defaultModel", or "/org/argouml/default.xmi".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG

instance

private static ProfileJava instance

defaultModel

private Object defaultModel
Constructor Detail

ProfileJava

private ProfileJava()
Method Detail

getInstance

public static ProfileJava getInstance()
Returns:
the instance of this class

formatElement

public String formatElement(Object element,
                            Object namespace)
Description copied from class: Profile
This method produces a string that represents the specific model element in the context of the specified namespace.

Specified by:
formatElement in class Profile
Parameters:
element - element to represent.
namespace - context namespace (may be null).
Returns:
a string representing the model element
See Also:
Profile.formatElement(java.lang.Object, java.lang.Object)

defaultAssocEndName

protected String defaultAssocEndName(Object assocEnd,
                                     Object namespace)
Parameters:
assocEnd - the given association end name
namespace - the namespace
Returns:
the default name for the given associationend

defaultAssocName

protected String defaultAssocName(Object assoc,
                                  Object ns)
This function creates a default association name from its ends.

Parameters:
assoc - the given association
ns - the namespace
Returns:
the default association name

defaultGeneralizationName

protected String defaultGeneralizationName(Object gen,
                                           Object namespace)
Parameters:
gen - the given Generalization
namespace - the namespace
Returns:
the default generalization name

defaultName

protected String defaultName(Object element,
                             Object namespace)
Parameters:
element - the given modelelement
namespace - the namespace
Returns:
a default name for this modelelement

getPathSeparator

protected String getPathSeparator()
Returns:
the path separator (currently ".")

buildPath

private void buildPath(StringBuffer buffer,
                       Object element,
                       String pathSep)
Parameters:
buffer - (out) the buffer that will contain the path build
element - the given modelelement
pathSep - the path separator character(s)

getElementSeparator

protected String getElementSeparator()
Returns:
the string that separates elements

getEmptyCollection

protected String getEmptyCollection()
Returns:
the string that represents an empty collection

formatCollection

public String formatCollection(Iterator iter,
                               Object namespace)
Description copied from class: Profile
This method produces a string the represents the collection of model elements in the context of the specified namespace.

Specified by:
formatCollection in class Profile
Parameters:
iter - iterator over collection
namespace - context namespace (may be null).
Returns:
a string representing the collection
See Also:
Profile.formatCollection(java.util.Iterator, java.lang.Object)

getProfileModel

public Object getProfileModel()
Specified by:
getProfileModel in class Profile
Returns:
the UML Model that contains the profile model
See Also:
Profile.getProfileModel()

loadProfileModel

public static Object loadProfileModel()
This function loads the model object containing the default model from either property "argo.defaultModel", or "/org/argouml/default.xmi". May result in null, if the files are not found.

Returns:
the model object


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook