Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
MappingMetadata |
|
| 1.0;1 |
1 | /** | |
2 | * Copyright 2005-2013 Dozer Project | |
3 | * | |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
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 | package org.dozer.metadata; | |
17 | ||
18 | import java.util.List; | |
19 | ||
20 | /** | |
21 | * This interface can be used to query mapping metadata from the dozer internal data structures. It provides | |
22 | * read only access to all important aspects of the mapping information on class and field level. | |
23 | * | |
24 | * @author Florian Kunz | |
25 | */ | |
26 | public interface MappingMetadata { | |
27 | ||
28 | /** | |
29 | * Obtains a list of all available mapping definitions. | |
30 | * | |
31 | * @return A list of {@code ClassMappingMetadata} | |
32 | */ | |
33 | List<ClassMappingMetadata> getClassMappings(); | |
34 | ||
35 | /** | |
36 | * | |
37 | * This method retrieves class mapping metadata based on the source class name. | |
38 | * | |
39 | * @param sourceClassName The fully qualified class name of the source class. | |
40 | * | |
41 | * @return A list of mapping metadata which defines how to map a class with the name | |
42 | * {@code sourceClassName} to other classes. | |
43 | */ | |
44 | List<ClassMappingMetadata> getClassMappingsBySourceName(String sourceClassName); | |
45 | ||
46 | /** | |
47 | * | |
48 | * This method retrieves class mapping metadata based on the destination class name. | |
49 | * | |
50 | * @param destinationClassName The fully qualified class name of the destination class. | |
51 | * | |
52 | * @return A list of mapping metadata which defines how to map to a class with the name | |
53 | * {@code destinationClassName}. | |
54 | */ | |
55 | List<ClassMappingMetadata> getClassMappingsByDestinationName(String destinationClassName); | |
56 | ||
57 | /** | |
58 | * | |
59 | * This method retrieves class mapping metadata based on the class names. | |
60 | * | |
61 | * @param sourceClassName The fully qualified class name of the source class. | |
62 | * @param destinationClassName The fully qualified class name of the destination class. | |
63 | * | |
64 | * @return A list of mapping metadata which defines how to map a class with the name | |
65 | * {@code sourceClassName} to a class with the name {@code destinationClassName}. | |
66 | */ | |
67 | ClassMappingMetadata getClassMappingByName(String sourceClassName, String destinationClassName); | |
68 | ||
69 | /** | |
70 | * | |
71 | * This method retrieves class mapping metadata based on the source class. | |
72 | * | |
73 | * @param sourceClass The Class object which references the source class. | |
74 | * | |
75 | * @return A list of mapping metadata which defines how to map the class {@code sourceClass} | |
76 | * to other classes. | |
77 | */ | |
78 | List<ClassMappingMetadata> getClassMappingsBySource(Class<?> sourceClass); | |
79 | ||
80 | /** | |
81 | * | |
82 | * This method retrieves class mapping metadata based on the destination class. | |
83 | * | |
84 | * @param destinationClass The Class object which references the destination class. | |
85 | * | |
86 | * @return A list of mapping metadata which defines how to map to the class | |
87 | * {@code destinationClass}. | |
88 | */ | |
89 | List<ClassMappingMetadata> getClassMappingsByDestination(Class<?> destinationClass); | |
90 | ||
91 | /** | |
92 | * | |
93 | * This method retrieves class mapping metadata based on two Class objects. | |
94 | * | |
95 | * @param sourceClass The Class object that references the source class. | |
96 | * @param destinationClass The Class object that references the destination class. | |
97 | * | |
98 | * @return The mapping metadata object which defines how to map the class {@code sourceClass} | |
99 | * to the class {@code destinationClass}. | |
100 | * @throws MetadataLookupException If no class map could be found. | |
101 | */ | |
102 | ClassMappingMetadata getClassMapping(Class<?> sourceClass, Class<?> destinationClass); | |
103 | ||
104 | } |