ConvertType

This commit is contained in:
redkale
2024-06-12 15:40:34 +08:00
parent 3060b99a89
commit 0f110fca33
2 changed files with 7 additions and 7 deletions

View File

@@ -216,15 +216,15 @@ public abstract class ConvertFactory<R extends Reader, W extends Writer> {
public static Convert findConvert(ConvertType type) {
Objects.requireNonNull(type);
if (type == ConvertType.JSON) {
if (type == ConvertType.JSON || type.contains(ConvertType.JSON)) {
return JsonConvert.root();
}
if (type == ConvertType.BSON) {
return BsonConvert.root();
}
if (type == ConvertType.PROTOBUF) {
if (type == ConvertType.PROTOBUF || type.contains(ConvertType.PROTOBUF)) {
return ProtobufConvert.root();
}
if (type == ConvertType.BSON || type.contains(ConvertType.BSON)) {
return BsonConvert.root();
}
Iterator<ConvertProvider> it = ServiceLoader.load(ConvertProvider.class).iterator();
RedkaleClassLoader.putServiceLoader(ConvertProvider.class);
@@ -232,7 +232,7 @@ public abstract class ConvertFactory<R extends Reader, W extends Writer> {
ConvertProvider cl = it.next();
RedkaleClassLoader.putReflectionPublicConstructors(
cl.getClass(), cl.getClass().getName());
if (cl.type() == ConvertType.PROTOBUF) {
if (type.contains(cl.type())) {
return cl.convert();
}
}

View File

@@ -23,7 +23,7 @@ import org.redkale.convert.ConvertType;
public @interface ResourceProducer {
/**
* {@link org.redkale.mq.MessageAgent}对象对应名称
* {@link org.redkale.mq.spi.MessageAgent}对象对应名称
*
* @return MQ名称
*/