MCPcopy
hub / github.com/vpulim/node-soap / ComplexTypeElement

Class ComplexTypeElement

src/wsdl/elements.ts:492–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490}
491
492export class ComplexTypeElement extends Element {
493 public readonly allowedChildren = buildAllowedChildren(['all', 'annotation', 'choice', 'complexContent', 'sequence', 'simpleContent', 'attribute']);
494 public description(definitions: DefinitionsElement, xmlns: IXmlNs) {
495 let ret = {};
496 let isFirstChild = false;
497 const $attributes = {};
498 const children = this.children || [];
499 for (const child of children) {
500 if (child instanceof AttributeElement) {
501 $attributes[child.$name] = child.description(definitions);
502 continue;
503 }
504
505 if (!isFirstChild && (child instanceof ChoiceElement || child instanceof SequenceElement || child instanceof AllElement || child instanceof SimpleContentElement || child instanceof ComplexContentElement)) {
506 isFirstChild = true;
507 ret = child.description(definitions, xmlns);
508 }
509 }
510
511 if (Object.keys($attributes).length > 0) {
512 ret[AttributeElement.Symbol] = $attributes;
513 }
514
515 return ret;
516 }
517}
518
519export class ComplexContentElement extends Element {
520 public readonly allowedChildren = buildAllowedChildren(['extension', 'restriction']);

Callers

nothing calls this directly

Calls 1

buildAllowedChildrenFunction · 0.85

Tested by

no test coverage detected