cc0a0b42 bd84 3aa8 1865 36f1ab6d3fcf - akesseler/Plexdata.Utilities.Templates GitHub Wiki
Acts as default respectively as fallback custom type converter.
System.Object
Plexdata.Utilities.Formatting.Helpers.DefaultSerializer
Namespace: Plexdata.Utilities.Formatting.Helpers
Assembly: Plexdata.Utilities.Templates (in Plexdata.Utilities.Templates.dll) Version: 1.0.0
C#
internal class DefaultSerializer : IArgumentSerializer
The DefaultSerializer type exposes the following members.
Name | Description | |
---|---|---|
![]() |
DefaultSerializer | Default construction. |
Name | Description | |
---|---|---|
![]() |
Recursions | The depth of recursions for serialization. |
Name | Description | |
---|---|---|
![]() |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() |
GetHashCode | Serves as the default hash function. (Inherited from Object.) |
![]() |
GetProperties | Loads affected properties from provided type> |
![]() |
GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() |
IsProcessable | Validates whether a particular property can be processed. |
![]() |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() |
Render | Renders the value into result. |
![]() |
Serialize | Converts the argument into a string. |
![]() |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
![]() |
CanExpand | Determines whether the argument can be expanded. (Defined by ArgumentExtension.) |
![]() |
IsSystemType | Determines whether an argument is of a build-in system type. (Defined by ArgumentExtension.) |
This class represents the default or in other words the fallback converter for any custom type.
Task of this class is the conversion of custom types into their flat string representation. Flat means in detail that property parsing is not done recursively. See enumeration below to get an impression about additional rules.
- Each top-level object is surrounded by square brackets (
[...]
). - Each affected property is formatted as combination of property name and property value (
<label>: <value>
). - Each combination of property name and value is separated by a semicolon followed by one space (
;
). - Strings as well as single characters are surrounded by double quotes (
"some string"
). - Values of properties of type Char that represent a control character are converted into their hexadecimal unicode representation (
\u0000
). - Objects with a value of
null
are converted into the string null. - Objects of type
class
are serialized by their own method ToString(). Additionally, such classes are put into surrounding square brackets ([...]
).
Plexdata.Utilities.Formatting.Helpers Namespace
Plexdata.Utilities.Formatting.Interfaces.IArgumentSerializer