public static final class AtomicSerial.Factory extends Object
Modifier and Type | Method and Description |
---|---|
static <T> T |
instantiate(Class<T> type,
AtomicSerial.GetArg arg)
Convenience method for testing implementing class constructor
signature compliance.
|
static AtomicSerial.ReadObject |
streamReader(Class<?> streamClass)
Convenience method to test retrieval of a new ReadObject instance from
a class static method annotated with @ReadInput
|
public static <T> T instantiate(Class<T> type, AtomicSerial.GetArg arg) throws IOException
De-serializers are free to implement higher performance instantiation that complies with this contract.
Only public and package default constructors can be called by de-serializers. Package default constructors have been provided to prevent implementations from polluting public api, but should be treated as public constructors.
Constructors with private visibility cannot be called.
Constructors with protected visibility can only be called by subclasses, not de-serializers.
T
- AtomicSerial implementation type.type
- AtomicSerial implementing class.arg
- GetArg caller sensitive arguments used by implementing constructor.InvalidClassException
- if constructor is non compliant
or doesn't exist.InvalidObjectException
- if invariant check failsNullPointerException
- if arg or type is null.IOException
public static AtomicSerial.ReadObject streamReader(Class<?> streamClass) throws IOException
streamClass
- IOException
AtomicSerial.ReadInput
Copyright © 2016–2018 The Apache Software Foundation. All rights reserved.