Decoder/Encoder获取更多信息

This commit is contained in:
Redkale
2018-07-16 19:16:10 +08:00
parent 28e72f9883
commit 4a4bade180
10 changed files with 76 additions and 0 deletions

View File

@@ -101,4 +101,12 @@ public final class ArrayDecoder<T> implements Decodeable<Reader, T[]> {
return type; return type;
} }
public Type getComponentType() {
return componentType;
}
public Decodeable<Reader, T> getDecoder() {
return decoder;
}
} }

View File

@@ -97,4 +97,13 @@ public final class ArrayEncoder<T> implements Encodeable<Writer, T[]> {
public Type getType() { public Type getType() {
return type; return type;
} }
public Type getComponentType() {
return componentType;
}
public Encodeable<Writer, Object> getEncoder() {
return encoder;
}
} }

View File

@@ -95,4 +95,12 @@ public final class CollectionDecoder<T> implements Decodeable<Reader, Collection
return type; return type;
} }
public Type getComponentType() {
return componentType;
}
public Decodeable<Reader, T> getDecoder() {
return decoder;
}
} }

View File

@@ -86,4 +86,9 @@ public final class CollectionEncoder<T> implements Encodeable<Writer, Collection
public Type getType() { public Type getType() {
return type; return type;
} }
public Encodeable<Writer, Object> getEncoder() {
return encoder;
}
} }

View File

@@ -114,4 +114,20 @@ public final class MapDecoder<K, V> implements Decodeable<Reader, Map<K, V>> {
return this.type; return this.type;
} }
public Type getKeyType() {
return keyType;
}
public Type getValueType() {
return valueType;
}
public Decodeable<Reader, K> getKeyDecoder() {
return keyDecoder;
}
public Decodeable<Reader, V> getValueDecoder() {
return valueDecoder;
}
} }

View File

@@ -86,4 +86,13 @@ public final class MapEncoder<K, V> implements Encodeable<Writer, Map<K, V>> {
public Type getType() { public Type getType() {
return type; return type;
} }
public Encodeable<Writer, K> getKeyencoder() {
return keyencoder;
}
public Encodeable<Writer, V> getValencoder() {
return valencoder;
}
} }

View File

@@ -259,6 +259,10 @@ public final class ObjectDecoder<R extends Reader, T> implements Decodeable<R, T
return this.type; return this.type;
} }
public DeMember[] getMembers() {
return Arrays.copyOf(members, members.length);
}
@Override @Override
public String toString() { public String toString() {
return "ObjectDecoder{" + "type=" + type + ", members=" + Arrays.toString(members) + '}'; return "ObjectDecoder{" + "type=" + type + ", members=" + Arrays.toString(members) + '}';

View File

@@ -157,6 +157,10 @@ public final class ObjectEncoder<W extends Writer, T> implements Encodeable<W, T
return this.type; return this.type;
} }
public EnMember[] getMembers() {
return Arrays.copyOf(members, members.length);
}
@Override @Override
public String toString() { public String toString() {
return "ObjectEncoder{" + "type=" + type + ", members=" + Arrays.toString(members) + '}'; return "ObjectEncoder{" + "type=" + type + ", members=" + Arrays.toString(members) + '}';

View File

@@ -91,4 +91,12 @@ public final class StreamDecoder<T> implements Decodeable<Reader, Stream<T>> {
return type; return type;
} }
public Type getComponentType() {
return componentType;
}
public Decodeable<Reader, T> getDecoder() {
return decoder;
}
} }

View File

@@ -87,4 +87,9 @@ public final class StreamEncoder<T> implements Encodeable<Writer, Stream<T>> {
public Type getType() { public Type getType() {
return type; return type;
} }
public Encodeable<Writer, Object> getEncoder() {
return encoder;
}
} }