Package cruise.umple.compiler
Class RubyGenerator
java.lang.Object
cruise.umple.compiler.CodeGeneratorWithSubptions
cruise.umple.compiler.SuperCodeGenerator
cruise.umple.compiler.RubyGenerator
- All Implemented Interfaces:
CodeGenerator
,CodeTranslator
public class RubyGenerator extends SuperCodeGenerator implements CodeTranslator
-
Field Summary
Fields Modifier and Type Field Description JavaGenerator
jgen
Fields inherited from class cruise.umple.compiler.SuperCodeGenerator
ConstraintLookupMap, TraceLookupMap, UmpleToPrimitiveMap
-
Constructor Summary
Constructors Constructor Description RubyGenerator()
-
Method Summary
Modifier and Type Method Description void
delete()
void
generate()
Allows independent code generation tools Different generators will do different things regarding where the files are put, etc.java.util.List<CodeInjection>
getApplicableCodeInjections(UmpleClass uClass, java.lang.String injectType, java.lang.String methodDesc, AssociationVariable av)
java.util.List<CodeInjection>
getApplicableCodeInjections(UmpleClass uClass, java.lang.String injectType, java.lang.String methodDesc, Attribute av)
Retrieve the applicable injections with the Ruby naming convention and the typical Java naming conventionILang
getLanguageFor(UmpleElement aElement)
void
initializeLangaugeBasedVariables()
boolean
isNullable(UmpleVariable av)
java.lang.String
nameOf(AssociationVariable av)
java.lang.String
nameOf(Attribute av)
java.lang.String
nameOf(java.lang.String name, boolean hasMultiple)
void
prepare()
Allows independent code generation tools Different generators will do different things regarding where the files are put, etc.java.lang.String
relatedTranslate(java.lang.String name, AssociationVariable av)
java.lang.String
translate(java.lang.String keyName, Activity a)
java.lang.String
translate(java.lang.String keyName, AssociationVariable av)
java.lang.String
translate(java.lang.String keyName, Attribute av)
java.lang.String
translate(java.lang.String keyName, Event event)
java.lang.String
translate(java.lang.String keyName, State state)
java.lang.String
translate(java.lang.String keyName, StateMachine sm)
java.lang.String
translate(java.lang.String name, UmpleClass aClass)
java.lang.String
translate(java.lang.String name, UmpleInterface aInterface)
java.lang.String
translateInterfaceValue(java.lang.String value, java.lang.String type)
Translates Date and Time values, has to be used for interfaces as they do not use attributes.static java.lang.String
typeOf(java.lang.String aType)
java.lang.String
umpleCVarToLanguagePrimitive(java.lang.String name, ConstraintVariable expr)
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, translate, translate
Methods inherited from class cruise.umple.compiler.CodeGeneratorWithSubptions
addSuboption, getSuboption, getSuboptions, getSuboptionValue, hasSuboption, hasSuboptions, indexOfSuboption, numberOfSuboptions, removeSuboption, setSuboption
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface cruise.umple.compiler.CodeTranslator
translate, translate, translate
-
Field Details
-
Constructor Details
-
RubyGenerator
public RubyGenerator()
-
-
Method Details
-
delete
public void delete()- Overrides:
delete
in classSuperCodeGenerator
-
prepare
public void prepare()Description copied from class:CodeGeneratorWithSubptions
Allows independent code generation tools Different generators will do different things regarding where the files are put, etc.- Specified by:
prepare
in interfaceCodeGenerator
- Overrides:
prepare
in classCodeGeneratorWithSubptions
-
isNullable
-
relatedTranslate
-
getLanguageFor
-
umpleCVarToLanguagePrimitive
public java.lang.String umpleCVarToLanguagePrimitive(java.lang.String name, ConstraintVariable expr)- Overrides:
umpleCVarToLanguagePrimitive
in classSuperCodeGenerator
-
getApplicableCodeInjections
public java.util.List<CodeInjection> getApplicableCodeInjections(UmpleClass uClass, java.lang.String injectType, java.lang.String methodDesc, Attribute av)Retrieve the applicable injections with the Ruby naming convention and the typical Java naming convention -
getApplicableCodeInjections
public java.util.List<CodeInjection> getApplicableCodeInjections(UmpleClass uClass, java.lang.String injectType, java.lang.String methodDesc, AssociationVariable av) -
translate
-
translate
-
translate
- Specified by:
translate
in interfaceCodeTranslator
-
translate
- Specified by:
translate
in interfaceCodeTranslator
-
translateInterfaceValue
public java.lang.String translateInterfaceValue(java.lang.String value, java.lang.String type)Translates Date and Time values, has to be used for interfaces as they do not use attributes. -
translate
- Specified by:
translate
in interfaceCodeTranslator
-
translate
- Specified by:
translate
in interfaceCodeTranslator
-
translate
- Specified by:
translate
in interfaceCodeTranslator
-
translate
- Specified by:
translate
in interfaceCodeTranslator
-
generate
public void generate()Description copied from class:CodeGeneratorWithSubptions
Allows independent code generation tools Different generators will do different things regarding where the files are put, etc.- Specified by:
generate
in interfaceCodeGenerator
- Overrides:
generate
in classCodeGeneratorWithSubptions
-
nameOf
public java.lang.String nameOf(java.lang.String name, boolean hasMultiple) -
typeOf
public static java.lang.String typeOf(java.lang.String aType) -
nameOf
-
nameOf
-
initializeLangaugeBasedVariables
public void initializeLangaugeBasedVariables()- Specified by:
initializeLangaugeBasedVariables
in classSuperCodeGenerator
-