Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 009970deda371d9100b555d3fc26fc4f519df321 @jhalterman jhalterman committed Jun 21, 2011
Showing with 14,316 additions and 0 deletions.
  1. +7 −0 .gitignore
  2. +177 −0 LICENSE.txt
  3. +8 −0 README.md
  4. +26 −0 core/pom.xml
  5. +32 −0 core/src/main/java/org/modelmapper/AbstractCondition.java
  6. +26 −0 core/src/main/java/org/modelmapper/AbstractConverter.java
  7. +23 −0 core/src/main/java/org/modelmapper/AbstractProvider.java
  8. +32 −0 core/src/main/java/org/modelmapper/Condition.java
  9. +178 −0 core/src/main/java/org/modelmapper/Conditions.java
  10. +51 −0 core/src/main/java/org/modelmapper/ConfigurationException.java
  11. +37 −0 core/src/main/java/org/modelmapper/Converter.java
  12. +51 −0 core/src/main/java/org/modelmapper/MappingException.java
  13. +224 −0 core/src/main/java/org/modelmapper/ModelMapper.java
  14. +276 −0 core/src/main/java/org/modelmapper/PropertyMap.java
  15. +44 −0 core/src/main/java/org/modelmapper/Provider.java
  16. +145 −0 core/src/main/java/org/modelmapper/TypeMap.java
  17. +36 −0 core/src/main/java/org/modelmapper/ValidationException.java
  18. +39 −0 core/src/main/java/org/modelmapper/builder/ConditionExpression.java
  19. +40 −0 core/src/main/java/org/modelmapper/builder/ConverterExpression.java
  20. +45 −0 core/src/main/java/org/modelmapper/builder/MapExpression.java
  21. +40 −0 core/src/main/java/org/modelmapper/builder/ProviderExpression.java
  22. +21 −0 core/src/main/java/org/modelmapper/builder/SkipExpression.java
  23. +5 −0 core/src/main/java/org/modelmapper/builder/package-info.java
  24. +225 −0 core/src/main/java/org/modelmapper/config/Configuration.java
  25. +5 −0 core/src/main/java/org/modelmapper/config/package-info.java
  26. +117 −0 core/src/main/java/org/modelmapper/convention/IntelligentMatchingStrategy.java
  27. +95 −0 core/src/main/java/org/modelmapper/convention/LooseMatchingStrategy.java
  28. +67 −0 core/src/main/java/org/modelmapper/convention/MatchingStrategies.java
  29. +43 −0 core/src/main/java/org/modelmapper/convention/NameTokenizers.java
  30. +59 −0 core/src/main/java/org/modelmapper/convention/NameTransformers.java
  31. +59 −0 core/src/main/java/org/modelmapper/convention/NamingConventions.java
  32. +35 −0 core/src/main/java/org/modelmapper/convention/StrictMatchingStrategy.java
  33. +4 −0 core/src/main/java/org/modelmapper/convention/package-info.java
  34. +27 −0 core/src/main/java/org/modelmapper/internal/Accessor.java
  35. +68 −0 core/src/main/java/org/modelmapper/internal/ConstantMappingImpl.java
  36. +349 −0 core/src/main/java/org/modelmapper/internal/Errors.java
  37. +17 −0 core/src/main/java/org/modelmapper/internal/ErrorsException.java
  38. +288 −0 core/src/main/java/org/modelmapper/internal/InheritingConfiguration.java
  39. +218 −0 core/src/main/java/org/modelmapper/internal/MappingBuilderImpl.java
  40. +181 −0 core/src/main/java/org/modelmapper/internal/MappingContextImpl.java
  41. +340 −0 core/src/main/java/org/modelmapper/internal/MappingEngineImpl.java
  42. +147 −0 core/src/main/java/org/modelmapper/internal/MappingImpl.java
  43. +43 −0 core/src/main/java/org/modelmapper/internal/MappingInterceptor.java
  44. +105 −0 core/src/main/java/org/modelmapper/internal/MappingProgress.java
  45. +29 −0 core/src/main/java/org/modelmapper/internal/Mutator.java
  46. +159 −0 core/src/main/java/org/modelmapper/internal/PropertyInfoImpl.java
  47. +86 −0 core/src/main/java/org/modelmapper/internal/PropertyInfoRegistry.java
  48. +205 −0 core/src/main/java/org/modelmapper/internal/PropertyMappingBuilder.java
  49. +78 −0 core/src/main/java/org/modelmapper/internal/PropertyMappingImpl.java
  50. +128 −0 core/src/main/java/org/modelmapper/internal/PropertyNameInfoImpl.java
  51. +96 −0 core/src/main/java/org/modelmapper/internal/PropertyResolver.java
  52. +106 −0 core/src/main/java/org/modelmapper/internal/ProxyFactory.java
  53. +68 −0 core/src/main/java/org/modelmapper/internal/SourceMappingImpl.java
  54. +52 −0 core/src/main/java/org/modelmapper/internal/TypeInfo.java
  55. +205 −0 core/src/main/java/org/modelmapper/internal/TypeInfoImpl.java
  56. +46 −0 core/src/main/java/org/modelmapper/internal/TypeInfoRegistry.java
  57. +204 −0 core/src/main/java/org/modelmapper/internal/TypeMapImpl.java
  58. +110 −0 core/src/main/java/org/modelmapper/internal/TypeMapStore.java
  59. +68 −0 core/src/main/java/org/modelmapper/internal/TypePair.java
  60. +50 −0 core/src/main/java/org/modelmapper/internal/converter/ArrayConverter.java
  61. +36 −0 core/src/main/java/org/modelmapper/internal/converter/AssignableConverter.java
  62. +51 −0 core/src/main/java/org/modelmapper/internal/converter/BooleanConverter.java
  63. +36 −0 core/src/main/java/org/modelmapper/internal/converter/CharacterConverter.java
  64. +69 −0 core/src/main/java/org/modelmapper/internal/converter/CollectionConverter.java
  65. +50 −0 core/src/main/java/org/modelmapper/internal/converter/ConverterStore.java
  66. +132 −0 core/src/main/java/org/modelmapper/internal/converter/DateConverter.java
  67. +45 −0 core/src/main/java/org/modelmapper/internal/converter/EnumConverter.java
  68. +88 −0 core/src/main/java/org/modelmapper/internal/converter/IterableConverter.java
  69. +77 −0 core/src/main/java/org/modelmapper/internal/converter/MapConverter.java
  70. +176 −0 core/src/main/java/org/modelmapper/internal/converter/NumberConverter.java
  71. +36 −0 core/src/main/java/org/modelmapper/internal/converter/StringConverter.java
  72. +4 −0 core/src/main/java/org/modelmapper/internal/package-info.java
  73. +51 −0 core/src/main/java/org/modelmapper/internal/util/ArrayIterator.java
  74. +66 −0 core/src/main/java/org/modelmapper/internal/util/Assert.java
  75. +15 −0 core/src/main/java/org/modelmapper/internal/util/Iterables.java
  76. +94 −0 core/src/main/java/org/modelmapper/internal/util/Primitives.java
  77. +49 −0 core/src/main/java/org/modelmapper/internal/util/Stack.java
  78. +24 −0 core/src/main/java/org/modelmapper/internal/util/Strings.java
  79. +58 −0 core/src/main/java/org/modelmapper/internal/util/ToStringBuilder.java
  80. +268 −0 core/src/main/java/org/modelmapper/internal/util/TypeResolver.java
  81. +100 −0 core/src/main/java/org/modelmapper/internal/util/Types.java
  82. +43 −0 core/src/main/java/org/modelmapper/package-info.java
  83. +38 −0 core/src/main/java/org/modelmapper/spi/ConditionalConverter.java
  84. +28 −0 core/src/main/java/org/modelmapper/spi/ConstantMapping.java
  85. +61 −0 core/src/main/java/org/modelmapper/spi/ErrorMessage.java
  86. +65 −0 core/src/main/java/org/modelmapper/spi/Mapping.java
  87. +79 −0 core/src/main/java/org/modelmapper/spi/MappingContext.java
  88. +39 −0 core/src/main/java/org/modelmapper/spi/MappingEngine.java
  89. +71 −0 core/src/main/java/org/modelmapper/spi/MatchingStrategy.java
  90. +31 −0 core/src/main/java/org/modelmapper/spi/NameTokenizer.java
  91. +31 −0 core/src/main/java/org/modelmapper/spi/NameTransformer.java
  92. +33 −0 core/src/main/java/org/modelmapper/spi/NameableType.java
  93. +29 −0 core/src/main/java/org/modelmapper/spi/NamingConvention.java
  94. +65 −0 core/src/main/java/org/modelmapper/spi/PropertyInfo.java
  95. +35 −0 core/src/main/java/org/modelmapper/spi/PropertyMapping.java
  96. +25 −0 core/src/main/java/org/modelmapper/spi/PropertyType.java
  97. +28 −0 core/src/main/java/org/modelmapper/spi/SourceMapping.java
  98. +4 −0 core/src/main/java/org/modelmapper/spi/package-info.java
  99. +24 −0 core/src/test/java/org/modelmapper/AbstractTest.java
  100. +49 −0 core/src/test/java/org/modelmapper/Asserts.java
  101. +68 −0 core/src/test/java/org/modelmapper/Fixtures.java
  102. +24 −0 core/src/test/java/org/modelmapper/Mappings.java
  103. +118 −0 core/src/test/java/org/modelmapper/ModelMapperTest.java
  104. +51 −0 core/src/test/java/org/modelmapper/PropertyMapTest.java
  105. +146 −0 core/src/test/java/org/modelmapper/TypeMapTest.java
  106. +181 −0 core/src/test/java/org/modelmapper/convention/InexactMatchingStrategyTest.java
  107. +45 −0 core/src/test/java/org/modelmapper/convention/LooseMatchingStrategyTest.java
  108. +23 −0 core/src/test/java/org/modelmapper/convention/NameTokenizersTest.java
  109. +31 −0 core/src/test/java/org/modelmapper/convention/NameTransformersTest.java
  110. +29 −0 core/src/test/java/org/modelmapper/convention/NamingConventionsTest.java
  111. +36 −0 core/src/test/java/org/modelmapper/convention/StandardMatchingStrategyTest.java
  112. +18 −0 core/src/test/java/org/modelmapper/convention/StrictMatchingStrategyTest.java
  113. +76 −0 core/src/test/java/org/modelmapper/functional/CollectionMapping.java
  114. +46 −0 core/src/test/java/org/modelmapper/functional/ConditionalMapping.java
  115. +339 −0 core/src/test/java/org/modelmapper/functional/CustomConversion.java
  116. +75 −0 core/src/test/java/org/modelmapper/functional/EqualHierarchies.java
  117. +39 −0 core/src/test/java/org/modelmapper/functional/MergeTypeMaps.java
  118. +57 −0 core/src/test/java/org/modelmapper/functional/NullBehavior.java
  119. +81 −0 core/src/test/java/org/modelmapper/functional/PrimitiveMapping.java
  120. +147 −0 core/src/test/java/org/modelmapper/functional/ProviderTest.java
  121. +50 −0 core/src/test/java/org/modelmapper/functional/ProxyTest.java
  122. +104 −0 core/src/test/java/org/modelmapper/functional/UnequalHierarchies.java
  123. +28 −0 core/src/test/java/org/modelmapper/functional/circular/CircularDependencies1.java
  124. +122 −0 core/src/test/java/org/modelmapper/functional/circular/CircularDependencies2.java
  125. +116 −0 core/src/test/java/org/modelmapper/functional/deepmapping/DeepMappingTest1.java
  126. +33 −0 core/src/test/java/org/modelmapper/functional/deepmapping/DeepMappingTest2.java
  127. +94 −0 core/src/test/java/org/modelmapper/functional/deepmapping/NestedMappingTest1.java
  128. +289 −0 core/src/test/java/org/modelmapper/functional/deepmapping/NestedMappingTest2.java
  129. +190 −0 core/src/test/java/org/modelmapper/functional/deepmapping/NestedMappingTest3.java
  130. +152 −0 core/src/test/java/org/modelmapper/functional/deepmapping/NestedMappingTest4.java
  131. +64 −0 core/src/test/java/org/modelmapper/functional/deepmapping/NestedMappingTest5.java
  132. +58 −0 core/src/test/java/org/modelmapper/functional/deepmapping/NestedMappingTest6.java
  133. +71 −0 core/src/test/java/org/modelmapper/functional/deepmapping/NestedMappingTest7.java
  134. +49 −0 core/src/test/java/org/modelmapper/functional/deepmapping/NestedMappingTest8.java
  135. +37 −0 core/src/test/java/org/modelmapper/functional/disambiguation/DisambiguationTest1.java
  136. +65 −0 core/src/test/java/org/modelmapper/functional/disambiguation/DisambiguationTest2.java
  137. +69 −0 core/src/test/java/org/modelmapper/functional/disambiguation/DisambiguationTest3.java
  138. +65 −0 core/src/test/java/org/modelmapper/functional/disambiguation/DisambiguationTest4.java
  139. +91 −0 core/src/test/java/org/modelmapper/functional/loosematching/LooseMappingTest1.java
  140. +133 −0 core/src/test/java/org/modelmapper/functional/loosematching/LooseMappingTest2.java
  141. +12 −0 core/src/test/java/org/modelmapper/functional/parallel/ParallelTest1.java
  142. +53 −0 core/src/test/java/org/modelmapper/internal/InheritingConfigurationTest.java
  143. +431 −0 core/src/test/java/org/modelmapper/internal/MappingBuilderImplTest.java
  144. +197 −0 core/src/test/java/org/modelmapper/internal/MatchingStrategyTestSupport.java
  145. +94 −0 core/src/test/java/org/modelmapper/internal/TypeInfoImplTest.java
  146. +24 −0 core/src/test/java/org/modelmapper/internal/TypeInfoRegistryTest.java
  147. +49 −0 core/src/test/java/org/modelmapper/internal/TypeMapImplTest.java
  148. +83 −0 core/src/test/java/org/modelmapper/internal/converter/AbstractConverterTest.java
  149. +81 −0 core/src/test/java/org/modelmapper/internal/converter/ArrayConverterTest.java
  150. +35 −0 core/src/test/java/org/modelmapper/internal/converter/AssignableConverterTest.java
  151. +53 −0 core/src/test/java/org/modelmapper/internal/converter/BooleanConverterTest.java
  152. +35 −0 core/src/test/java/org/modelmapper/internal/converter/CharacterConverterTest.java
  153. +99 −0 core/src/test/java/org/modelmapper/internal/converter/CollectionConverterTest.java
  154. +205 −0 core/src/test/java/org/modelmapper/internal/converter/DateConverterTest.java
  155. +41 −0 core/src/test/java/org/modelmapper/internal/converter/EnumConverterTest.java
  156. +87 −0 core/src/test/java/org/modelmapper/internal/converter/MapConverterTest.java
  157. +359 −0 core/src/test/java/org/modelmapper/internal/converter/NumberConverterTest.java
  158. +45 −0 core/src/test/java/org/modelmapper/internal/util/PrimitivesTest.java
  159. +160 −0 core/src/test/java/org/modelmapper/internal/util/TypeResolverTest.java
  160. +34 −0 core/src/test/java/org/modelmapper/internal/util/TypesTest.java
  161. +9 −0 core/src/test/resources/testngAll.xml
  162. +9 −0 core/src/test/resources/testngFunctional.xml
  163. +10 −0 core/src/test/resources/testngParallel.xml
  164. +20 −0 examples/pom.xml
  165. +22 −0 examples/src/main/java/org/modelmapper/flattening/example1/Address.java
  166. +13 −0 examples/src/main/java/org/modelmapper/flattening/example1/Customer.java
  167. +32 −0 examples/src/main/java/org/modelmapper/flattening/example1/FlatteningExample1.java
  168. +31 −0 examples/src/main/java/org/modelmapper/flattening/example1/Order.java
  169. +49 −0 examples/src/main/java/org/modelmapper/flattening/example1/OrderDTO.java
  170. +23 −0 examples/src/main/java/org/modelmapper/flattening/example2/Address.java
  171. +36 −0 examples/src/main/java/org/modelmapper/flattening/example2/FlatteningExample2.java
  172. +13 −0 examples/src/main/java/org/modelmapper/flattening/example2/Person.java
  173. +22 −0 examples/src/main/java/org/modelmapper/flattening/example2/PersonDTO.java
  174. +21 −0 extensions/guice/pom.xml
  175. +39 −0 extensions/guice/src/main/java/org/modelmapper/guice/GuiceIntegration.java
  176. +40 −0 extensions/guice/src/test/java/org/modelmapper/guice/GuiceIntegrationTest.java
  177. +26 −0 extensions/pom.xml
  178. +21 −0 extensions/spring/pom.xml
  179. +38 −0 extensions/spring/src/main/java/org/modelmapper/spring/SpringIntegration.java
  180. +34 −0 extensions/spring/src/test/java/org/modelmapper/spring/SpringIntegrationTest.java
  181. +73 −0 pom.xml
