diff --git a/ragconnect.base/src/main/jastadd/Intermediate.jadd b/ragconnect.base/src/main/jastadd/Intermediate.jadd index 036159fe322e9888e361bf554ff0554b198ff41d..f025edb56ab84288d464dffce8fa561978cff6d0 100644 --- a/ragconnect.base/src/main/jastadd/Intermediate.jadd +++ b/ragconnect.base/src/main/jastadd/Intermediate.jadd @@ -445,7 +445,7 @@ aspect MustacheReceiveAndSendAndHandleUri { eq AttributeEndpointTarget.parentTypeName() = getParentTypeDecl().getName(); eq AttributeEndpointTarget.entityName() = getName(); - eq RelationEndpointTarget.getterMethodName() = forwardingNTA_Name(); + eq RelationEndpointTarget.getterMethodName() = forwardingName(); eq RelationEndpointTarget.parentTypeName() = getRole().getType().getName(); eq RelationEndpointTarget.entityName() = getRole().getName(); eq RelationEndpointTarget.realGetterMethodName() = "get" + getRole().getterMethodName(); @@ -466,10 +466,10 @@ aspect MustacheReceiveAndSendAndHandleUri { eq TypeEndpointTarget.entityName() = getType().getName() + (typeIsList() && !containingEndpointDefinition().getIndexBasedListAccess() ? "List" : ""); private String TypeEndpointTarget.getterMethodeNameHelper(boolean useForwarding) { - return (useForwarding && needForwardingNTA() ? forwardingNTA_Name() : + return (useForwarding && needForwarding() ? forwardingName() : "get" + getType().getName() + (typeIsList() && (!containingEndpointDefinition().getIndexBasedListAccess() || containingEndpointDefinition().getWithAdd()) ? "List" : "") + (typeIsOpt() ? "Opt" : "") - + (needForwardingNTA() ? "NoTransform" : "")); + + (needForwarding() ? "NoTransform" : "")); } eq ContextFreeTypeEndpointTarget.getterMethodName() = null; @@ -506,14 +506,14 @@ aspect MustacheSendDefinition { syn String EndpointDefinition.lastValueSetter() = senderName() + ".setLastValue"; - syn boolean EndpointDefinition.needForwardingNTA() = getEndpointTarget().needForwardingNTA(); - syn String EndpointDefinition.forwardingNTA_Name() = getEndpointTarget().forwardingNTA_Name(); - syn String EndpointDefinition.forwardingNTA_Type() = getEndpointTarget().forwardingNTA_Type(); + syn boolean EndpointDefinition.needForwarding() = getEndpointTarget().needForwarding(); + syn String EndpointDefinition.forwardingName() = getEndpointTarget().forwardingName(); + syn String EndpointDefinition.forwardingType() = getEndpointTarget().forwardingType(); syn boolean EndpointDefinition.targetIsAttribute() = getEndpointTarget().isAttributeEndpointTarget(); syn boolean EndpointDefinition.indexBasedAccessAndTargetIsNTA() { - return typeIsList() && getIndexBasedListAccess() && !needForwardingNTA(); + return typeIsList() && getIndexBasedListAccess() && !needForwarding(); } syn boolean EndpointDefinition.relationEndpointWithListRole() = getEndpointTarget().relationEndpointWithListRole(); @@ -546,30 +546,30 @@ aspect MustacheSendDefinition { syn String EndpointDefinition.writeMethodName() = toMustache().writeMethodName(); // === attributes needed for computing above ones === - syn boolean EndpointTarget.needForwardingNTA() = false; - eq TypeEndpointTarget.needForwardingNTA() = containingEndpointDefinition().getSend() && !getType().getNTA(); - eq RelationEndpointTarget.needForwardingNTA() = containingEndpointDefinition().getSend(); + syn boolean EndpointTarget.needForwarding() = false; + eq TypeEndpointTarget.needForwarding() = containingEndpointDefinition().getSend() && !getType().getNTA(); + eq RelationEndpointTarget.needForwarding() = containingEndpointDefinition().getSend(); - syn String EndpointTarget.forwardingNTA_Name() = null; // only needed, if needForwardingNTA evaluates to true - eq TypeEndpointTarget.forwardingNTA_Name() = ragconnect().internalRagConnectPrefix() + getType().getName(); - eq RelationEndpointTarget.forwardingNTA_Name() = ragconnect().internalRagConnectPrefix() + getRole().getName(); + syn String EndpointTarget.forwardingName() = null; // only needed, if needForwarding evaluates to true + eq TypeEndpointTarget.forwardingName() = ragconnect().internalRagConnectPrefix() + getType().getName(); + eq RelationEndpointTarget.forwardingName() = ragconnect().internalRagConnectPrefix() + getRole().getName(); - syn String EndpointTarget.forwardingNTA_Type() = null; // only needed, if needForwardingNTA evaluates to true - eq TypeEndpointTarget.forwardingNTA_Type() = getType().forwardingNTA_Type( + syn String EndpointTarget.forwardingType() = null; // only needed, if needForwarding evaluates to true + eq TypeEndpointTarget.forwardingType() = getType().forwardingType( containingEndpointDefinition().getIndexBasedListAccess()); - eq RelationEndpointTarget.forwardingNTA_Type() = getRole().forwardingNTA_Type( + eq RelationEndpointTarget.forwardingType() = getRole().forwardingType( containingEndpointDefinition().getIndexBasedListAccess()); - syn String TypeComponent.forwardingNTA_Type(boolean indexBasedListAccess); - eq NormalComponent.forwardingNTA_Type(boolean indexBasedListAccess) = getTypeDecl().getName(); - eq OptComponent.forwardingNTA_Type(boolean indexBasedListAccess) = + syn String TypeComponent.forwardingType(boolean indexBasedListAccess); + eq NormalComponent.forwardingType(boolean indexBasedListAccess) = getTypeDecl().getName(); + eq OptComponent.forwardingType(boolean indexBasedListAccess) = ragconnect().configJastAddOpt() + "<" + getTypeDecl().getName() + ">"; - eq ListComponent.forwardingNTA_Type(boolean indexBasedListAccess) = indexBasedListAccess ? + eq ListComponent.forwardingType(boolean indexBasedListAccess) = indexBasedListAccess ? getTypeDecl().getName() : ragconnect().configJastAddList() + "<" + getTypeDecl().getName() + ">"; - syn String Role.forwardingNTA_Type(boolean indexBasedListAccess) = oppositeRole().getType().getName(); - eq ListRole.forwardingNTA_Type(boolean indexBasedListAccess) = indexBasedListAccess ? + syn String Role.forwardingType(boolean indexBasedListAccess) = oppositeRole().getType().getName(); + eq ListRole.forwardingType(boolean indexBasedListAccess) = indexBasedListAccess ? oppositeRole().getType().getName() : "java.util.List<" + oppositeRole().getType().getName() + ">"; diff --git a/ragconnect.base/src/main/resources/sendDefinition.mustache b/ragconnect.base/src/main/resources/sendDefinition.mustache index 2b8a6eb3536e81d9621f56866a375462562cf299..5566a252ef8f10afdd3e8b65d990cdb8d6d9a17d 100644 --- a/ragconnect.base/src/main/resources/sendDefinition.mustache +++ b/ragconnect.base/src/main/resources/sendDefinition.mustache @@ -159,8 +159,8 @@ protected void {{parentTypeName}}.{{writeMethodName}}({{#IndexBasedListAccess}}i {{senderName}}.run({{#IndexBasedListAccess}}index, {{/IndexBasedListAccess}}token); } -{{#needForwardingNTA}} -syn {{{forwardingNTA_Type}}} {{parentTypeName}}.{{forwardingNTA_Name}}({{#IndexBasedListAccess}}int index{{/IndexBasedListAccess}}) { +{{#needForwarding}} +syn {{{forwardingType}}} {{parentTypeName}}.{{forwardingName}}({{#IndexBasedListAccess}}int index{{/IndexBasedListAccess}}) { {{#relationEndpointWithListRole}} // for (var element : {{realGetterMethodCall}}) { // element.{{touchedTerminalsMethodName}}(); @@ -169,11 +169,11 @@ syn {{{forwardingNTA_Type}}} {{parentTypeName}}.{{forwardingNTA_Name}}({{#IndexB return {{realGetterMethodCall}}; {{/relationEndpointWithListRole}} {{^relationEndpointWithListRole}} - {{{forwardingNTA_Type}}} result = {{realGetterMethodCall}}; + {{{forwardingType}}} result = {{realGetterMethodCall}}; if (result == null) { return null; } return result.{{touchedTerminalsMethodName}}(); {{/relationEndpointWithListRole}} } -{{/needForwardingNTA}} +{{/needForwarding}}