01: /*
02: * Copyright 2004-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.compass.core.mapping.osem;
18:
19: import org.compass.core.accessor.Getter;
20: import org.compass.core.accessor.Setter;
21: import org.compass.core.mapping.AbstractMapping;
22:
23: /**
24: *
25: * @author kimchy
26: *
27: */
28: public abstract class AbstractAccessorMapping extends AbstractMapping
29: implements ObjectMapping {
30:
31: private String accessor;
32:
33: private String propertyName;
34:
35: private String definedInAlias;
36:
37: private Getter getter;
38:
39: private Setter setter;
40:
41: protected void copy(AbstractAccessorMapping copy) {
42: super .copy(copy);
43: copy.setGetter(getGetter());
44: copy.setSetter(getSetter());
45: copy.setAccessor(getAccessor());
46: copy.setPropertyName(getPropertyName());
47: copy.setDefinedInAlias(getDefinedInAlias());
48: }
49:
50: public boolean hasAccessors() {
51: return true;
52: }
53:
54: public Getter getGetter() {
55: return getter;
56: }
57:
58: public void setGetter(Getter getter) {
59: this .getter = getter;
60: }
61:
62: public Setter getSetter() {
63: return setter;
64: }
65:
66: public void setSetter(Setter setter) {
67: this .setter = setter;
68: }
69:
70: public String getAccessor() {
71: return accessor;
72: }
73:
74: public void setAccessor(String accessor) {
75: this .accessor = accessor;
76: }
77:
78: public String getPropertyName() {
79: return propertyName;
80: }
81:
82: public void setPropertyName(String propertyName) {
83: this .propertyName = propertyName;
84: }
85:
86: public String getDefinedInAlias() {
87: return definedInAlias;
88: }
89:
90: public void setDefinedInAlias(String definedInAlias) {
91: this.definedInAlias = definedInAlias;
92: }
93: }
|