01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.apache.cxf.tools.common.model;
19:
20: import org.apache.cxf.tools.util.URIParserUtil;
21:
22: public class JavaField extends JavaType implements JavaAnnotatable {
23: private String modifier;
24: private JavaAnnotation annotation;
25:
26: public JavaField() {
27: }
28:
29: public JavaField(String n, String t, String tns) {
30: super (n, t, tns);
31: this .modifier = "private";
32: }
33:
34: public String getModifier() {
35: return this .modifier;
36: }
37:
38: public void setModifier(String modi) {
39: this .modifier = modi;
40: }
41:
42: public void setAnnotation(JavaAnnotation anno) {
43: this .annotation = anno;
44: }
45:
46: public JavaAnnotation getAnnotation() {
47: return this .annotation;
48: }
49:
50: public void annotate(Annotator annotator) {
51: annotator.annotate(this );
52: }
53:
54: public String getName() {
55: if (URIParserUtil.containsReservedKeywords(this .name)) {
56: return "_" + this.name;
57: }
58: return this.name;
59: }
60:
61: }
|