36.2. 중복 유형 처리

중복 유형 변환기를 추가하면 발생해야 하는 작업을 구성할 수 있습니다.

TypeConverterRegistry ( 36.3절. “주석을 사용하여 유형 구현”참조)에서 다음 코드를 사용하여 작업을 Override,Ignore 또는 Fail 로 설정할 수 있습니다.

typeconverterregistry = camelContext.getTypeConverter()
// Define the behaviour if the TypeConverter already exists
typeconverterregistry.setTypeConverterExists(TypeConverterExists.Override);

이 코드의 재정의 는 요구 사항에 따라 Ignore 또는 Fail 로 교체할 수 있습니다.

36.2.1. TypeConverterExists 클래스

TypeConverterExists 클래스는 다음 명령으로 구성됩니다.

package org.apache.camel;

import javax.xml.bind.annotation.XmlEnum;

/**
 * What to do if attempting to add a duplicate type converter
 *
 * @version
 */
@XmlEnum
public enum TypeConverterExists {

    Override, Ignore, Fail

}