Package cruise.umple.compiler
Class UmpleGenerator
java.lang.Object
cruise.umple.compiler.CodeGeneratorWithSubptions
cruise.umple.compiler.SuperCodeGenerator
cruise.umple.compiler.UmpleGenerator
- All Implemented Interfaces:
CodeGenerator
,CodeTranslator
- Direct Known Subclasses:
Scope
public class UmpleGenerator extends SuperCodeGenerator implements CodeTranslator
-
Field Summary
Fields inherited from class cruise.umple.compiler.SuperCodeGenerator
ConstraintLookupMap, TraceLookupMap, UmpleToPrimitiveMap
-
Constructor Summary
Constructors Constructor Description UmpleGenerator()
-
Method Summary
Modifier and Type Method Description void
delete()
void
generate()
Implementation of SuperCodeGenerator (CodeGenerator)void
getCode(UmpleModel model, UmpleElement uElement)
Generate code for the input model and element.ILang
getLanguageFor(UmpleElement aElement)
void
initializeLangaugeBasedVariables()
boolean
isNullable(UmpleVariable av)
java.lang.String
nameOf(java.lang.String name, boolean hasMultiple)
protected java.lang.String
pad(java.lang.String input, cruise.umple.compiler.UmpleGenerator.RuleName ruleName, java.lang.Object uContainer)
Pad token value with whitespace - Note: This is implementation allows whitespace to be easily configurable to address different coding practices/languages.protected java.lang.String
pad(java.lang.String input, cruise.umple.compiler.UmpleGenerator.RuleTokenType ruleTokenType)
Padding for token types, as generated by the RuleBasedProcessor Note: Protected so that space-delimited languages can override.protected java.lang.String
pad_l(cruise.umple.compiler.UmpleGenerator.RuleName ruleName)
protected java.lang.String
pad_r(cruise.umple.compiler.UmpleGenerator.RuleName ruleName)
void
prepare()
End of CodeTranslator implementation.java.lang.String
relatedTranslate(java.lang.String name, AssociationVariable av)
java.lang.String
translate(java.lang.String methodType)
java.lang.String
translate(java.lang.String id, Activity a)
java.lang.String
translate(java.lang.String id, AssociationVariable aVar)
java.lang.String
translate(java.lang.String id, Attribute attribute)
Implementation of CodeTranslator.java.lang.String
translate(java.lang.String id, ConstraintTree constraint)
java.lang.String
translate(java.lang.String id, Event e)
java.lang.String
translate(java.lang.String keyName, State state)
java.lang.String
translate(java.lang.String id, StateMachine stm)
java.lang.String
translate(java.lang.String id, TraceItem traceItem)
java.lang.String
translate(java.lang.String keyName, UmpleClass aClass0)
java.lang.String
translate(java.lang.String name, UmpleInterface aInterface)
static java.lang.String
typeOf(java.lang.String aType)
Methods inherited from class cruise.umple.compiler.SuperCodeGenerator
getConstraintWithinConstructor, getDontDisplayNextAccessor, getModel, getOutput, getParameterConstraintName, getType, isConstraintWithinConstructor, isDontDisplayNextAccessor, postpare, prepareConstraint, prepareConstraints, setConstraintWithinConstructor, setDontDisplayNextAccessor, setModel, setOutput, setParameterConstraintName, toString, translate, umpleCVarToLanguagePrimitive
Methods inherited from class cruise.umple.compiler.CodeGeneratorWithSubptions
addSuboption, getSuboption, getSuboptions, getSuboptionValue, hasSuboption, hasSuboptions, indexOfSuboption, numberOfSuboptions, removeSuboption, setSuboption
-
Constructor Details
-
UmpleGenerator
public UmpleGenerator()
-
-
Method Details
-
delete
public void delete()- Overrides:
delete
in classSuperCodeGenerator
-
translate
Implementation of CodeTranslator. The following methods are not used, but are present so that the module can share the same superclasses as other generators/translators.- Specified by:
translate
in interfaceCodeTranslator
-
translate
- Specified by:
translate
in interfaceCodeTranslator
-
translate
- Specified by:
translate
in interfaceCodeTranslator
-
translate
- Specified by:
translate
in interfaceCodeTranslator
-
translate
- Specified by:
translate
in interfaceCodeTranslator
-
translate
- Specified by:
translate
in interfaceCodeTranslator
- Overrides:
translate
in classSuperCodeGenerator
-
translate
- Specified by:
translate
in interfaceCodeTranslator
- Overrides:
translate
in classSuperCodeGenerator
-
translate
-
translate
public java.lang.String translate(java.lang.String methodType) -
translate
-
relatedTranslate
-
isNullable
-
nameOf
public java.lang.String nameOf(java.lang.String name, boolean hasMultiple) -
getLanguageFor
-
typeOf
public static java.lang.String typeOf(java.lang.String aType) -
initializeLangaugeBasedVariables
public void initializeLangaugeBasedVariables()- Specified by:
initializeLangaugeBasedVariables
in classSuperCodeGenerator
-
prepare
public void prepare()End of CodeTranslator implementation. prepare: Setup for code generation- Specified by:
prepare
in interfaceCodeGenerator
- Overrides:
prepare
in classCodeGeneratorWithSubptions
-
generate
public void generate()Implementation of SuperCodeGenerator (CodeGenerator)- Specified by:
generate
in interfaceCodeGenerator
- Overrides:
generate
in classCodeGeneratorWithSubptions
-
getCode
Generate code for the input model and element. -
pad
protected java.lang.String pad(java.lang.String input, cruise.umple.compiler.UmpleGenerator.RuleName ruleName, java.lang.Object uContainer)Pad token value with whitespace - Note: This is implementation allows whitespace to be easily configurable to address different coding practices/languages. - Note: Protected so that space-delimited languages can override. -
pad
protected java.lang.String pad(java.lang.String input, cruise.umple.compiler.UmpleGenerator.RuleTokenType ruleTokenType)Padding for token types, as generated by the RuleBasedProcessor Note: Protected so that space-delimited languages can override. -
pad_l
protected java.lang.String pad_l(cruise.umple.compiler.UmpleGenerator.RuleName ruleName) -
pad_r
protected java.lang.String pad_r(cruise.umple.compiler.UmpleGenerator.RuleName ruleName) -
translate
- Specified by:
translate
in interfaceCodeTranslator
-