public class ExportField extends FieldEntry
Modifier and Type | Field and Description |
---|---|
private java.util.function.Supplier<BaseDataType> |
data
The data to output to the stream.
|
private BaseDataType |
savedVar
Resolved variable value.
|
Constructor and Description |
---|
ExportField()
Default constructor which is necessary to restores instance when it is transferred via
the network.
|
ExportField(BaseDataType val)
Generate output formatted using the
toStringExport method of the associated
type. |
ExportField(boolean val)
Generate output formatted using the
toStringExport method of the associated
type. |
ExportField(double val)
Generate output formatted using the
toStringExport method of the associated
type. |
ExportField(int val)
Generate output formatted using the
toStringExport method of the associated
type. |
ExportField(Resolvable val)
Generate output formatted using the
toStringExport method of the associated
type. |
ExportField(java.lang.String val)
Generate output formatted using the
toStringExport method of the associated
type. |
ExportField(java.util.function.Supplier<BaseDataType> val)
Generate output formatted using the
toStringExport method of the associated
type. |
Modifier and Type | Method and Description |
---|---|
void |
output(Stream out)
Renders the contained field definition to the given stream.
|
void |
readExternal(java.io.ObjectInput in)
Replacement for the default object reading method.
|
void |
resolveData()
Notify instance that it is about to be transferred so all resolvable data should be
resolved and prepared for sending via network.
|
void |
writeExternal(java.io.ObjectOutput out)
Replacement for the default object writing method.
|
toArray
private java.util.function.Supplier<BaseDataType> data
private BaseDataType savedVar
public ExportField()
public ExportField(int val)
toStringExport
method of the associated
type.val
- The value to be output.public ExportField(double val)
toStringExport
method of the associated
type.val
- The value to be output.public ExportField(boolean val)
toStringExport
method of the associated
type.val
- The value to be output.public ExportField(java.lang.String val)
toStringExport
method of the associated
type.val
- The value to be output.public ExportField(BaseDataType val)
toStringExport
method of the associated
type.val
- The value to be output.public ExportField(Resolvable val)
toStringExport
method of the associated
type. This form is used for field references.val
- The value to be output.public ExportField(java.util.function.Supplier<BaseDataType> val)
toStringExport
method of the associated
type. This form is used for complex expressions whose evaluation bmust be deferred.val
- The function which supplies the value to be output.public void output(Stream out) throws ErrorConditionException
output
in class FieldEntry
out
- The stream to which the field should be rendered.ErrorConditionException
- On any error during I/O.public void resolveData()
resolveData
in class FieldEntry
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
in
- The input source from which fields will be restored.java.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If payload can't be instantiated.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
out
- The output destination to which fields will be saved.java.io.IOException
- In case of I/O errors.