Commit Graph
368 Commits
Author SHA1 Message Date
Gert Driesen 93bfd5d862 * CodeIdentifier.cs: Default ctor is public on 1.0 profile too.
* CodeIdentifiers.cs: Ctor taking bool is 2.0 only.

svn path=/trunk/mcs/; revision=81107
2007-06-30 13:51:21 +00:00
Konstantin Triger cc884fc062 add partial support for XmlSchemaProviderAttribute
svn path=/trunk/mcs/; revision=80864
2007-06-27 12:50:39 +00:00
Konstantin Triger 4fa89551db * TypeTranslator.cs:
1. Fix the construction of TypeData for nullable types: it should not
		be primitive since the primitive were loaded in static ctor.
	2. Rename primitiveNullableTypes -> nullableTypes to reflect 
		correctly the field purpose.
	3. Unify synchronization with synchronized hashtable.

svn path=/trunk/mcs/; revision=78002
2007-05-27 12:39:41 +00:00
Konstantin Triger 2e84305b74 fix typo: set IsNullable flag for primitiveNullableTypes
svn path=/trunk/mcs/; revision=77895
2007-05-24 08:50:24 +00:00
Adar Wesley bb05ca1050 2007-05-14 Adar Wesley <[email protected]>
* XmlSchemaExporter.cs: added missing overload for method ExportAnyType.

        * XmlSchemas.cs: added missing methods Add, AddReference, Contains,
        GetSchemas.

        * XmlSerializationReader.cs: added missing method AddReaderCount.

        * XmlSerializationWriter.cs: added missing overload WriteStartElement.

        * XmlSerializer.cs: added missing overload Serialize.


svn path=/trunk/mcs/; revision=77340
2007-05-14 11:48:15 +00:00
Atsushi Eno 044e2c1ec4 2007-04-25 Atsushi Enomoto <[email protected]>
* XmlConvert.cs : MinValue and MaxValue are unchanged by the
	  serialization mode (unlike DateTime.ToString()).

	* XmlCustomFormatter.cs : fix GenerateToXmlString() as well.

	* XmlConvertTests.cs : added test for MaxValue serialization with
	  every XmlDateTimeSerializationMode.


svn path=/trunk/mcs/; revision=76275
2007-04-25 19:31:47 +00:00
Atsushi Eno a1cc211652 2007-04-25 Atsushi Enomoto <[email protected]>
* XmlConvert.cs : in 2.0, use F instead of f in dateTime formatting.

	* XmlCustomFormatter.cs :
	  in 2.0, use F instead of f for dateTime formatting.

	* XmlSerializationWriterTests.cs, XmlSerializerTests.cs :
	  fixed wrong dateTime formatting tests.


svn path=/trunk/mcs/; revision=76268
2007-04-25 18:22:32 +00:00
Atsushi Eno b89066b092 2007-04-25 Atsushi Enomoto <[email protected]>
* XmlSchemas.cs : 1.1-only duplicate check does not seem to be
	  required. This is also a workaround for 1.x ws proxy generation.


svn path=/trunk/mcs/; revision=76237
2007-04-25 08:41:49 +00:00
Atsushi Eno 539a09ff94 2007-04-24 Atsushi Enomoto <[email protected]>
* 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
2007-04-24 03:37:03 +00:00
Atsushi Eno 4d3d5288a1 2007-04-23 Atsushi Enomoto <[email protected]>
* TypeData.cs, XmlCustomFormatter.cs : generic nullable values did
	  not fit with non-nullable formatting. Fixed #80759 regression.

	* XmlSerializerTests.cs :
	  added missing test from 80759, and marked similar but different one
	  from the same bug as not working.


svn path=/trunk/mcs/; revision=76099
2007-04-23 08:41:41 +00:00
Atsushi Eno ef23f4f0cc 2007-04-20 Atsushi Enomoto <[email protected]>
* XmlTypeMapping.cs, ReflectionHelper.cs,
	  XmlSerializationReaderInterpreter.cs, SerializationCodeGenerator.cs:
	  support instantiation by private constructor.

	* XmlSerializerTests.cs :
	  Added test for serializing private-constructor-only class.


