Package ma.glasnost.orika

Examples of ma.glasnost.orika.MappingHint


     * @throws Exception
     */
    @Test
    public void testMappingByDefaultWithHint() throws Exception {
       
        MappingHint myHint =
        /**
         * This sample hint converts "myProperty" to "property", and vis-versa.
         */
        new MappingHint() {
           
            public String suggestMappedField(String fromProperty, Class<?> fromPropertyType) {
                if (fromProperty.startsWith("my")) {
                    return fromProperty.substring(2, 3).toLowerCase() + fromProperty.substring(3);
                } else {
View Full Code Here


     * @throws Exception
     */
    @Test
    public void testMappingWithRegisteredHintAndNoClassMap() throws Exception {
       
        MappingHint myHint =
        /**
         * This sample hint converts "myProperty" to "property", and vis-versa.
         */
        new MappingHint() {
           
            public String suggestMappedField(String fromProperty, Class<?> fromPropertyType) {
                if (fromProperty.startsWith("my")) {
                    return fromProperty.substring(2, 3).toLowerCase() + fromProperty.substring(3);
                } else {
View Full Code Here

   
    @Test
    public void testMappingSubclassImplementationWithoutExistingMapping() throws Exception {
       
        MapperFactory factory = MappingUtil.getMapperFactory();
        MappingHint myHint =
        /**
         * This sample hint converts "myProperty" to "property", and vis-versa.
         */
        new MappingHint() {
           
            public String suggestMappedField(String fromProperty, Class<?> fromPropertyType) {
                if (fromProperty.startsWith("my")) {
                    return fromProperty.substring(2, 1).toLowerCase() + fromProperty.substring(3);
                } else {
View Full Code Here

TOP

Related Classes of ma.glasnost.orika.MappingHint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.