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
Modifier 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 File
Maps 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 boolean
(package private) final boolean
(package private) boolean
(package private) final String
(package private) final boolean
(package private) final boolean
protected VisitorTemplate
-
Constructor Summary
ConstructorDescriptionPackageTemplate
(@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) void
addAbstractElement
(String qname) (package private) AbstractElementTemplate
addAbstractElement
(String name, boolean isPublic, MetaClass superClass) (package private) ElementTemplate
addElement
(DTD.Element element, NamespaceName nname, boolean isPublic) (package private) void
addGetter
(int modifiers, GeneratedField field) Add a getter method to a Generated field.(package private) String
extractDoctext
(String key) Delivers the concatenation of all doc entries in the DTD related to the key.(package private) void
finish()
foldAbstractElements
(Collection<String> children) (package private) GeneratedClass
(package private) AbstractElementTemplate
(package private) DTD.Singleton
(package private) AttlistIndex
(package private) MetaType
Returns the correctly instantiated "tdom.runtime.TypedElement" type.(package private) DTD.Dtd
getDTD()
(package private) DTDTemplate
(package private) DumperTemplate
(package private) ElementIndex
(package private) int
(package private) ToplevelTemplate
getElementTemplate
(String tagName) (package private) Collection<ToplevelTemplate>
(package private) int
getExtendedTagIndex
(String name) (package private) GeneratedClass
(package private) MetaType
(package private) GeneratedPackage
(package private) String
getSuperClassName
(String tagName) (package private) AbstractElementTemplate
getSuperElementTemplate
(String tagName) (package private) VisitorTemplate
(package private) void
init()
Generates and initializes all singular structures.(package private) boolean
isAbstractElement
(String tagName) (package private) boolean
(package private) int
protected MetaType
repetitiveClass
(MetaClass contentClass, int modifier) (package private) void
setSuperClass
(String subClass, String superClass) ATTENTION both Strings are un-mangled, DTD style element identifiers.(package private) void
write
(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 -
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(@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
,attlistIndex
andhasAttributes
are 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
-