~ubuntu-branches/ubuntu/saucy/restlet/saucy

« back to all changes in this revision

Viewing changes to org.restlet.ext.odata/src/org/restlet/ext/odata/internal/templates/complexType.ftl

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-11 16:25:45 UTC
  • Revision ID: package-import@ubuntu.com-20120611162545-5w2o0resi5y3pybc
Tags: upstream-2.0.14
ImportĀ upstreamĀ versionĀ 2.0.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * Copyright 2005-2012 Restlet S.A.S.
 
3
 * 
 
4
 * The contents of this file are subject to the terms of one of the following
 
5
 * open source licenses: Apache 2.0 or LGPL 3.0 or LGPL 2.1 or CDDL 1.0 or EPL
 
6
 * 1.0 (the "Licenses"). You can select the license that you prefer but you may
 
7
 * not use this file except in compliance with one of these Licenses.
 
8
 * 
 
9
 * You can obtain a copy of the Apache 2.0 license at
 
10
 * http://www.opensource.org/licenses/apache-2.0
 
11
 * 
 
12
 * You can obtain a copy of the LGPL 3.0 license at
 
13
 * http://www.opensource.org/licenses/lgpl-3.0
 
14
 * 
 
15
 * You can obtain a copy of the LGPL 2.1 license at
 
16
 * http://www.opensource.org/licenses/lgpl-2.1
 
17
 * 
 
18
 * You can obtain a copy of the CDDL 1.0 license at
 
19
 * http://www.opensource.org/licenses/cddl1
 
20
 * 
 
21
 * You can obtain a copy of the EPL 1.0 license at
 
22
 * http://www.opensource.org/licenses/eclipse-1.0
 
23
 * 
 
24
 * See the Licenses for the specific language governing permissions and
 
25
 * limitations under the Licenses.
 
26
 * 
 
27
 * Alternatively, you can obtain a royalty free commercial license with less
 
28
 * limitations, transferable or non-transferable, directly at
 
29
 * http://www.restlet.com/products/restlet-framework
 
30
 * 
 
31
 * Restlet is a registered trademark of Restlet S.A.S.
 
32
 */
 
33
 
 
34
package ${packageName};
 
35
 
 
36
<#compress>
 
37
<#list type.importedJavaClasses?sort as clazz>
 
38
import ${clazz};
 
39
</#list>
 
40
 
 
41
<#list type.importedTypes?sort as t>
 
42
import ${t.fullClassName};
 
43
</#list>
 
44
</#compress>
 
45
 
 
46
 
 
47
<#compress>
 
48
/**
 
49
 * Generated by the generator tool for the OData extension for the Restlet framework.<br>
 
50
 * 
 
51
<#if metadata.metadataRef??> * @see <a href="${metadata.metadataRef}">Metadata of the target OData service</a></#if>
 
52
 * 
 
53
 */
 
54
</#compress>
 
55
 
 
56
public <#if type.abstractType>abstract </#if>class ${className} {
 
57
 
 
58
<#list type.properties?sort_by("name") as property>
 
59
  <#if property.type??>
 
60
    private ${property.type.className} ${property.propertyName}<#if property.defaultValue??> = property.defaultValue</#if>;
 
61
  <#else>
 
62
    // private [error: no defined type] ${property.propertyName}<#if property.defaultValue??> = property.defaultValue</#if>;
 
63
  </#if>
 
64
</#list>
 
65
<#list type.complexProperties?sort_by("name") as property>
 
66
  <#if property.complexType??>
 
67
    private ${property.complexType.className} ${property.propertyName};
 
68
  <#else>
 
69
    // private [error: no defined type] ${property.propertyName};
 
70
  </#if>
 
71
</#list>
 
72
 
 
73
    /**
 
74
     * Constructor without parameter.
 
75
     * 
 
76
     */
 
77
    public ${className}() {
 
78
        super();
 
79
    }
 
80
    
 
81
<#list type.properties?sort_by("name") as property>
 
82
  <#if property.type??>
 
83
   /**
 
84
    * Returns the value of the "${property.propertyName}" attribute.
 
85
    *
 
86
    * @return The value of the "${property.propertyName}" attribute.
 
87
    */
 
88
   <#if property.getterAccess??>${property.getterAccess}<#else>public</#if> ${property.type.className} get${property.normalizedName?cap_first}() {
 
89
      return ${property.propertyName};
 
90
   }
 
91
  </#if>
 
92
 
 
93
</#list>
 
94
<#list type.complexProperties?sort_by("name") as property>
 
95
   <#if property.complexType??>
 
96
   /**
 
97
    * Returns the value of the "${property.propertyName}" attribute.
 
98
    *
 
99
    * @return The value of the "${property.propertyName}" attribute.
 
100
    */
 
101
   <#if property.getterAccess??>${property.getterAccess}<#else>public</#if> ${property.complexType.className} get${property.normalizedName?cap_first}() {
 
102
      return ${property.propertyName};
 
103
   }
 
104
   </#if>   
 
105
 
 
106
</#list>
 
107
<#list type.properties?sort_by("name") as property>
 
108
  <#if property.type??>
 
109
   /**
 
110
    * Sets the value of the "${property.propertyName}" attribute.
 
111
    *
 
112
    * @param ${property.propertyName}
 
113
    *     The value of the "${property.normalizedName}" attribute.
 
114
    */
 
115
   <#if property.setterAccess??>${property.setterAccess}<#else>public</#if> void set${property.normalizedName?cap_first}(${property.type.className} ${property.propertyName}) {
 
116
      this.${property.propertyName} = ${property.propertyName};
 
117
   }
 
118
  </#if>
 
119
 
 
120
</#list>
 
121
<#list type.complexProperties?sort_by("name") as property>
 
122
   <#if property.complexType??>
 
123
   /**
 
124
    * Sets the value of the "${property.normalizedName}" attribute.
 
125
    *
 
126
    * @param ${property.propertyName}
 
127
    *     The value of the "${property.normalizedName}" attribute.
 
128
    */
 
129
   <#if property.setterAccess??>${property.setterAccess}<#else>public</#if> void set${property.normalizedName?cap_first}(${property.complexType.className} ${property.propertyName}) {
 
130
      this.${property.propertyName} = ${property.propertyName};
 
131
   }
 
132
   </#if>
 
133
   
 
134
</#list>
 
135
}
 
 
b'\\ No newline at end of file'