* 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
attributes that MS.NET generates.
* SerializationCodeGenerator.cs: Avoid duplicate generation of maps in the
same reader/writer.
* XmlCodeExporter.cs: Added support for ignore flag in maps and members.
* XmlReflectionImporter.cs: Changed GetReflectionMembers to match
MS.NET member ordering. Patch by David Taylor.
* XmlSchemaImporter.cs: When generating a choice member, set the ignore
flag. The generated enum must also not be included in the schema.
* XmlTypeMapMember.cs: Added ignore flag.
* XmlTypeMapping.cs: The AttributeMembers property now returns the
attributes in the correct order.
svn path=/trunk/mcs/; revision=29172
In encoded format, primitive types can be null. Read them using
ReadReferencingElement, that already checks for the null tag.
svn path=/trunk/mcs/; revision=28157
When deserializing an encoded method response, if the return type of the
method is Object, assign to it the first element of the message, whatever
it is.
* XmlSerializationReader.cs:
* SoapReflectionImporter.cs, XmlReflectionImporter.cs: Set IsReturnValue of
the imported member.
* TypeTranslator.cs: Added method to safely get a primitive TypeData.
* XmlSerializationReader.cs: Don't throw an exception when the CLR type for
a given xsi type is not found. Just read it as primitive type.
* XmlTypeMapMember.cs: Added IsReturnValue property.
* XmlTypeMapping.cs: Added ReturnMember property.
* XmlSerializer.cs: Reference System.Data when compiling the serializer.
svn path=/trunk/mcs/; revision=26836
When reading an object using the typeof(object) map, an emty xsi:type
means that it has to read the contents into an XmlNode[].
* TypeData.cs: Return the correct full name for inner classes.
* XmlSchemaImporter.cs: Improved detection of types that represent
"anyType", and must be mapped to XmlElement, XmlNode or Object.
* XmlSerializationReader.cs: In GetXsiType(), find the type attribute using
the correct namespace.
In ReadTypedPrimitive(), read the element as XmlNode[] if the type is
not known.
svn path=/trunk/mcs/; revision=26761
XmlSerializationReader.cs, XmlSerializationReaderInterpreter.cs:
Support deserialization of members of type XmlDocument. This fixes#56169.
svn path=/trunk/mcs/; revision=24780
Use a special method to generate default values, since default enum values
will come as integers, so a special cast is needed.
* XmlSerializationReaderInterpreter.cs,
* SerializationSource.cs, SoapAttributeAttribute.cs, SoapAttributeOverrides.cs,
SoapAttributes.cs, SoapElementAttribute.cs, SoapEnumAttribute.cs,
SoapTypeAttribute.cs, XmlAnyElementAttribute.cs, XmlAnyElementAttributes.cs,
XmlArrayAttribute.cs, XmlArrayItemAttribute.cs, XmlArrayItemAttributes.cs,
XmlAttributeAttribute.cs, XmlAttributeOverrides.cs, XmlAttributes.cs,
XmlChoiceIdentifierAttribute.cs, XmlElementAttribute.cs, XmlElementAttributes.cs,
XmlEnumAttribute.cs, XmlReflectionMember.cs, XmlRootAttribute.cs,
XmlTextAttribute.cs, XmlTypeAttribute.cs: Had to change the implementation
of SerializationSource. It can't keep and use the XmlAttributeOverride
instances as key values, since those instances can be modified after the
xml map has been generated. Now, SerializationSource generates a unique
string hash from XmlAttributeOverride and uses it for comparisons.
svn path=/trunk/mcs/; revision=24553
WriteRoot_ and ReadRoot_ methods. Cast result of ReadTypedPrimitive to
the adequate type. Set the default value of members that do have a default
value. Other minor fixes.
* SoapReflectionImporter.cs, XmlReflectionImporter.cs: All maps must derive
from typeof(object) map, even those that have another base class.
* XmlCustomFormatter.cs: Fixed generation of conversion from char to string.
It must serialize the char as number, not as character.
* XmlSerializationReaderInterpreter.cs: Set the default value of members
that do have a default value.
* XmlTypeMapping.cs: Added property MembersWithDefault, which returns a list
of members that have a default value.
svn path=/trunk/mcs/; revision=24540
* MapCodeGenerator.cs: Do not generate base class if it is an XmlNode.
Generate types using GetDomType, so if the type is an array, it creates
the correct combination of types.
* SerializationCodeGenerator.cs, XmlTypeMapping.cs: When trying to parse
an enum, if the string is empty and the enum has [Flags], then return 0
as value. This fixes bug #55509.
* XmlSchemaImporter.cs: Added check for redefines of attribute groups. They
are not supported. Another check: a simple type cannot be enum if it does
not have any enum facet.
And another fix: use string as default type for attribtues.
* XmlSchemas.cs: Fixed search for schema elements. An schema may import
other schemas. An imported schema would not be in the table, but its
elements (although from another namespace) would be in the schema that
imported it. So, we need know to check for every schema in the table.
* XmlSerializer.cs: Added environment variable to help debugging code
generator output.
svn path=/trunk/mcs/; revision=23957
and writers for several maps in a single class. Added support for
XmlMemberMapping. Fixed generation of serializers that use encoded format.
* SoapAttributeAttribute.cs, SoapAttributeOverrides.cs, SoapAttributes.cs,
SoapElementAttribute.cs, SoapEnumAttribute.cs, SoapTypeAttribute.cs,
XmlAnyElementAttribute.cs, XmlAnyElementAttributes.cs, XmlArrayAttribute.cs,
XmlArrayItemAttribute.cs, XmlArrayItemAttributes.cs, XmlAttributeAttribute.cs,
XmlAttributeOverrides.cs, XmlChoiceIdentifierAttribute.cs, XmlRootAttribute.cs,
XmlElementAttribute.cs, XmlElementAttributes.cs, XmlEnumAttribute.cs,
XmlReflectionMember.cs, XmlTextAttribute.cs, XmlTypeAttribute.cs:
Added InternalEquals method.
* XmlAttributes.cs: Removed a lot of unused code. Added InternalEquals method.
* SoapReflectionImporter.cs: Set SerializationSource to generated maps.
* XmlCustomFormatter.cs: Fixed little bug.
* XmlMapping.cs: Added Source property. This a global identifier of the map.
* XmlReflectionImporter.cs: Set SerializationSource to generated maps.
* XmlSchemaImporter.cs: Set the correct value for IsNillable when importing
mapping members.
* XmlSerializationReaderInterpreter.cs, XmlSerializationWriter.cs: Minor fixes.
* XmlSerializationWriterInterpreter.cs: WriteObject and WriteEnum were not
correctly used.
* XmlSerializer.cs: Added support for generation of serializers.
svn path=/trunk/mcs/; revision=23392
Fixed handling of members with XmlTextAttribute that are arrays.
* TypeData.cs: IsComplexType now returns true for XmlNode.
* XmlSerializer.cs: Added check for null mapping in FromMappings.
* XmlTypeMapping.cs: Added helper method FindTextElement.
svn path=/trunk/mcs/; revision=18471