CreateComplexProperty method

  1. @override
Attachment? CreateComplexProperty(
  1. String xmlElementName
)
override
Instantiate the appropriate attachment type depending on the current XML element name. The XML element name from which to determine the type of attachment to create.

Implementation

@override
Attachment? CreateComplexProperty(String xmlElementName) {
  switch (xmlElementName) {
    case XmlElementNames.FileAttachment:
      return new FileAttachment.withOwner(this._owner!);
    case XmlElementNames.ItemAttachment:
      return new ItemAttachment.withOwner(this._owner!);
    case XmlElementNames.ReferenceAttachment:
      return new ReferenceAttachment.withOwner(this._owner!);
    default:
      return null;
  }
}