Skip to main content

%XGEN.AbstractDocument

Class %XGEN.AbstractDocument Extends (%XGEN.AbstractNode, %XGEN.AbstractGroup, %Studio.SASchemaClass) [ Abstract, Inheritance = right, System = 3 ]

Note: This class is included because it is needed by other parts of the library. You should not use this or any other class within this package within your applications as a future version will be incompatible. If you are interested in this functionality please contact InterSystems.

This is the base class for XGEN documents.

XGEN: XML-based Code Generation Language

XGEN is a framework for creating specialized code generators that are driven by an XML-based specification.

Overview:
XGEN contains a set of base classes from which a user can implement an XML-based code generator.

An XGEN document is an XML document that can be compiled into executable code. Every activity within an XGEN document is implemented as a class.
Within an XGEN document, each XGEN class provides the following:

  • The XML representation of the activity (i.e., its name and attributes).
  • Generation of code for the activity.
  • Generation of Studio Assist schema information.

Methods

%Generate

ClassMethod %Generate(pTargetClass As %Dictionary.CompiledClass, pCode As %Stream.TmpCharacter, pXDataName As %String) As %Status

This method is called from a method generator within a target class. It generates code for the method.
pTargetClass is the compiled class definition for the target class.
pCode is a character stream that contains the generated code.
pXDataName is the name of the XData block containing the XGEN document definition.

%GenerateDefaultCode

ClassMethod %GenerateDefaultCode(pTargetClass As %Dictionary.CompiledClass, pCode As %Stream.TmpCharacter, pXDataName As %String) As %Status

This method is invoked when there is no XDATA block defined in the target class.