* SerializationCodeGenerator.cs
XmlSerializationWriterInterpreter.cs : fixed bug #419973.
Sometimes implicit operators could involve and it affects on
typecasting. It's simple for code generator, but very bad for
reflection.
* XmlSerializerTestClasses.cs, XmlSerializerTests.cs:
added test for bug #419973.
svn path=/trunk/mcs/; revision=112103
* XmlSerializationReaderInterpreter.cs, MapCodeGenerator.cs,
SerializationCodeGenerator.cs : fixed bug #378696.
Default value should not be filled during deserialization, and
default values for DateTime/TimeSpan/DateTimeOffset should not be
output as raw string in generated code.
* XmlSerializerTestClasses.cs, DeserializeTests.cs,
ComplexDataStructure.cs : added test for bug #378696.
Fixed couple of wrong tests that expects default values filled
during deserialization.
svn path=/trunk/mcs/; revision=104983
* XmlSerializationReaderInterpreter.cs,
XmlSerializationWriterInterpreter.cs: Properly handle nullable enum
values.
* SerializationCodeGenerator.cs: Properly handle nullable enum values.
Don't generate read flags for text collectors (avoid var not used
warning).
* XmlReflectionImporter.cs: Assign the MappedType to text collector
members. It is needed when the member is an enum.
svn path=/trunk/mcs/; revision=99512
* XmlSerializerTests.cs : added deserialization test for
XmlSchemaProviderAttribute use.
* XmlReflectionImporterTests.cs : added test for conclict resolution
between defaultNamespace and XmlSchemaProvider() namespace.
* XmlSchemaExporterTests.cs : use Infoset() comparison.
* XmlTypeMapping.cs : Namespace and XmlTypeNamespace could be
different when an explicit namespace is specified (e.g. at
XmlReflectionImporter.ctor).
* SerializationCodeGenerator.cs,
XmlSerializationWriterInterpreter.cs :
revert XmlTypeMapping.XmlTypeNamsepace usage. Now with the fix
above, original code should work fine.
svn path=/trunk/mcs/; revision=86346
* XmlTypeMapping.cs, XmlSerializationWriterInterpreter.cs,
SerializationCodeGenerator.cs :
More XmlSchemaProviderAttribute method check. Use QName returned
by the method for the output root name.
* XmlSerializerTests.cs, XmlReflectionImporterTests.cs :
added tests for XmlSchemaProviderAttribute and how its qname works.
svn path=/trunk/mcs/; revision=86340
* XmlCustomFormatter.cs : ditto for reader method generation.
* SerializationCodeGenerator.cs : for generic nullable values it
needs to store ReadNullableString() result to a temporary variable.
* XmlSerializerTests.cs : another case on #80759 from gert.
svn path=/trunk/mcs/; revision=76160
* SerializationCodeGenerator.cs : fix wrong name comparison:
Name->LocalName. Add hacky TARGET_JVM support (hope it is harmless).
svn path=/trunk/mcs/; revision=73527
* SerializationCodeGenerator.cs,
XmlSerializationReaderInterpreter.cs :
Handle attributes on non-empty elements as well. Fixed bug #80131.
* XmlSerializationReaderTests.cs : test non-empty element as well.
svn path=/trunk/mcs/; revision=73145
* SerializationCodeGenerator.cs,
XmlSerializationReaderInterpreter.cs :
Handle empty root element.
Read out attribute parameters. To do that, split attribute
reader part from ReadMembers(), as it isn't invoked when the
element is empty.
* XmlSerializationReaderTests.cs : added test for out attribute
parameters. It also tests empty root element.
svn path=/trunk/mcs/; revision=73143
* SerializationCodeGenerator.cs : hooks won't work unless they are
set. For WriteStartElement() it could simply embed the names.
svn path=/trunk/mcs/; revision=73112
* XmlSerializationWriter.cs : WriteTypedPrimitive() does not support
XmlNode arrays.
* XmlSerializationWriterInterpreter.cs,
SerializationCodeGenerator.cs : so they have to be handled here.
* XmlSerializerTests.cs : added some XmlNode array/list tests.
* XmlSerializationWriterTests.cs : removed more NotWorking. Added
WriteTypedPrimitive() error test for XmlNode.
svn path=/trunk/mcs/; revision=72448
* SerializationCodeGenerator.cs, XmlCustomFormatter.cs :
GenerateToXmlString() needed hexBinary support as well. Since
XmlConvert.[To|From]BinHexString() are internal, use reflection.
Really fixed bug #79989 and #79990 for generated serializers.
* XmlSerializerTests.cs :
added base64 tests which is similar to hexBinary.
svn path=/trunk/mcs/; revision=68927
* XmlSerializerTests.cs : test for basic generic type support with
code generation.
* SerializationCodeGenerator.cs, TypeData.cs :
Now we differentiate TypeName, FullTypeName C# type names. It is
to create valid C# sources especially for generic types.
Fixed bug #79657.
svn path=/trunk/mcs/; revision=68058
* SerializationCodeGenerator.cs,
SerializationCodeGeneratorConfiguration.cs :
make "XmlSerializerContract" and "BaseXmlSerializer" customizible.
(or it is impossible to use genxs more than twice in an assembly.)
* XmlSerializerImplementationTests.cs :
another custom implementation case.
svn path=/trunk/mcs/; revision=67857
* XmlSerializerTestClasses.cs: Added test classes for encoded SOAP.
* XmlSerializerTests.cs: Added new tests and fixed existing test.
* XmlReflectionImporterTests.cs: Added test for invalid default
values.
* SoapReflectionImporterTests.cs: Fixed numbering of tests.
* XmlSerializer.cs: Corrected exception message when deserialization
fails.
* SerializationCodeGenerator.cs: Added support for flag enums.
* XmlReflectionImporter.cs: Use InvalidOperationException wrapper for
all exceptions that occur while reflecting member. Validate default
values to match MS.
* SoapReflectionImporter.cs: Revert small part of previous patch as
XmlSerializer expects enum value.
svn path=/trunk/mcs/; revision=66524
* XmlTypeMapMember.cs: Added GlobalIndex property.
* XmlTypeMapping.cs: When adding a member, initialize its GlobalIndex
property.
* SerializationCodeGenerator.cs:
* XmlSerializationWriterInterpreter.cs:
* XmlSerializationReaderInterpreter.cs: Use GlobalIndex instead of
Index to get/set the values from the input array, since some Index
values are shared between attribute and element members. Fixes
bug #78562.
svn path=/trunk/mcs/; revision=61531
bug #78204.
* SerializationCodeGenerator.cs: For flag enums, we should split on all
whitespace chars instead of only on blanks.
* XmlTypeMapping.cs: Same. Added ToEnum method for converting from
constant name(s) to integral enum value.
svn path=/trunk/mcs/; revision=59918
* XmlSerializerTests.cs: Enabled tests for bug #77530.
* XmlTypeMapping.cs: EnumMapMember now also stores value for enums.
Modified EnumMapping.GetXmlName to use XmlCustomFormatter to support
serialization of integral value to enum constant name, and made sure
the exceptions we throw match those of MSFT. In EnumMapping.GetEnumName
throw InvalidOperationException if no matching enum constant exists.
In EnumMap ctor, initialize arrays holding XML names, enum names and
enum values.
* XmlSerializationReaderInterpreter.cs: Pass full type name to
EnumMapping.GetEnumName for construction of exception message.
* XmlSerializer.cs: In Deserialize, wrap InvalidOperationException
and InvalidCastException in another InvalidOperationException to match
MSFT. In Serialize, wrap InvalidOperationException, InvalidCastException
and the inner exception for a TargetInvocationException in an
InvalidOperationException to match MSFT.
* SerializationCodeGenerator.cs: In GenerateGetXmlEnumValue, use
XmlCustomFormatter.FromEnum in order to also support serialization
integral value to enum constant name. In 2.0 profile, throw
InvalidOperationException if numeric value cannot be serialized into
an enum constant value. In GenerateSingleEnumValue, no longer attempt
to parse unknown constant value but instead report it as
InvalidOperationException. Use string.Length instead of "" comparison
to check whether a string is empty. Fixed compiler warnings in
generated code (possible empty statement).
* XmlSerializationWriterInterpreter.cs: Pass full type name to
EnumMap.GetXmlName.
* XmlSchemaImporter.cs: Pass full type name to EnumMap.GetEnumName
to allow it to be used in exception messag* XmlReflectionImporter.cs.
Use FieldInfo instead of MemberInfo for enum fields. Use IsDefined
instead of GetCustomAttributes for checking if a certain attribute
is defined. Use integral value of enum constant in EnumMapMember ctor.
* SoapReflectionImporter.cs: Use FieldInfo instead of MemberInfo for
enum fields. Use IsDefined instead of GetCustomAttributes for checking
if a certain attribute is defined. Use integral value of enum constant
in EnumMapMember ctor.
es.
svn path=/trunk/mcs/; revision=57761
* XmlSerializationReaderInterpreter.cs: When deserializing a "flat"
collection, don't create a new collection if the property already has a
collection instance.
* SerializationCodeGenerator.cs: same as above. Also return an empty
string for flag enum default values.
svn path=/trunk/mcs/; revision=54043
* XmlSerializerTestClasses.cs:
* DeserializeTests.cs: Added tests for bug #76808 and related behavior.
2005-12-05 Lluis Sanchez Gual <[email protected]>
* XmlSerializationReaderInterpreter.cs:
* SerializationCodeGenerator.cs: When deserializing a collection,
don't create a new collection if the property already has a
collection instance. This does not apply to arrays. Changed how nullabe
array properties are set. Setting IsNullable=false to the property means
that it won't be set if the read array is null (so, if the property
already has a value, it will be kept).
Another change is that can't never be null (only arrays can).
svn path=/trunk/mcs/; revision=53949
* SerializationCodeGenerator.cs:
* XmlSerializationWriterInterpreter.cs: Arrays of XmlNode don't
need to be all XmlElments. Fix by Atsushi for bug #76288.
svn path=/trunk/mcs/; revision=51795
* XmlTypeMapping.cs: Added ChoiceMember to ListMap.
In ListMap.FindElement, take into account the ChoiceMember
if set.
* SerializationCodeGenerator.cs:
* XmlSerializationReaderInterpreter.cs: For lists with a choice
member, fill the member with the corresponding enum values.
* XmlReflectionImporter.cs: Properly reflect the choice member
when applied to a list.
* XmlSerializationWriterInterpreter.cs: Track class changes.
* XmlTypeMapMemberElement.cs: Added ChoiceTypeData property.
All this fixes bug #76203.
svn path=/trunk/mcs/; revision=50779
* XmlTypeMapping.cs: Added ListMembers property that returns
members which are collections.
* SerializationCodeGenerator.cs:
* XmlSerializationReaderInterpreter.cs: Initialize collection
members to an empty collection by default. Fixes bug #75662.
svn path=/trunk/mcs/; revision=48037
* SerializationCodeGenerator.cs: In the generated serializer always
use the Object equality operator when comparing objects to serialize
to null, since those objects may have the equality operator
overloaded. This fixes bug #75543.
svn path=/trunk/mcs/; revision=47296
* SerializationCodeGenerator.cs: When reading members by order,
call a MoveToContext after each member read. In the fixup method
don't cast returned values if it is reading an object array.
* XmlSchemaImporter.cs: In ImportDerivedTypeMapping, if the type
being imported is a primitive type, create a wrapper class that
inherits from the provided one. This fixes bug #68809.
* XmlSerializationReader.cs: Properly report unreferenced objects.
Created an overload of ReadTypedPrimitive that reports elements of
unknown type. Implemented Referenced().
svn path=/trunk/mcs/; revision=45586
* XmlTypeMapping.cs: Added new XmlSerializableMapping class.
* XmlSchemaExporter.cs: When exporting an IXmlSerializable type,
export the schema that it defines. In ImportNamespace, removed
check for default namespace, since it may be included from a non
default namespace.
* XmlReflectionImporter.cs: Create a special map for IXmlSerializable
types. All this based on a patch by Andrew Skiba.
* SerializationCodeGenerator.cs:
* XmlMapping.cs:
* XmlSerializationReaderInterpreter.cs:
* SoapCodeExporter.cs:
* XmlTypeMapMemberAttribute.cs:
* XmlSerializationReader.cs:
* XmlCodeExporter.cs: Fixed some warnings.
2005-04-10 Andrew Skiba <[email protected]>
2005-04-03 Andrew Skiba <[email protected]>
svn path=/trunk/mcs/; revision=42841
* SerializationCodeGenerator.cs:
* XmlSerializationReaderInterpreter.cs: If the element being read is
bound to a choice member, set the corresponding value.
* XmlTypeMapMember.cs: Added helper SetValue method.
* XmlTypeMapElementInfo.cs: Changed the type of ChoiceValue to Object,
since now stores the enum value.
* XmlReflectionImporter.cs: Properly import choice values.
* XmlTypeMapMemberElement.cs: Added setter for the choice.
svn path=/trunk/mcs/; revision=42416
* SerializationCodeGeneratorConfiguration.cs,
SerializationCodeGenerator.cs : Added some generation configuration:
<generateAsInternal>
write custom reader/writer as internal classes.
<noreader>, <nowriter>
They make generation of reader and/or writer optional.
* XmlSerializerNamespaces.cs :
Now it uses ListDictionary instead of Hashtable.
* XmlSerializationWriter.cs : entries in XmlSerializerNamespaces are
written unless there is already the same prefix-ns mapping.
svn path=/trunk/mcs/; revision=38760
* SerializationSource.cs: Made SerializationSource abstract, and
renamed Equals to BaseEquals to avoid missing GetHashCode warning
(it does not really make sense in this case).
* XmlSchemaExporter.cs, SerializationCodeGenerator.cs,
XmlReflectionImporter.cs, XmlSerializationWriterInterpreter.cs,
XmlSerializationReader.cs: Fixed warnings.
svn path=/trunk/mcs/; revision=36462
when reading a primitive value in encoded format using
ReadReferencingElement, provide the type name and namespace
since the xsi type may not be present in the xml element. This
fixes bug #65929.
svn path=/trunk/mcs/; revision=34157
In CheckSerializableType, add the option of ignoring types with private
constructors. Some kind of lists can be deserialized
even if the constructor is private. See bug #61464.
* SerializationCodeGenerator.cs, XmlSerializationReaderInterpreter.cs:
Before creating a list, check that it has a public constructor.
* TypeData.cs: Added HasPublicConstructor property.
svn path=/trunk/mcs/; revision=33230
When deserializing an encoded method response, assign to the return value
the first element of the message, whatever it is. The return type doesn't
need to be Object, it seems to be true for all return types.
svn path=/trunk/mcs/; revision=32813
* ReflectionHelper.cs: New method for generating map keys.
* SerializationCodeGenerator.cs: Added support for generating the serializer
contract class, needed for 2.0.
* SerializationSource.cs: Use Type[] instead of ArrayList for storing
extra types.
* SoapReflectionImporter.cs, XmlReflectionImporter.cs: Assign extra types
as Type[]. Added check that makes sure that enums being serialized are
public.
* XmlMapping.cs: Added internal GetKey method.
* XmlSerializer.cs: Added support for IXmlSerializerImplementation.
Added first bits to support loading of serializers from pre-generated
assemblies.
* XmlSerializerFactory.cs: Mostly implemeted.
svn path=/trunk/mcs/; revision=30867