From 4b46f9c9331a455b21989e6fa53f420f4f476f94 Mon Sep 17 00:00:00 2001 From: Paul de Vrieze Date: Thu, 29 Feb 2024 16:09:01 +0000 Subject: [PATCH] Add toString to XSGlobalSimpleType. --- .../serialization/XSGlobalSimpleType.kt | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/xmlschema/src/commonMain/kotlin/io/github/pdvrieze/formats/xmlschema/datatypes/serialization/XSGlobalSimpleType.kt b/xmlschema/src/commonMain/kotlin/io/github/pdvrieze/formats/xmlschema/datatypes/serialization/XSGlobalSimpleType.kt index 1fc47011e..368ff7c38 100644 --- a/xmlschema/src/commonMain/kotlin/io/github/pdvrieze/formats/xmlschema/datatypes/serialization/XSGlobalSimpleType.kt +++ b/xmlschema/src/commonMain/kotlin/io/github/pdvrieze/formats/xmlschema/datatypes/serialization/XSGlobalSimpleType.kt @@ -51,4 +51,30 @@ class XSGlobalSimpleType( override val annotation: XSAnnotation? = null, @XmlOtherAttributes override val otherAttrs: Map<@Serializable(QNameSerializer::class) QName, String>, -) : XSISimpleType, XSGlobalType +) : XSISimpleType, XSGlobalType { + override fun toString(): String { + return buildString { + append("XSGlobalSimpleType(name=") + append(name) + append(", simpleDerivation=") + append(simpleDerivation) + if (!final.isNullOrEmpty()) { + append(", final=") + append(final) + } + if (id != null) { + append(", id=") + append(id) + } + if (annotation != null) { + append(", annotation=") + append(annotation) + } + if (otherAttrs.isNotEmpty()) { + append(", otherAttrs=") + append(otherAttrs) + } + append(")") + } + } +}