Commit b0f41d28 authored by Noel Alonso's avatar Noel Alonso
Browse files

Elimina configuración de orika

Por cambio a MapStruct
parent 1614a8d4
Loading
Loading
Loading
Loading
+0 −59
Original line number Diff line number Diff line
package es.redmic.timeseriesview.config;

/*-
 * #%L
 * Time series view
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * 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.
 * #L%
 */

import org.joda.time.DateTime;
import org.springframework.stereotype.Component;

import es.redmic.viewlib.config.MapperScanBeanBase;
import es.redmic.viewlib.config.MapperScanBeanItfc;
import ma.glasnost.orika.converter.builtin.PassThroughConverter;
import ma.glasnost.orika.impl.DefaultMapperFactory;

@Component
public class MapperScanBean extends MapperScanBeanBase implements MapperScanBeanItfc {

	public MapperScanBean() {
		super();
	}

	@Override
	protected void addDefaultActions() {

		addConverter(new PassThroughConverter(DateTime.class));
	}

	@Override
	protected void addObjectFactory() {

	}

	public MapperScanBean build() {

		if (factory == null) {

			factory = new DefaultMapperFactory.Builder().build();
			addObjectFactory();
			addDefaultActions();
		}
		return this;
	}
}