Package com.igormaznitsa.jbbp.io
Class AbstractMappedClassFieldObserver
java.lang.Object
com.igormaznitsa.jbbp.io.AbstractMappedClassFieldObserver
- Direct Known Subclasses:
JBBPOut
Abstract class to collect, order and process all fields in a mapped class.
since 1.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidonArrayEnd(Object obj, Field field, Bin annotation) Notification of end of "array" field.protected voidonArrayStart(Object obj, Field field, Bin annotation, int length) Notification of start of "array" field.protected voidonFieldBits(Object obj, Field field, Bin annotation, JBBPBitNumber bitNumber, int value) Notification about bit field.protected voidonFieldBool(Object obj, Field field, Bin annotation, boolean value) Notification about boolean field.protected voidonFieldByte(Object obj, Field field, Bin annotation, boolean signed, int value) Notification about byte field.protected voidNotification about custom field.protected voidonFieldDouble(Object obj, Field field, Bin annotation, double value) Notification about double field.protected voidonFieldFloat(Object obj, Field field, Bin annotation, float value) Notification about float field.protected voidonFieldInt(Object obj, Field field, Bin annotation, int value) Notification about integer field.protected voidonFieldLong(Object obj, Field field, Bin annotation, long value) Notification about long field.protected voidonFieldShort(Object obj, Field field, Bin annotation, boolean signed, int value) Notification about short field.protected voidonFieldString(Object obj, Field field, Bin annotation, String value) Notification about string field.protected voidonFieldUInt(Object obj, Field field, Bin annotation, int value) Notification about unsigned integer field.protected voidonStructEnd(Object obj, Field field, Bin annotation) Notification of end of "structure" field.protected voidonStructStart(Object obj, Field field, Bin annotation) Notification of start of "structure" field.protected voidprocessObject(Object obj, Field field, BinAnnotationWrapper binAnnotationWrapper, BinFieldFilter binFieldFilter, Object customFieldProcessor) Process an object.protected voidprocessObject(Object obj, Field field, BinAnnotationWrapper binAnnotationWrapper, Object customFieldProcessor) Process an object.protected voidprocessObjectField(Object obj, MappedFieldRecord fieldRecord, Bin annotation, Object customFieldProcessor) Inside auxiliary method to process a field of an object.protected voidprocessObjectField(Object obj, MappedFieldRecord fieldRecord, Bin annotation, Object customFieldProcessor, BinFieldFilter binFieldFilter) Inside auxiliary method to process a field of an object.
-
Constructor Details
-
AbstractMappedClassFieldObserver
public AbstractMappedClassFieldObserver()
-
-
Method Details
-
processObject
protected void processObject(Object obj, Field field, BinAnnotationWrapper binAnnotationWrapper, Object customFieldProcessor) Process an object. It works only with classes and fields marked by Bin annotations. It doesn't process classes and fields marked by DslBinCustom annotations.- Parameters:
obj- an object which is an instance of a mapped class, must not be nullfield- a field where the object has been found, it can be null for first callbinAnnotationWrapper- wrapper to replace Bin annotation values for processing fields, can be null to be ignoredcustomFieldProcessor- a processor for custom fields, it can be null- Since:
- 2.0.2
- See Also:
-
processObject
protected void processObject(Object obj, Field field, BinAnnotationWrapper binAnnotationWrapper, BinFieldFilter binFieldFilter, Object customFieldProcessor) Process an object. It works only with classes and fields marked by Bin annotations. It doesn't process classes and fields marked by DslBinCustom annotations.- Parameters:
obj- an object which is an instance of a mapped class, must not be nullfield- a field where the object has been found, it can be null for first callbinAnnotationWrapper- wrapper to replace Bin annotation values for processing fields, can be null to be ignoredbinFieldFilter- filter for mapped fields, allows to exclude some of them, can be nullcustomFieldProcessor- a processor for custom fields, it can be null- Since:
- 2.0.4
- See Also:
-
processObjectField
protected void processObjectField(Object obj, MappedFieldRecord fieldRecord, Bin annotation, Object customFieldProcessor) Inside auxiliary method to process a field of an object.- Parameters:
obj- the object which field under processing, must not be nullfieldRecord- internal record about the field, must not be nullannotation- the annotation to be used as data source about the field, must not be nullcustomFieldProcessor- an object which will be provided for processing of custom fields, must not be null if object contains custom fields- Since:
- 2.0.4
-
processObjectField
protected void processObjectField(Object obj, MappedFieldRecord fieldRecord, Bin annotation, Object customFieldProcessor, BinFieldFilter binFieldFilter) Inside auxiliary method to process a field of an object.- Parameters:
obj- the object which field under processing, must not be nullfieldRecord- internal record about the field, must not be nullannotation- the annotation to be used as data source about the field, must not be nullcustomFieldProcessor- an object which will be provided for processing of custom fields, must not be null if object contains custom fieldsbinFieldFilter- filter allows to exclude some fields from process, can be null- Since:
- 2.0.4
-
onFieldCustom
protected void onFieldCustom(Object obj, Field field, Bin annotation, Object customFieldProcessor, Object value) Notification about custom field.- Parameters:
obj- the object instance, must not be nullfield- the custom field, must not be nullannotation- the annotation for the field, must not be nullcustomFieldProcessor- processor for custom fields, must not be nullvalue- the value of the custom field
-
onFieldBits
protected void onFieldBits(Object obj, Field field, Bin annotation, JBBPBitNumber bitNumber, int value) Notification about bit field.- Parameters:
obj- the object instance, must not be nullfield- the field, must not be nullannotation- the annotation for field, must not be nullbitNumber- number of bits for the field, must not be nullvalue- the value of the field
-
onFieldBool
Notification about boolean field.- Parameters:
obj- the object instance, must not be nullfield- the field, must not be nullannotation- the annotation for field, must not be nullvalue- the value of the field
-
onFieldByte
Notification about byte field.- Parameters:
obj- the object instance, must not be nullfield- the field, must not be nullannotation- the annotation for field, must not be nullsigned- flag shows that the field id signedvalue- the value of the field
-
onFieldShort
Notification about short field.- Parameters:
obj- the object instance, must not be nullfield- the field, must not be nullannotation- the annotation for field, must not be nullsigned- flag shows that the field id signedvalue- the value of the field
-
onFieldInt
Notification about integer field.- Parameters:
obj- the object instance, must not be nullfield- the field, must not be nullannotation- the annotation for field, must not be nullvalue- the value of the field
-
onFieldUInt
Notification about unsigned integer field.- Parameters:
obj- the object instance, must not be nullfield- the field, must not be nullannotation- the annotation for field, must not be nullvalue- the value of the field- Since:
- 2.0.4
-
onFieldFloat
Notification about float field.- Parameters:
obj- the object instance, must not be nullfield- the field, must not be nullannotation- the annotation for field, must not be nullvalue- the value of the field- Since:
- 1.4.0
-
onFieldString
Notification about string field.- Parameters:
obj- the object instance, must not be nullfield- the field, must not be nullannotation- the annotation for field, must not be nullvalue- the value of the field- Since:
- 1.4.0
-
onFieldDouble
Notification about double field.- Parameters:
obj- the object instance, must not be nullfield- the field, must not be nullannotation- the annotation for field, must not be nullvalue- the value of the field- Since:
- 1.4.0
-
onFieldLong
Notification about long field.- Parameters:
obj- the object instance, must not be nullfield- the field, must not be nullannotation- the annotation for field, must not be nullvalue- the value of the field
-
onStructStart
Notification of start of "structure" field.- Parameters:
obj- the object instance, must not be nullfield- the field, must not be nullannotation- the annotation for field, must not be null
-
onStructEnd
Notification of end of "structure" field.- Parameters:
obj- the object instance, must not be nullfield- the field, must not be nullannotation- the annotation for field, must not be null
-
onArrayStart
Notification of start of "array" field.- Parameters:
obj- the object instance, must not be nullfield- the field, must not be nullannotation- the annotation for field, must not be nulllength- the length of the array
-
onArrayEnd
Notification of end of "array" field.- Parameters:
obj- the object instance, must not be nullfield- the field, must not be nullannotation- the annotation for the field, must not be null
-