public class UMLMetafacadeUtils extends Object
Constructor and Description |
---|
UMLMetafacadeUtils() |
Modifier and Type | Method and Description |
---|---|
String |
createConstructor(ModelElementFacade facade)
Supplies a result for type =
|
String |
createConstructor(ModelElementFacade facade,
boolean useMany)
Supplies a result for type =
|
String |
createConstructor(ModelElementFacade facade,
boolean useMany,
ModelElementFacade parent)
Supplies a result for type =
|
static String |
getClassDeclaration(ModelElementFacade facade,
boolean enableTemplating)
Get the classname without the package name and without additional template<> parameters.
|
static String |
getClassDeclaration(ModelElementFacade facade,
String className,
boolean enableTemplating)
Get the classname without the package name and without additional template<> parameters.
|
static String |
getDate()
Returns the current Date in the specified format.
|
static String |
getDate(String format)
Returns the current Date in the specified format.
|
static String |
getFQNameWithoutTemplate(ModelElementFacade facade)
Get the fully-qualified classname without the additional template<> parameters.
|
static String |
getGenericTemplate(ModelElementFacade facade,
boolean enableTemplating)
Get the generic template, ?> declaration.
|
static String |
getGetterPrefix(ClassifierFacade type)
Gets the getter prefix for a getter operation given the
type . |
static String |
getGetterPrefix(ClassifierFacade type,
int lowerBound)
Gets the getter prefix for a getter operation given the
type ,
taking multiplicity into account for booleans |
static String |
getImplCollection(String input)
Transforms the declared type to implementation type for a declared Collection.
|
static boolean |
isConstraintKind(String expression,
String kind)
Returns true if the passed in constraint
expression is of type kind , false otherwise. |
static boolean |
isOwningEnd(AssociationEndFacade associationEnd)
TODO Reference this logic from AssociationEnd
Determine if this association end owns the relationship.
|
static boolean |
isReservedWord(String name)
Returns true if the value is a reserved keyword in Java or C#, or cannot be used as a name
|
static boolean |
isType(ClassifierFacade classifier,
String typeName)
Returns true or false depending on whether or not this Classifier or any of its specializations is of the given
type having the specified
typeName |
static boolean |
shouldOutput(ModelElementFacade mef)
Determines if the class/package should be generated.
|
static boolean |
shouldOutput(ModelElementFacade mef,
String outletFile,
boolean refOutput)
Returns the number of methods without stereotypes or with SimpleClass stereotype.
|
public UMLMetafacadeUtils()
public static boolean isType(ClassifierFacade classifier, String typeName)
typeName
classifier
- typeName
- the name of the type (i.e. datatype::Collection)public static boolean isReservedWord(String name)
name
- the String to check if a keywordpublic static String getGetterPrefix(ClassifierFacade type)
type
.type
- the type from which to determine the prefix.public static String getGetterPrefix(ClassifierFacade type, int lowerBound)
type
,
taking multiplicity into account for booleanstype
- the type from which to determine the prefix.lowerBound
- If > 0 then type is not optional, thus primitive isBoolean()public static boolean isConstraintKind(String expression, String kind)
expression
is of type kind
, false otherwise.expression
- the expression to check.kind
- the constraint kind (i.e. inv,pre, body, etc).public static String getImplCollection(String input)
input
- the declared Collection type to be transformed into an implementation typepublic static boolean shouldOutput(ModelElementFacade mef)
mef
- ModelElementFacade class to check for stereotypes.public static String getClassDeclaration(ModelElementFacade facade, boolean enableTemplating)
facade
- enableTemplating
- public static String getClassDeclaration(ModelElementFacade facade, String className, boolean enableTemplating)
facade
- className
- Class name to use in the class declaration, overrides facade.getName()enableTemplating
- Whether template declaration should be created.public static String getGenericTemplate(ModelElementFacade facade, boolean enableTemplating)
facade
- enableTemplating
- public static String getFQNameWithoutTemplate(ModelElementFacade facade)
facade
- public static boolean shouldOutput(ModelElementFacade mef, String outletFile, boolean refOutput)
mef
- ModelElementFacade class to check for stereotypes.outletFile
- Name of output file currently being processed. How do we get this in template?refOutput
- Should .ref files be output?public String createConstructor(ModelElementFacade facade)
facade
- Type to create default object forpublic String createConstructor(ModelElementFacade facade, boolean useMany)
facade
- Type to create default object foruseMany
- Return constructor with multiplicity type instead of underlying typepublic String createConstructor(ModelElementFacade facade, boolean useMany, ModelElementFacade parent)
facade
- Type to create default object foruseMany
- Return constructor with multiplicity type instead of underlying typeparent
- Object containing this facade, which may have an attribute named dependency to a different typepublic static boolean isOwningEnd(AssociationEndFacade associationEnd)
associationEnd
- the association endpublic static String getDate(String format)
format
- The format for the output dateCopyright © 2003–2014 AndroMDA.org. All rights reserved.