xmlRootElementBuilderGeneratorFactory function

BuilderGenerator xmlRootElementBuilderGeneratorFactory(
  1. ClassElement element
)

Creates a BuilderGenerator from a ClassElement that has an annotation of the form @XmlRootElement().

Implementation

BuilderGenerator xmlRootElementBuilderGeneratorFactory(ClassElement element) {
  final xmlRootElement = element.getXmlRootElement()!.toXmlRootElementValue()!;

  return XmlRootElementBuilderGenerator(
    xmlRootElement.name ?? element.name,
    namespace: xmlRootElement.namespace,
    isSelfClosing: xmlRootElement.isSelfClosing,
    isNullable: element.thisType.isNullable,
  );
}