Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 5d7424e224b97c5b1569f0c887bd8bbd1022b464 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="CustomClassAttributesGenerator"
	imports="org.eclipse.gmf.gmfgraph.* org.eclipse.emf.codegen.util.CodeGenUtil java.util.* "%>
<%
final CustomClass instance = (CustomClass) ((Object[]) argument)[0];
//final GraphDefDispatcher dispatcher = (GraphDefDispatcher) ((Object[]) argument)[1];
final String varName = (String) ((Object[]) argument)[2];
%>

		{
<%
int attrIndex = 0;
for (Iterator attrs = instance.getAttributes().iterator(); attrs.hasNext(); attrIndex++){
	CustomAttribute next = (CustomAttribute) attrs.next(); 
	String varValue;
	if (next.isMultiStatementValue()){
		varValue = "attr" + attrIndex;
%>
			<%=java.text.MessageFormat.format(next.getValue(), new Object[] {varValue})%>;
<%	} else {
	 	varValue = next.getValue();
}
	if (next.isDirectAccess()) { 
%>
			<%=varName%>.<%=next.getName()%> = <%=varValue%>;		
<%			
	} else {
%>
			<%=varName%>.set<%=CodeGenUtil.capName(next.getName())%>(<%=varValue%>);
<%	
	}
%>	
<%
} //for 
%>
		}

Back to the top