Package com.illumon.iris.db.tables
Class TypeRenamingPersistentInputStream
java.lang.Object
com.fishlib.dataobjects.persistence.WObjectInputStream
com.fishlib.dataobjects.persistence.PersistentInputStream
com.illumon.iris.db.tables.TypeRenamingPersistentInputStream
- All Implemented Interfaces:
com.fishlib.dataobjects.persistence.WObjectStreamConstants,Closeable,DataInput,ObjectInput,AutoCloseable
public class TypeRenamingPersistentInputStream
extends com.fishlib.dataobjects.persistence.PersistentInputStream
Enterprise makes extensive use of Java serialization through
WObjectOutputStream and WObjectInputStream, which
use a custom encoding to write data. The consequence of this is that we'll end up with encoded
type names. This class allows clients to attempt to dynamically rewrite certain type names
at load time.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis is an exact copy of com.fishlib.dataobjects.persistence.WObjectInputConversions.RenamingConversion with convertClassDescriptor implemented like convertResolveClassDescriptorNested classes/interfaces inherited from class com.fishlib.dataobjects.persistence.WObjectInputStream
com.fishlib.dataobjects.persistence.WObjectInputStream.ObjectConverter, com.fishlib.dataobjects.persistence.WObjectInputStream.WrappedObjectInputStream -
Field Summary
FieldsFields inherited from class com.fishlib.dataobjects.persistence.WObjectInputStream
in_Fields inherited from interface com.fishlib.dataobjects.persistence.WObjectStreamConstants
ADD_CLASS, ADD_COLUMN_SET_CLASS, ADD_ENUM, ADD_ENUM_LONG, ADO_ARRAY_TYPE, ARRAY_TYPE, BOOLEAN_TYPE, BYTE_ARRAY_TYPE, BYTE_TYPE, DATE_TYPE, DOUBLE_ARRAY_TYPE, DOUBLE_TYPE, FLOAT_ARRAY_TYPE, FLOAT_TYPE, INT_ARRAY_TYPE, INTEGER_TYPE, KNOWN_ENUM, KNOWN_ENUM_LONG, LINKED_MAP_TYPE, LINKED_SET_TYPE, LONG_ARRAY_TYPE, LONG_STRING_TYPE, LONG_TYPE, MAP_TYPE, NULL_TYPE, OBJECT_TYPE, SET_TYPE, STRING_ARRAY_TYPE, STRING_TYPE, TREE_MAP_TYPE, TREE_SET_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.fishlib.dataobjects.persistence.WObjectInputStream.ObjectConvertergetReaderForType(String typeString) There are a few different paths within WObjectInputStream that resolve packages to real classes, this one handles the path when the object is plainly encoded in the stream.protected ObjectStreamClassstatic UnaryOperator<String>setTypeRenamer(UnaryOperator<String> typeRenamer) Set a type renamer that returns a renamed type string or returns null if no renaming is needed.Methods inherited from class com.fishlib.dataobjects.persistence.PersistentInputStream
getColumnSet, getConversionSchemaMethods inherited from class com.fishlib.dataobjects.persistence.WObjectInputStream
available, close, getClassForType, read, read, read, readBoolean, readByte, readChar, readClassDescriptorOverride, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readObject, readShort, readUnsignedByte, readUnsignedShort, readUTF, skip, skipBytes
-
Field Details
-
SHADOW_PREFIX
- See Also:
-
-
Constructor Details
-
TypeRenamingPersistentInputStream
public TypeRenamingPersistentInputStream(@NotNull InputStream in, @NotNull ClassLoader classLoader) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
-
Method Details
-
setTypeRenamer
Set a type renamer that returns a renamed type string or returns null if no renaming is needed.- Parameters:
typeRenamer- type renaming algorithm- Returns:
- previous typeRenamer
- ImplNote:
- static state is used over instance state because the virtual methods that execute the type renaming are called in the super constructor, which must occur before subclass instance state is initialized.
-
resolveClassDescriptorOverride
protected ObjectStreamClass resolveClassDescriptorOverride(@NotNull ObjectStreamClass input) throws ClassNotFoundException - Overrides:
resolveClassDescriptorOverridein classcom.fishlib.dataobjects.persistence.WObjectInputStream- Throws:
ClassNotFoundException
-
getReaderForType
protected com.fishlib.dataobjects.persistence.WObjectInputStream.ObjectConverter getReaderForType(@NotNull String typeString) throws ClassNotFoundException There are a few different paths within WObjectInputStream that resolve packages to real classes, this one handles the path when the object is plainly encoded in the stream.- Overrides:
getReaderForTypein classcom.fishlib.dataobjects.persistence.WObjectInputStream- Parameters:
typeString- the input type being read- Returns:
- an
WObjectInputStream.ObjectConverter - Throws:
ClassNotFoundException- if the conversion was not possible
-