ConvertType
This commit is contained in:
@@ -216,15 +216,15 @@ public abstract class ConvertFactory<R extends Reader, W extends Writer> {
|
|||||||
|
|
||||||
public static Convert findConvert(ConvertType type) {
|
public static Convert findConvert(ConvertType type) {
|
||||||
Objects.requireNonNull(type);
|
Objects.requireNonNull(type);
|
||||||
if (type == ConvertType.JSON) {
|
if (type == ConvertType.JSON || type.contains(ConvertType.JSON)) {
|
||||||
return JsonConvert.root();
|
return JsonConvert.root();
|
||||||
}
|
}
|
||||||
if (type == ConvertType.BSON) {
|
if (type == ConvertType.PROTOBUF || type.contains(ConvertType.PROTOBUF)) {
|
||||||
return BsonConvert.root();
|
|
||||||
}
|
|
||||||
if (type == ConvertType.PROTOBUF) {
|
|
||||||
return ProtobufConvert.root();
|
return ProtobufConvert.root();
|
||||||
}
|
}
|
||||||
|
if (type == ConvertType.BSON || type.contains(ConvertType.BSON)) {
|
||||||
|
return BsonConvert.root();
|
||||||
|
}
|
||||||
|
|
||||||
Iterator<ConvertProvider> it = ServiceLoader.load(ConvertProvider.class).iterator();
|
Iterator<ConvertProvider> it = ServiceLoader.load(ConvertProvider.class).iterator();
|
||||||
RedkaleClassLoader.putServiceLoader(ConvertProvider.class);
|
RedkaleClassLoader.putServiceLoader(ConvertProvider.class);
|
||||||
@@ -232,7 +232,7 @@ public abstract class ConvertFactory<R extends Reader, W extends Writer> {
|
|||||||
ConvertProvider cl = it.next();
|
ConvertProvider cl = it.next();
|
||||||
RedkaleClassLoader.putReflectionPublicConstructors(
|
RedkaleClassLoader.putReflectionPublicConstructors(
|
||||||
cl.getClass(), cl.getClass().getName());
|
cl.getClass(), cl.getClass().getName());
|
||||||
if (cl.type() == ConvertType.PROTOBUF) {
|
if (type.contains(cl.type())) {
|
||||||
return cl.convert();
|
return cl.convert();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import org.redkale.convert.ConvertType;
|
|||||||
public @interface ResourceProducer {
|
public @interface ResourceProducer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link org.redkale.mq.MessageAgent}对象对应名称
|
* {@link org.redkale.mq.spi.MessageAgent}对象对应名称
|
||||||
*
|
*
|
||||||
* @return MQ名称
|
* @return MQ名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user