Package hec.io
Class AsciiSerializer
java.lang.Object
hec.io.AsciiSerializer
- All Implemented Interfaces:
AsciiSerializableConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static booleanprotected static intprotected BufferedWriterprotected StringBufferprotected static booleanprotected StringFields inherited from interface hec.io.AsciiSerializableConstants
ARRAY, BEGIN, BEGIN_ARRAY, BEGIN_COLLECTION, BEGIN_ENUM_TYPE, BEGIN_HASH, BEGIN_MAP, BEGIN_OBJECT, BEGIN_VECTOR, BOOLEAN, BOOLEAN_TYPE, BYTE, BYTE_TYPE, CHAR, CHAR_TYPE, CLASS, DELIM, DOUBLE, DOUBLE_TYPE, DSSFILEPATH, DSSPATH, END, END_ARRAY, END_COLLECTION, END_ENUM_TYPE, END_HASH, END_MAP, END_OBJECT, END_VECTOR, FIELD, FILEPATH, FLOAT, FLOAT_TYPE, HEADER, ID, INT, INT_TYPE, LONG, LONG_TYPE, NAN, NEGATIVE_INFINITY, OBJECT_ARRAY, OLD_BEGIN, OLD_BEGIN_ARRAY, OLD_BEGIN_HASH, OLD_BEGIN_OBJECT, OLD_BEGIN_VECTOR, OLD_END, OLD_END_ARRAY, OLD_END_HASH, OLD_END_OBJECT, OLD_END_VECTOR, OLD_FIELD, OLD_REFERENCE, OLD_STRING, OLD_VALUE, POSITIVE_INFINITY, REFERENCE, SHORT, SHORT_TYPE, STRING, VALUE, VOID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected IntegeraddTableObject(Object obj) Returns an Integer holding the index value for the given objectprotected voiddecrease indentation in fileprotected ObjectgetFieldObject(AsciiSerializable obj, Field field, int mods) protected Integerreturns an Integer holding the index value for the given object, null if object is not in tableprotected voidIncrease indentation in filevoidreset(BufferedWriter out) reset this Serializer to a new BufferedWriterbooleanserializeObject(Object obj) Stores an object in ascii format to a file.protected voidwriteArray(Object obj) write an array objectprotected voidwriteEnumData(Object enumObject) protected booleanwriteField(AsciiSerializable obj, Field field) protected booleanwriteField(Field fld, Object obj) protected voidwriteFields(AsciiSerializable obj, Field[] declaredFields) protected voidprotected voidwriteObject(Object obj) Stores an object in ascii format to a fileprotected booleanwriteObjectFields(Object obj) Writes all accessible fields of the given object, recursing into contained objects.protected voidwrite a PairedValues Objectprotected voidprotected voidwriteTypeParamLine(String type, String param)
-
Field Details
-
_out
-
_strIndent
-
_outLine
-
_maxArraySize
protected static int _maxArraySize -
_formatFile
protected static boolean _formatFile -
_showTiming
protected static boolean _showTiming
-
-
Constructor Details
-
AsciiSerializer
-
-
Method Details
-
reset
reset this Serializer to a new BufferedWriter -
serializeObject
Stores an object in ascii format to a file. ignoring arrays and primitives for now -
writeHeader
protected void writeHeader() -
writeObjectFields
Writes all accessible fields of the given object, recursing into contained objects.- Throws:
IOException
-
writeField
- Throws:
IOException
-
getTableObjectIndex
returns an Integer holding the index value for the given object, null if object is not in table -
addTableObject
Returns an Integer holding the index value for the given object -
incrementRecursion
protected void incrementRecursion()Increase indentation in file -
decrementRecursion
protected void decrementRecursion()decrease indentation in file -
writeObject
Stores an object in ascii format to a file- Throws:
IOException
-
writePairedValues
write a PairedValues Object- Throws:
IOException
-
getFieldObject
-
writeTypeParamLine
- Throws:
IOException
-
writeTextFileReference
- Throws:
IOException
-
writeFields
- Throws:
IOException
-
writeField
- Throws:
IOException
-
writeArray
write an array object- Throws:
IOException
-
writeEnumData
- Throws:
IOException
-