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;
18:
19: import org.compass.core.converter.Converter;
20: import org.compass.core.engine.naming.PropertyPath;
21:
22: /**
23: * A general interface for all things Mapping in compass. Has a name and a path, where the
24: * name is usually the "logical name" of the mapping, and the path is the actual name which
25: * it will be saved under in the search engine.
26: * <p/>
27: * Also provides general support for converters attached to the mappings, which can have
28: * parameters associated with them.
29: *
30: * @author kimchy
31: */
32: public interface Mapping {
33:
34: /**
35: * The name of the mapping. Acts as the "logical" name of the mapping (think
36: * Java Bean Property name).
37: */
38: String getName();
39:
40: /**
41: * Sets the name of the mapping. Acts as the "logical" name of the mapping (think
42: * Java Bean Property name).
43: */
44: void setName(String name);
45:
46: /**
47: * Returns the path of the mapping. The path is the value under which it will
48: * be saved in the Search Engine.
49: */
50: PropertyPath getPath();
51:
52: /**
53: * Sets the path of the mapping. The path is the value under which it will
54: * be saved in the Search Engine.
55: */
56: void setPath(PropertyPath path);
57:
58: /**
59: * Returns the conveter associated with the mapping. The converter is responsible for
60: * marshalling and unmarshalling the Mapping from and to the Search Engine.
61: */
62: Converter getConverter();
63:
64: /**
65: * Sets the conveter associated with the mapping. The converter is responsible for
66: * marshalling and unmarshalling the Mapping from and to the Search Engine.
67: */
68: void setConverter(Converter converter);
69:
70: /**
71: * Returns the converter name associated with the Mapping. The conveter name
72: * can be the actual class name of the converter, or a lookup name that has a
73: * converter associated with it.
74: */
75: String getConverterName();
76:
77: /**
78: * Sets the converter name associated with the Mapping. The conveter name
79: * can be the actual class name of the converter, or a lookup name that has a
80: * converter associated with it.
81: */
82: void setConverterName(String name);
83:
84: /**
85: * Returns <code>true</code> if the Mapping controlls the fact that if it has no value, it's
86: * parent might be a candidate for being nullable.
87: */
88: boolean controlsObjectNullability();
89:
90: /**
91: * Copies over the mapping definition into a newly instanciated Mapping object.
92: */
93: Mapping copy();
94:
95: }
|