xmlRootElementConstructorGeneratorFactory function
Creates a ConstructorGenerator from a ClassElement
that has an attribute of the form @XmlRootElement()
.
Implementation
ConstructorGenerator xmlRootElementConstructorGeneratorFactory(
ClassElement element,
) {
final xmlRootElement = element.getXmlRootElement()!.toXmlRootElementValue()!;
return XmlRootElementConstructorGenerator(
xmlRootElement.name ?? element.name,
namespace: xmlRootElement.namespace,
isSelfClosing: xmlRootElement.isSelfClosing,
isNullable: element.thisType.isNullable,
);
}