svn path=/trunk/mcs/; revision=76003
2007-04-20 11:13:46 +00:00
Konstantin Triger 93b055b204 do not export twice simple types
svn path=/trunk/mcs/; revision=75964
2007-04-19 17:17:54 +00:00
Atsushi Eno f1502ba6c4 2007-04-10 Atsushi Enomoto <[email protected]>
* TypeData.cs : forgot NET_2_0.


svn path=/trunk/mcs/; revision=75561
2007-04-10 07:01:11 +00:00
Atsushi Eno 444d0efb91 2007-04-10 Atsushi Enomoto <[email protected]>
* TypeData.cs : in get_ListItemTypeData(), check generic ICollection
	  as well as non-generic one. Fixed bug #81341. Though the type check
	  looks like an aggregation of bugfix hacks and there should be some
	  kind of sane refactoring, to throw best-suited errors.


svn path=/trunk/mcs/; revision=75559
2007-04-10 05:09:01 +00:00
Atsushi Eno c4833c5907 2007-02-28 Atsushi Enomoto <[email protected]>
* SerializationCodeGenerator.cs : fix wrong name comparison:
	  Name->LocalName. Add hacky TARGET_JVM support (hope it is harmless).


svn path=/trunk/mcs/; revision=73527
2007-02-28 08:40:46 +00:00
Atsushi Eno 19a69141f1 2007-02-20 Atsushi Enomoto <[email protected]>
* 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
2007-02-20 07:38:35 +00:00
Atsushi Eno 26736f8173 2007-02-20 Atsushi Enomoto <[email protected]>
* 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
2007-02-20 06:06:12 +00:00
Atsushi Eno 2e220d6ca3 2007-02-19 Atsushi Enomoto <[email protected]>
* XmlTypeMapElementInfo.cs : set nullable if the type is Nullable<T>.

	* XmlReflectionImporterTests.cs : added another test for nullable
	  container.


svn path=/trunk/mcs/; revision=73120
2007-02-19 15:44:36 +00:00
Atsushi Eno ad569e528f 2007-02-19 Atsushi Enomoto <[email protected]>
* XmlReflectionImporter.cs : CanBeNull() should return true when the
	  argument is generic nullable value type.

	* XmlReflectionImporterTests.cs : added test for nullable int import.


svn path=/trunk/mcs/; revision=73117
2007-02-19 13:56:15 +00:00
Atsushi Eno b2528c6939 2007-02-19 Atsushi Enomoto <[email protected]>
* TypeData.cs, MapCodeGenerator.cs, XmlMemberMapping.cs,
	  TypeTranslator.cs : removed IsGenericNullable and added
	  set_IsNullable so that it could be simpler.


svn path=/trunk/mcs/; revision=73114
2007-02-19 13:21:31 +00:00
Atsushi Eno 99fc1ef28a 2007-02-19 Atsushi Enomoto <[email protected]>
* SerializationCodeGenerator.cs, XmlMappingAccess.cs,
	  SerializationCodeGeneratorConfiguration.cs : replaced HookDir with
	  XmlMappingAccess.


svn path=/trunk/mcs/; revision=73113
2007-02-19 13:07:22 +00:00
Atsushi Eno a70a652db2 2007-02-19 Atsushi Enomoto <[email protected]>
* SerializationCodeGenerator.cs : hooks won't work unless they are
	  set. For WriteStartElement() it could simply embed the names.


svn path=/trunk/mcs/; revision=73112
2007-02-19 13:00:08 +00:00
Atsushi Eno 4f040c7848 2007-02-14 Atsushi Enomoto <[email protected]>
* XmlTypeMapMember.cs : don't use readonly [Foo]Specified property
	  as nil-condition member. Fixed bug #80759.

	* XmlSerializerTests.cs : added HasFieldSpecifiedButIrrelevant().


