Specify how to convert a child. The value obtained from the conversion could either be used as a constructor parameter when instantiating the parent, or be used to set the value after the parent has been instantiated.
Static
singleGenerated using TypeDoc
Tells the transformer whether this factory already takes care of the node's children and no further computation is desired on that subtree. E.g., when we're mapping an ANTLR parse tree, and we have a context that is only a wrapper over several alternatives, and for some reason those are not labeled alternatives in ANTLR (subclasses), we may configure the transformer as follows:
However, if the result of
transformer.transform(ctx.children[0])
is an instance of a Node with a child for whichwithChild
was configured, the transformer will think that it has to populate that child, according to the configuration determined by reflection. When it tries to do so, the "source" of the node will be an instance ofXYZContext
that may not have a child with a corresponding name, and the transformation will fail – or worse, it will map an unrelated node.Note: this method is called
skipChildren
in StarLasu, butskipChildren
is already the name of a property, and the TypeScript and JavaScript languages don't allow to have a property with the same name as a method.