Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* $Id: Converter.java 1232 2014-07-28 06:44:55Z t-nakaguchi $
*
* This is a program for Language Grid Core Node. This combines multiple language resources and provides composite language services.
* Copyright (C) 2005-2008 NICT Language Grid Project.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
package jp.go.nict.langrid.commons.beanutils;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jp.go.nict.langrid.commons.lang.ClassUtil;
import jp.go.nict.langrid.commons.lang.reflect.GenericsUtil;
import jp.go.nict.langrid.commons.lang.reflect.TypeUtil;
import jp.go.nict.langrid.commons.rpc.intf.ComponentConverter;
import jp.go.nict.langrid.commons.transformer.FromToStringTransformer;
import jp.go.nict.langrid.commons.transformer.ObjectToEnumTransformer;
import jp.go.nict.langrid.commons.transformer.StringToEnumTransformer;
import jp.go.nict.langrid.commons.transformer.TransformationException;
import jp.go.nict.langrid.commons.transformer.Transformer;
import jp.go.nict.langrid.commons.transformer.Transformers;
import jp.go.nict.langrid.commons.util.MapUtil;
import jp.go.nict.langrid.commons.util.Pair;
import jp.go.nict.langrid.repackaged.net.arnx.jsonic.util.Base64;
/**
*
*
* @author $Author: t-nakaguchi $
* @version $Revision: 1232 $
*/
public class Converter{
/**
*
*
*/
public Converter(){
// BeanUtilsのURLConverterは使わない
addFromToStringConverter(URL.class);
}
/**
*
*
*/
public void addArrayConversion(Class dst)
throws IllegalArgumentException
{
if(!dst.isArray()) throw new IllegalArgumentException("dst must be array class.");
}
/**
*
*
*/
@SuppressWarnings({"unchecked", "rawtypes"})
public void addArrayConversion(Class src, Class dst)
throws IllegalArgumentException
{
if(!src.isArray()) throw new IllegalArgumentException(
"src must be an array class.");
if(!dst.isArray()) throw new IllegalArgumentException(
"dst must be an array class.");
transformers.addTransformer(
src, dst, new ArrayToArrayTransformer(this, dst));
}
/**
*
*
*/
public > void addEnumConversion(Class dst)
throws IllegalArgumentException
{
Transformer