svn path=/trunk/mcs/; revision=72844
2007-02-14 15:59:22 +00:00
Atsushi Eno 69a53ae15c 2007-02-07 Atsushi Enomoto <[email protected]>
* SoapReflectionImporter.cs : for primitive types, set predefined
	  namespaces, regardless of the actual specification.

	* SoapReflectionImporterTests.cs : removed some NotWorking.


svn path=/trunk/mcs/; revision=72455
2007-02-07 20:48:48 +00:00
Atsushi Eno 538b940300 2007-02-07 Atsushi Enomoto <[email protected]>
* 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
2007-02-07 18:47:55 +00:00
Atsushi Eno 1552791781 2007-02-07 Atsushi Enomoto <[email protected]>
* XmlSerializationWriter.cs : WriteTypedPrimitive() infers the type
	  when the name is null (almost no need to do this, but it is easier
	  to remove NotWorking from extraneous tests and let them hush than
	  removing them).

	* XmlSerializationWriterTests.cs : removed some NotWorking.


svn path=/trunk/mcs/; revision=72436
2007-02-07 17:11:43 +00:00
Atsushi Eno 0544130e97 2007-02-07 Atsushi Enomoto <[email protected]>
* XmlSerializationWriter.cs : callbacks could be kept null.


svn path=/trunk/mcs/; revision=72434
2007-02-07 16:51:46 +00:00
Atsushi Eno 8e6042d7e7 2007-01-19 Atsushi Enomoto <[email protected]>
* XmlMemberMapping.cs : uhoh, there is a nasty trick to output
	  Nullable info.

	* XmlSchemaImporterTests.cs :
	  Added ImportMembersMapping_NullableField().


svn path=/trunk/mcs/; revision=71318
2007-01-19 06:35:02 +00:00
Atsushi Eno c7f990160e 2007-01-18 Atsushi Enomoto <[email protected]>
* TypeData.cs : added get_IsGenericNullable.
	* MapCodeGenerator.cs : in GetDomType(), return Nullable<T> when
	  the TypeData.IsGenericNullable.
	  Use GetDomType() instead of CodeTypeReference.ctor() to not lose
	  Nullable<T> info.
	* XmlSchemaImporter.cs : added isNullable argument to GetTypeData()
	  so that it won't XmlSchemaElement.IsNillable.
	* TypeTranslator.cs :
	  Fixed wrong TypeData modification against non-nullable stuff.
	  Added another GetTypeData() that takes isNullableRuntimeType so
	  that it won't miss XmlSchemaElement.IsNillable.
	  Added another GetPrimitiveTypeData() that takes nullable.

	* XmlSchemaImporterTests.cs :
	  test that <xs:element nillable='true' ...> is mapped to Nullable<T>.


svn path=/trunk/mcs/; revision=71304
2007-01-18 18:00:36 +00:00
Atsushi Eno 11124928cd 2007-01-15 Atsushi Enomoto <[email protected]>
* TypeData.cs : reject generic type definitions.
	* TypeTranslator.cs : Make generic type names in XML compatible with
	  .net: foo_x0060_1 -> fooOfString.

	* XmlSerializerTests.cs : most of generic tests are working now.
	* XmlReflectionImporterTests.cs : test for rejecting generic type
	  definition.


svn path=/trunk/mcs/; revision=71001
2007-01-15 05:26:35 +00:00
Atsushi Eno 4b62022259 2006-12-04 Atsushi Enomoto <[email protected]>
* 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
2006-12-04 05:21:02 +00:00
Gert Driesen 0cee60a6a0 * XmlSchemaExporterTests.cs: Added tests for (part of) bug #78214.
* XmlSchemaExporter.cs: Emit xml name of enum-based default values.
Set XmlSchemaAttribute.Use to Required if no default value is defined,
and member is not an optional value type. Element should have minOccurs
1 if value type member has default value. Output flag enum type as
xsd list with restriction.
* XmlReflectionImporter.cs: Removed special casing of enums. Instead
of passing namespace of XmlAttribute to ImportTypeMapping, use the
default namespace for importing the member type.

