|
|
(9 intermediate revisions by the same user not shown) |
Line 16: |
Line 16: |
| import java.util.Vector; | | import java.util.Vector; |
| ▼… | | ▼… |
| ▲…
| | ⊏ signature(String code, Map<String,String> page_properties, |
| public Vector<String> getStatesInRegion(String expression, String region) {
| | Map<String,String> predefined_arguments, |
| Vector<String> result = new Vector<String>();
| | Map<String,String> conversion_arguments, |
| for (String term : expression.split("\\\u007C\\\u007C")) {
| | Map<String,String> request_arguments) ⊐… |
| String[] t = term.split("=");
| | « boolean complete_xml = "true".equals(predefined_arguments.get("CompleteXMLDocument")); |
| if (t.length > 1) {
| | String xmlns = complete_xml ? " xmlns=\"http://xmlns.sphenon.com/org/ooem\"" : ""; |
| if (t[0].equals(region)) { result.add(t[1]); }
| | String indent = complete_xml ? "" : " "; |
| } else {
| |
| if ("main".equals(region)) { result.add(t[0]); }
| |
| }
| |
| }
| |
| return result;
| |
| }
| |
| ▲…
| |
| ⊏ signature(String wiml_code, Map<String,String> predefined_arguments,
| |
| Map<String,String> conversion_arguments,
| |
| Map<String,String> request_arguments) ⊐…
| |
| « WIMLClass wc; try { wc = WIMLClass.parseWIML(wiml_code); object = wc; | |
| boolean has_associations = false;
| |
| if (wc == null) {
| |
| throw new org.oomodels.OOMStatusCode(204);
| |
| } else {
| |
| boolean complete_xml = "true".equals(predefined_arguments.get("CompleteXMLDocument"));
| |
| String xmlns = complete_xml ? " xmlns=\"http://xmlns.sphenon.com/org/ooem\"" : "";
| |
| String indent = complete_xml ? "" : " ";
| |
| »… | | »… |
| «if(complete_xml) {»… | | «if(complete_xml) {»… |
Line 46: |
Line 28: |
| «}»… | | «}»… |
| «¶(indent)»… | | «¶(indent)»… |
| <Class> | | <Alias> |
| | ⋮« for (String key : page_properties.keySet()) { »… |
| | ⋮« if (key.matches(".*Type")) { »… |
| | <ExternalImport>◂page_properties.get(key)▸</ExternalImport> |
| | ⋮« } »… |
| | ⋮« } »… |
| <Name>◂conversion_arguments.get("page").replaceFirst("Artefact:Model/","").replace("/",".")▸</Name> | | <Name>◂conversion_arguments.get("page").replaceFirst("Artefact:Model/","").replace("/",".")▸</Name> |
| ⋮«∀(‖"Ⓟ/ModelTemplateArguments"){»…
| | ⋮« for (String key : page_properties.keySet()) { »… |
| <TemplateParameter Name="◂‖"Ⓟ/Name"▸" «∃(‖"Ⓟ/DefaultValue"){»DefaultValue="◂((String)(⊙)).replace("/",".")▸" «}/∃»GenericLevel="MODEL_TEMPLATE"/>
| | ⋮« if (key.matches(".*Type")) { »… |
| ⋮«}/∀»… | | <AliasMapping Language="◂key.substring(0, key.length()-4)▸" Type="◂page_properties.get(key)▸"/> |
| ⋮«∀(‖"Ⓟ/CodeGeneratorTemplateArguments"){»…
| | ⋮« } »… |
| <TemplateParameter Name="◂‖"Ⓟ/Name"▸" «∃(‖"Ⓟ/DefaultValue"){»DefaultValue="◂((String)(⊙)).replace("/",".")▸" «}/∃»GenericLevel="CODE_GENERATOR_TEMPLATE"/>
| | ⋮« } »… |
| ⋮«}/∀»…
| | </Alias> |
| ⋮«∀(‖"Ⓟ/ImplementationLanguageTemplateArguments"){»…
| |
| <TemplateParameter Name="◂‖"Ⓟ/Name"▸" «∃(‖"Ⓟ/DefaultValue"){»DefaultValue="◂((String)(⊙)).replace("/",".")▸" «}/∃»GenericLevel="IMPLEMENTATION_LANGUAGE_TEMPLATE"/>
| |
| ⋮«}/∀»…
| |
| ⋮«∀(‖"Ⓟ/Bases"){»…
| |
| <Base Parent="◂((String)(⊙)).replace("/",".")▸"/>
| |
| ⋮«}/∀»…
| |
| ⋮«¬∅(‖"Ⓟ/Stereotypes"){»«∀(⊙){»…
| |
| <StereotypeName>◂⊙▸</StereotypeName>
| |
| ⋮«}/∀»«}/¬∅»…
| |
| ⋮« ⇾(⊙,WIMLStateMachine) {»…
| |
| <StateMachine Name="TopLevel" PASS="2" TypeName="TopLevel">
| |
| ⋮«¬∅(‖"Ⓟ/States"){»…
| |
| ⋮«java.util.HashSet names = new java.util.HashSet(); ∀(⊙){ String name = ‖<String>"Ⓟ/1"; names.add(name); }/∀ »…
| |
| ⋮«∀(-name:names){»…
| |
| <Region Name="◂name▸">
| |
| ⋮«∀(⊙){»…
| |
| ⋮«if(name.equals((String) (‖"Ⓟ/1"))){»…
| |
| <State Name="◂‖"Ⓟ/0"▸" OID="S_◂name▸_◂‖"Ⓟ/0"▸" TypeName="«∃(‖"Ⓟ/2"){»◂⊙▸«}∨{»None«}/∃»"/>
| |
| ⋮«}»…
| |
| ⋮«}/∀»… | |
| ⋮«∀(-o:‖[wc]"Ⓟ/Operations"){»…
| |
| ⋮« ⇾(o,WIMLTransition) { »…
| |
| ⋮«➀:(state_in_region)»…
| |
| ⋮«∀(-sir:getStatesInRegion(((String)(‖[o]"Ⓟ/BeforeStateExpression")), (String) name)){»…
| |
| ⋮«➀(state_in_region){»…
| |
| <Transition>
| |
| <Operation IDREF="O_◂‖[o]"Ⓟ/Name"▸"/>
| |
| <SourceStates>
| |
| ⋮«}/➀»…
| |
| <State IDREF="S_◂name▸_◂sir▸"/>
| |
| ⋮«}/∀»…
| |
| ⋮«¬➀(state_in_region){»…
| |
| </SourceStates>
| |
| <TargetStates/>
| |
| </Transition>
| |
| ⋮«}/¬➀»…
| |
| ⋮« }/⇾ »…
| |
| ⋮«}/∀»…
| |
| </Region>
| |
| ⋮«}/∀»…
| |
| ⋮«}/¬∅»…
| |
| </StateMachine>
| |
| ⋮« }/⇾ »…
| |
| ⋮«∀(‖"Ⓟ/Attributes"){if(‖"Ⓟ/Association" == null){»…
| |
| <Attribute Name="◂‖"Ⓟ/Name"▸" PASS="2" TypeName="◂((String)(‖"Ⓟ/Type")).replace("/",".")▸"«∀(‖"Ⓟ/Stereotypes"){» StereotypeName-◂Ⓘ▸="◂⊙▸"«}/∀»…
| |
| ⋮⊏ ➜ this.Extensions(object, "Attribute") ⊐…
| |
| ⋮«}else{»…
| |
| <AssociationEnd PASS="2"> | |
| ⋮«¬∅(‖"Ⓟ/Stereotypes"){»«∀(⊙){»…
| |
| <StereotypeName>◂⊙▸</StereotypeName>
| |
| ⋮«}/∀»«}/¬∅»…
| |
| ⋮«∃(‖"Ⓟ/OtherName"){»…
| |
| <Role>◂⊙▸</Role>
| |
| ⋮«}/∃»…
| |
| <!-- <TypeName>◂‖[wc]"Ⓟ/Name"▸</TypeName> -->
| |
| ⋮«∃(‖"Ⓟ/OtherMultiplicity"){»…
| |
| <Multiplicity>◂⊙▸</Multiplicity>
| |
| <IsNavigable>true</IsNavigable>
| |
| ⋮«}∨{»…
| |
| <Multiplicity>1</Multiplicity>
| |
| <Navigability>false</Navigability>
| |
| ⋮«}/∃»…
| |
| ⋮«●(‖"Ⓟ/Ends/1"){»⊏ ➜ this.Extensions(object, null) ⊐«}/●»…
| |
| <OtherRole>◂‖"Ⓟ/Name"▸</OtherRole>
| |
| <OtherTypeName>◂((String)(‖"Ⓟ/Type")).replace("/",".")▸</OtherTypeName>
| |
| <OtherMultiplicity>◂‖"Ⓟ/Multiplicity"▸</OtherMultiplicity>
| |
| <OtherNavigability>true</OtherNavigability>
| |
| ⋮«●(‖"Ⓟ/Ends/0"){»⊏ ➜ this.Extensions(object, null) ⊐«}/●»…
| |
| ⋮⊏ ➜ this.Extensions(object, null) ⊐…
| |
| </AssociationEnd>
| |
| ⋮«}}/∀»…
| |
| ⋮«∀(‖"Ⓟ/Operations"){»…
| |
| ⋮« ⇾(⊙,WIMLTransition) { }/⇾ »…
| |
| <Operation Name="◂‖"Ⓟ/Name"▸" OID="O_◂‖"Ⓟ/Name"▸" ReturnType="◂‖"Ⓟ/ReturnType"▸"«∀(‖"Ⓟ/Stereotypes"){» StereotypeName-◂Ⓘ▸="◂⊙▸"«}/∀»…
| |
| ⋮⊰« ⇾(⊙,WIMLTransition) {»«¬∅(‖"Ⓟ/BeforeStateExpression"){» BeforeStates="◂⊙▸"«}/¬∅»« }/⇾ »⊱…
| |
| ⋮⊏ ➜ this.Extensions(object, "Operation") ⊐…
| |
| ⋮«}/∀»…
| |
| ⋮«∀(‖"Ⓟ/Views"){»…
| |
| <View Name="◂‖"Ⓟ/Name"▸" «¬∅(‖"Ⓟ/Stereotypes"){» StereotypeName="«∀(⊙){»◂⊙▸«}/∀»"«}/¬∅» CLASS="UMLView_SlotSpecification">
| |
| <ClassOfView>◂‖[wc]"Ⓟ/Name"▸</ClassOfView>
| |
| ⋮⊏ ➜ this.Extensions(object, null) ⊐…
| |
| ⋮«∀(‖"Ⓟ/SlotSpecifications"){»…
| |
| <SlotSpecification Name="◂‖"Ⓟ/Name"▸" Visibility="◂‖"Ⓟ/Visibility"▸" Attributes="◂‖"Ⓟ/Attributes"▸" Associations="◂‖"Ⓟ/Associations"▸" Operations="◂‖"Ⓟ/Operations"▸" Expand="◂‖"Ⓟ/Expand"▸">
| |
| <EntryIncludeRegExp>◂‖"Ⓟ/EntryIncludeRegExp"▸</EntryIncludeRegExp>
| |
| <EntryExcludeRegExp>◂‖"Ⓟ/EntryExcludeRegExp"▸</EntryExcludeRegExp>
| |
| <FeatureIncludeRegExp>◂‖"Ⓟ/FeatureIncludeRegExp"▸</FeatureIncludeRegExp> | |
| <FeatureExcludeRegExp>◂‖"Ⓟ/FeatureExcludeRegExp"▸</FeatureExcludeRegExp>
| |
| </SlotSpecification>
| |
| ⋮«}/∀»…
| |
| </View>
| |
| ⋮«}/∀»…
| |
| ⋮⊏ ➜ this.Extensions(object, null) ⊐…
| |
| </Class>
| |
| «/¶»…
| |
| « } »…
| |
| « } catch (org.oomodels.OOMStatusCode osc) {
| |
| throw osc;
| |
| } catch (Throwable t) {
| |
| org.oomodels.OOMStatusCode osc = new org.oomodels.OOMStatusCode(204);
| |
| //osc.setCause(t);
| |
| throw osc;
| |
| } »…
| |
| ⊏ Ⓣ Extensions(Object object, String element) ⊐…
| |
| ⋮«➀:(e)»…
| |
| ⋮«➀:(x)»…
| |
| ⋮«¬∅(‖"Ⓟ/Extensions"){»…
| |
| ⋮«∀(⊙){»…
| |
| ⋮«if(((String)(‖"Ⓟ/Name")).equals("UML")){»…
| |
| ⋮«➀(e){if(element!=null){»>
| |
| ⋮«}}/➀»…
| |
| ⋮«∀(‖"Ⓟ/Properties"){»…
| |
| ◂((WIMLProperty)(⊙)).dumpToXML(" ",null).toString()▸
| |
| ⋮«}/∀»…
| |
| ⋮«}»…
| |
| ⋮«}/∀»…
| |
| ⋮«}/¬∅»…
| |
| ⋮«¬∅(‖"Ⓟ/Extensions"){»…
| |
| ⋮«∀(⊙){»…
| |
| ⋮«if(((String)(‖"Ⓟ/Name")).equals("UML") == false){»…
| |
| ⋮«➀(e){if(element!=null){»>
| |
| ⋮«}}/➀»…
| |
| ⋮«➀(x){»
| |
| <Extensions>
| |
| ⋮«}/➀»…
| |
| <Extension CLASS="OOEMExtension_OCP_XML">
| |
| <XOCP CLASS="String" CONTENT="XML/Text">
| |
| ⋮«if(((String)(‖"Ⓟ/Name")).matches("^org/xmodel/[^/]*")){»…
| |
| <◂((String)(‖"Ⓟ/Name")).replaceFirst("org/xmodel/","")▸ CLASS="UMLExtension">
| |
| ⋮«}else{»…
| |
| <◂‖"Ⓟ/Name"▸ CLASS="UMLExtension">
| |
| ⋮«}»…
| |
| ⋮«∀(‖"Ⓟ/Properties"){»…
| |
| ◂((WIMLProperty)(⊙)).dumpToXML(" ",null).toString()▸
| |
| ⋮«}/∀»…
| |
| ⋮«if(((String)(‖"Ⓟ/Name")).matches("^org/xmodel/[^/]*")){»…
| |
| </◂((String)(‖"Ⓟ/Name")).replaceFirst("org/xmodel/","")▸>
| |
| ⋮«}else{»…
| |
| </◂‖"Ⓟ/Name"▸>
| |
| ⋮«}»…
| |
| </XOCP>
| |
| </Extension>
| |
| ⋮«}»…
| |
| ⋮«}/∀»…
| |
| ⋮«}/¬∅»… | |
| ⋮«¬➀(x){»…
| |
| </Extensions>
| |
| ⋮«}/¬➀»…
| |
| ⋮«if(element!=null){»…
| |
| ⋮«¬➀(e){»…
| |
| </◂element▸>
| |
| ⋮«}∨{»/>
| |
| ⋮«}/¬➀»…
| |
| ⋮«}»…
| |
| ⊏ /Ⓣ ⊐…
| |
| </OOMCode> | | </OOMCode> |