Package eu.bandm.tools.tdom
Class PackageTemplate
java.lang.Object
eu.bandm.tools.tdom.Template
eu.bandm.tools.tdom.PackageTemplate
Tdom central data model for a generated package. There is one(1) per
tdom run. It contains central configuration info, and the growing data structure
representing the generated code.
It is given as a parameter to all other
In a first phase its local fields and esp. its
[XX]Template objects created.
(Please note that the structure of metajava objects
grows in parallel, in sync!-)
In a first phase its local fields and esp. its
metaPackage
are filled, -- mainly by the Visitor code in TypedDOMGenerator.
In a second phase it is written to the destination by the local code write(int).-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DocumentTemplate(package private) final PreimageMap<DTD.PI, String> Maps PI to the docPiKey, for detecting ill-formed.(package private) final AttlistIndex(package private) final FileMaps a compiled class, by its internal "qname", to the concatenation of the texts of all related doc PIs.(package private) final DTD.Dtd(package private) final ElementIndex(package private) final booleanprotected final GeneratedAnnotationIs read by ElementTemplate and many others:(package private) final boolean(package private) boolean(package private) final String(package private) final boolean(package private) final booleanprotected VisitorTemplateFields inherited from class eu.bandm.tools.tdom.Template
formatClosure, msg -
Constructor Summary
ConstructorsConstructorDescriptionPackageTemplate(String toolname, FormatClosure formatClosure, @Opt File dtdFile, File destination, String packageName, DTD.Dtd dtd, MessageReceiver<? super SimpleMessage<XMLDocumentIdentifier>> msg, boolean useArrays, boolean generateFunctions, boolean paisleySupport) Top level meta-information storage of the template hierarchy. -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddAbstractElement(String qname) (package private) AbstractElementTemplateaddAbstractElement(String name, boolean isPublic, MetaClass superClass) (package private) ElementTemplateaddElement(DTD.Element element, NamespaceName nname, boolean isPublic) (package private) voidaddGetter(int modifiers, GeneratedField field) Add a getter method to a Generated field.(package private) StringextractDoctext(String key) Delivers the concatenation of all doc entries in the DTD related to the key.(package private) voidfinish()foldAbstractElements(Collection<String> children) (package private) GeneratedClass(package private) AbstractElementTemplate(package private) DTD.Singleton(package private) AttlistIndex(package private) MetaTypeReturns the correctly instantiated "tdom.runtime.TypedElement" type.(package private) DTD.DtdgetDTD()(package private) DTDTemplate(package private) DumperTemplate(package private) ElementIndex(package private) int(package private) ToplevelTemplategetElementTemplate(String tagName) (package private) Collection<ToplevelTemplate> (package private) intgetExtendedTagIndex(String name) (package private) GeneratedClass(package private) MetaType(package private) GeneratedPackage(package private) StringgetSuperClassName(String tagName) (package private) AbstractElementTemplategetSuperElementTemplate(String tagName) (package private) VisitorTemplate(package private) voidinit()Generates and initializes all singular structures.(package private) booleanisAbstractElement(String tagName) (package private) boolean(package private) intprotected MetaTyperepetitiveClass(MetaClass contentClass, int modifier) (package private) voidsetSuperClass(String subClass, String superClass) ATTENTION both Strings are un-mangled, DTD style element identifiers.(package private) voidwrite(int lineWidth) Methods inherited from class eu.bandm.tools.tdom.Template
error, error, expression, statement, statements, warning, warning
-
Field Details
-
dtdFile
-
destination
-
packageName
-
dtd
-
elementIndex
-
attlistIndex
-
useArrays
final boolean useArrays -
generateFunctions
final boolean generateFunctions -
paisleySupport
final boolean paisleySupport -
hasAttributes
final boolean hasAttributes -
generationAnnotation
Is read by ElementTemplate and many others: -
hasDocPIs
boolean hasDocPIs -
docPIs
Maps a compiled class, by its internal "qname", to the concatenation of the texts of all related doc PIs. -
allDocPIs
Maps PI to the docPiKey, for detecting ill-formed. -
visitorTemplate
-
abstractDocumentTemplate
-
-
Constructor Details
-
PackageTemplate
PackageTemplate(String toolname, FormatClosure formatClosure, @Opt @Opt File dtdFile, File destination, String packageName, DTD.Dtd dtd, MessageReceiver<? super SimpleMessage<XMLDocumentIdentifier>> msg, boolean useArrays, boolean generateFunctions, boolean paisleySupport) Top level meta-information storage of the template hierarchy. ByNodeTemplate.packageTemplate, every instance of a specialized template class has access. The central process control parametersdtd,useArrays,destination(and more) are stored here.elementIndex,attlistIndexandhasAttributesare computed.
-
-
Method Details
-
init
void init()Generates and initializes all singular structures. These aremetaPackage,extensionClass,dtdTemplate,visitorTemplate,dumperTemplate,abstractDocumentTemplate,sourcesFile,abstractElementTemplate. For some of them, "init()" is called. -
finish
void finish() -
dtdFileRelativePosition
String dtdFileRelativePosition() -
write
void write(int lineWidth) -
getBaseClass
MetaType getBaseClass()Returns the correctly instantiated "tdom.runtime.TypedElement" type. (The generated "[PKG]/Element" class can be accessed by abstractElementTemplate andgetGeneratedBaseClass().) -
getGeneratedBaseClass
MetaType getGeneratedBaseClass() -
repetitiveClass
-
getDTD
DTD.Dtd getDTD() -
getElementIndex
ElementIndex getElementIndex() -
getAttlistIndex
AttlistIndex getAttlistIndex() -
getMetaPackage
GeneratedPackage getMetaPackage() -
getDestinationDirectory
-
getDTDTemplate
DTDTemplate getDTDTemplate() -
getVisitorTemplate
VisitorTemplate getVisitorTemplate() -
getDumperTemplate
DumperTemplate getDumperTemplate() -
getAbstractElementTemplate
AbstractElementTemplate getAbstractElementTemplate() -
getElementTemplate
-
getElementTemplates
Collection<ToplevelTemplate> getElementTemplates() -
getSuperElementTemplate
-
isAbstractElement
-
getAbstractReference
-
addAbstractElement
-
addElement
-
addAbstractElement
-
getSuperClasses
-
getSuperClassName
-
setSuperClass
ATTENTION both Strings are un-mangled, DTD style element identifiers. -
foldAbstractElements
-
nextTagIndex
int nextTagIndex() -
getElementTagIndex
-
getExtendedTagIndex
-
isExtensible
boolean isExtensible() -
generateExtensionClass
GeneratedClass generateExtensionClass() -
getExtensionClass
GeneratedClass getExtensionClass() -
addGetter
Add a getter method to a Generated field. The return type and hosting class are copied from the field. The name is "get"+Capitalize(fieldname). Add user api doc, if doc mode enabled. -
extractDoctext
Delivers the concatenation of all doc entries in the DTD related to the key.
Global input:allDocPIs.
Side-effect: removes all pis with this key for later error diagnosis of unprocessed pis.FIXME language should be switchable. FIXME css class should be switchable.
- Parameters:
key- the pi-style identifier of the tdom element or attribute.
-
extractDoctextFormat
-