svn path=/trunk/mcs/; revision=68887
2006-12-03 13:51:16 +00:00
Gert Driesen 5cab5ca519 * SerializationCodeGenerator.cs: Initialize out parameters if they
are value types. Fixed bug #79988.
* XmlSerializationReaderInterpreter.cs: Same.

svn path=/trunk/mcs/; revision=68877
2006-12-02 16:42:22 +00:00
Atsushi Eno 0180b11bb3 2006-12-01 Atsushi Enomoto <[email protected]>
* XmlReflectionImporter.cs : implemented several missing check and 
	  support for XmlArrayAttribute. Fixed bug #78042.

	* XmlSerializerTests.cs : added tests for XmlArrayAttribute support.


svn path=/trunk/mcs/; revision=68792
2006-12-01 01:44:17 +00:00
Atsushi Eno a864cdb5fd 2006-11-22 Atsushi Enomoto <[email protected]>
* XmlCustomFormatter.cs : handle hexBinary type. Fixed bug #79989
	  and #79990.

	* XmlSerializerTests.cs : added test for hexBinary.


svn path=/trunk/mcs/; revision=68351
2006-11-22 14:17:49 +00:00
Atsushi Eno 53fe340a95 2006-11-22 Atsushi Enomoto <[email protected]>
Fixed bug #78611.
	* TypeData.cs, TypeTranslator.cs: improved TypeData to actually store
	  "nullable" information. Introduced new primitiveNullableTypes pool
	  whose TypeData has 'true' for new IsNullable property. This
	  property is also used for non-primitive types.
	* XmlReflectionImporter.cs : there, use TypeData.IsNullable instead
	  of IsValueType, to handle nullable types.

	* XmlReflectionImporterTests.cs : added test for class that contains
	  nullable value type field whose XmlElementAttribute IsNullable.


svn path=/trunk/mcs/; revision=68341
2006-11-22 11:37:28 +00:00
Atsushi Eno 0c6fc352d6 2006-11-20 Atsushi Enomoto <[email protected]>
* TypeTranslator.cs : Hari knew better way to do it.


svn path=/trunk/mcs/; revision=68179
2006-11-20 09:35:43 +00:00
Atsushi Eno 7ae90aa118 2006-11-20 Atsushi Enomoto <[email protected]>
* TypeTranslator.cs : #if NET_2_0 for generic thingy.


svn path=/trunk/mcs/; revision=68177
2006-11-20 08:37:26 +00:00
Atsushi Eno b8757e8a2f 2006-11-20 Atsushi Enomoto <[email protected]>
* TypeTranslator.cs : (GetTypeData) when the argument type is
	  Nullable<T>, use T instead. At run time (on both interpreter and
	  generated code) it is converted to T. Fixed bug #79803.

	* XmlSerializerTests.cs : added test for nullable type.


svn path=/trunk/mcs/; revision=68175
2006-11-20 07:44:28 +00:00
Atsushi Eno b70585a3e8 2006-11-17 Atsushi Enomoto <[email protected]>
* 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
2006-11-17 14:52:02 +00:00
Atsushi Eno 848d3729d5 2006-11-17 Atsushi Enomoto <[email protected]>
* XmlSerializationReader.cs : (ReadReferencedElement)
	  Sometimes there are array types in WSDL, which are not reflected
	  in client proxies. In SOAP messages, they are marked
	  soap-env:arrayType, so use it (this could coexist with xsi:type,
	  which indicates the type in WSDL). Fixed bug #79057.


svn path=/trunk/mcs/; revision=68045
2006-11-17 02:21:56 +00:00
Atsushi Eno 645f666148 2006-11-15 Atsushi Enomoto <[email protected]>
* XmlSerializationReader.cs : implement ToByteArray[Base64|Hex]().
	  removed extra ReadSerializable().
	* XmlTypeMapping.cs : added XsdTypeName and XsdTypeNamespace.


