Class SimpleClassLoaderMarshaller
- java.lang.Object
-
- org.wildfly.clustering.marshalling.protostream.SimpleClassLoaderMarshaller
-
- All Implemented Interfaces:
ClassLoaderMarshaller,FieldSetMarshaller<ClassLoader,ClassLoader>
public class SimpleClassLoaderMarshaller extends Object implements ClassLoaderMarshaller
- Author:
- Paul Ferraro
-
-
Constructor Summary
Constructors Constructor Description SimpleClassLoaderMarshaller(ClassLoader loader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassLoadergetBuilder()Returns a builder for use withFieldSetMarshaller.readField(ProtoStreamReader, int, Object).intgetFields()Returns the number of fields written by this marshaller.ClassLoaderreadField(ProtoStreamReader reader, int index, ClassLoader loader)Reads a single field from the specified reader at the specified index.voidwriteFields(ProtoStreamWriter writer, int startIndex, ClassLoader value)Writes the set of fields from the specified object to the specified writer beginning at the specified index.
-
-
-
Constructor Detail
-
SimpleClassLoaderMarshaller
public SimpleClassLoaderMarshaller(ClassLoader loader)
-
-
Method Detail
-
getBuilder
public ClassLoader getBuilder()
Description copied from interface:FieldSetMarshallerReturns a builder for use withFieldSetMarshaller.readField(ProtoStreamReader, int, Object). May return a shared instance, if the builder type is immutable, or a new instance, if the builder is mutable.- Specified by:
getBuilderin interfaceFieldSetMarshaller<ClassLoader,ClassLoader>- Returns:
- a builder.
-
getFields
public int getFields()
Description copied from interface:FieldSetMarshallerReturns the number of fields written by this marshaller.- Specified by:
getFieldsin interfaceFieldSetMarshaller<ClassLoader,ClassLoader>- Returns:
- a positive number
-
readField
public ClassLoader readField(ProtoStreamReader reader, int index, ClassLoader loader) throws IOException
Description copied from interface:FieldSetMarshallerReads a single field from the specified reader at the specified index.- Specified by:
readFieldin interfaceFieldSetMarshaller<ClassLoader,ClassLoader>- Parameters:
reader- a ProtoStream readerindex- the field indexloader- the builder to be populated with the read field- Returns:
- the builder containing the read field
- Throws:
IOException- if the field could not be read
-
writeFields
public void writeFields(ProtoStreamWriter writer, int startIndex, ClassLoader value) throws IOException
Description copied from interface:FieldSetMarshallerWrites the set of fields from the specified object to the specified writer beginning at the specified index.- Specified by:
writeFieldsin interfaceFieldSetMarshaller<ClassLoader,ClassLoader>- Parameters:
writer- a ProtoStream writerstartIndex- the start index for the embedded fieldsvalue- the value to be written- Throws:
IOException- if the value could not be written
-
-