@@ -0,0 +1,7 @@
+archive/
+target/
+test-output/
+*~
+.project
+.classpath
+.settings/
@@ -0,0 +1,177 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,8 @@
+ModelMapper
+-----------------
+
+ModelMapper is an intelligent object mapping framework that eliminates the need to manually map objects to each other. It uses a convention-based approach to intelligently map objects, while providing a simple, clean, refactoring safe API for handling specific mapping scenarios.
+
+Visit the [project website][1] to learn more.
+
+[1]: http://modelmapper.org
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.modelmapper</groupId>
+ <artifactId>modelmapper-parent</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>modelmapper</artifactId>
+ <name>ModelMapper - Core Library</name>
+ <dependencies>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <version>2.2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.12.1.GA</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
@@ -0,0 +1,32 @@
+package org.modelmapper;
+
+import org.modelmapper.internal.util.Assert;
+
+/**
+ * Condition support class.
+ *
+ * @author Jonathan Halterman
+ */
+public abstract class AbstractCondition implements Condition {
+ /**
+ * Returns a new condition that applies if {@code this} AND the given {@code condition} apply.
+ *
+ * @return new condition
+ * @throws IllegalArgumentException if {@code condition} is null
+ */
+ public Condition and(Condition condition) {
+ Assert.notNull(condition, "condition");
+ return Conditions.and(this, condition);
+ }
+
+ /**
+ * Returns a new condition that applies if {@code this} OR the given {@code condition} apply.
+ *
+ * @return new condition
+ * @throws IllegalArgumentException if {@code condition} is null
+ */
+ public Condition or(Condition condition) {
+ Assert.notNull(condition, "condition");
+ return Conditions.or(this, condition);
+ }
+}
@@ -0,0 +1,26 @@
+package org.modelmapper;
+
+import org.modelmapper.spi.MappingContext;
+
+/**
+ * Converter support class. Allows for simpler Converter implementations.
+ *
+ * @param <S> source type
+ * @param <D> destination type
+ *
+ * @author Jonathan Halterman
+ */
+public abstract class AbstractConverter<S, D> implements Converter<S, D> {
+ /**
+ * Delegates conversion to {@link #convert(Object)}.
+ */
+ @Override
+ public D convert(MappingContext<S, D> context) {
+ return convert(context.getSource());
+ }
+
+ /**
+ * Converts {@code source} to an instance of type {@code D}.
+ */
+ protected abstract D convert(S source);
+}
@@ -0,0 +1,23 @@
+package org.modelmapper;
+
+/**
+ * Provider support class. Allows for simpler Provider implementations.
+ *
+ * @param <T> type to provide
+ *
+ * @author Jonathan Halterman
+ */
+public abstract class AbstractProvider<T> implements Provider<T> {
+ /**
+ * Delegates provisioning to {@link #get()}.
+ */
+ @Override
+ public T get(ProvisionRequest<T> request) {
+ return get();
+ }
+
+ /**
+ * Provides an instance of type {@code T}.
+ */
+ protected abstract T get();
+}
@@ -0,0 +1,32 @@
+/**
+ * Copyright 2011 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.modelmapper;
+
+import org.modelmapper.spi.MappingContext;
+
+/**
+ * Condition that must apply in order for mapping to occur.
+ *
+ * @author Jonathan Halterman
+ */
+public interface Condition {
+ /**
+ * Specifies whether the condition applies to the {@code context}.
+ *
+ * @param context of current mapping process
+ */
+ boolean applies(MappingContext<?, ?> context);
+}
Oops, something went wrong.

0 comments on commit 009970d

Please sign in to comment.