svn path=/trunk/mcs/; revision=67904
2006-11-15 12:38:09 +00:00
Atsushi Eno ec31a7936d 2006-11-14 Atsushi Enomoto <[email protected]>
* 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
2006-11-14 17:36:49 +00:00
Atsushi Eno 96a0854809 2006-11-10 Atsushi Enomoto <[email protected]>
Fixed bug #77117.
	* XmlReflectionImporter.cs : Compute nullable correctly. Elements are
	  nillable when its type is a reference type.
	* XmlSchemaExporter.cs :
	  Set XmlTypeMapElementInfo.IsNullable from XmlTypeMapping.
	  Set XmlSchemaElement.IsNillable from XmlTypeMapElementInfo.

	* XmlSchemaExporterTests.cs :
	  fixed almost all test cases which expected totally wrong schemas.
	  Schema elements are all nillable unless it is of value type.


svn path=/trunk/mcs/; revision=67662
2006-11-10 10:01:59 +00:00
Atsushi Eno 0640f1f47f 2006-11-09 Atsushi Enomoto <[email protected]>
* XmlSchemaImporter.cs : top-level element might also have no type
	  name specification, so just compare ElementType with anyType.

	* XmlSchemaImporterTests.cs :
	  added DefaultTypeTopLevelElementImportsAllComplexTypes().


svn path=/trunk/mcs/; revision=67595
2006-11-09 14:36:01 +00:00
Atsushi Eno 41f534fdfb 2006-11-09 Atsushi Enomoto <[email protected]>
* XmlSchemaImporter.cs : attributes might overlap by extending
	  base content models. Since invalid content models are rejected by
	  Compile(), simply ignore duplicating attributes. Note that it is
	  basically hack, which should not skip derived ones but use them (but
	  it is mostly harmless since the result is very unlikely to differ).

	* XmlSchemaImporterTests.cs :
	  added ImportComplexDerivationByExtension().


svn path=/trunk/mcs/; revision=67581
2006-11-09 09:07:40 +00:00
Atsushi Eno 048ea0257a 2006-11-08 Atsushi Enomoto <[email protected]>
* XmlSchemaImporter.cs : when top-level element is xs:anyType, all
	  complexTypes must be also imported.

	* XmlSchemaImporterTests.cs :
	  added AnyTypeTopLevelElementImportsAllComplexTypes().


svn path=/trunk/mcs/; revision=67569
2006-11-09 04:23:05 +00:00
Atsushi Eno b47effcc21 2006-11-08 Atsushi Enomoto <[email protected]>
* XmlSchemaImporter.cs : ImportTypeMapping() raises exception when
	  the argument name is not bound to any elements.

	* XmlSchemaImporterTests.cs : added ImportTypeMapping() test for
	  nonexistent name.


svn path=/trunk/mcs/; revision=67560
2006-11-09 02:11:40 +00:00
Atsushi Eno 70273cd0f3 2006-11-07 Atsushi Enomoto <[email protected]>
* XmlCustomFormatter.cs : consider null base64 byte array value.
	  Fixed bug #79805.


svn path=/trunk/mcs/; revision=67476
2006-11-07 18:21:49 +00:00
Atsushi Eno 3240603b89 2006-11-02 Atsushi Enomoto <[email protected]>
* CodeIdentifier.cs : in 2.0 profile, .ctor() is exposed to
	  explicitly say Obsolete instantiation.
	* CodeIdentifiers.cs : implemented case-insensitive mode.
	* XmlSerializerAssemblyAttribute.cs : added missing .ctor().
	* SoapIncludeAttribute.cs, XmlIncludeAttribute.cs :
	  in 2.0 profile it could also be applied to an interface.
	* SoapReflectionImporter.cs,
	  XmlReflectionImporter.cs,
	  XmlMappingAccess.cs :
	  added missing ImportMembersMapping overload and moved actual
	  implementation to most lengthy-arglist one. To make it possible,
	  XmlMappingAccess is included in 1.x as internal enum.


svn path=/branches/atsushi/mcs/; revision=67256
2006-11-02 07:58:54 +00:00