Package eu.bandm.tools.tdom
Class TypedAttrsGenerator
java.lang.Object
eu.bandm.tools.tdom.TypedAttrsGenerator
Is an extraction of all Attribute-related code, only for readability.
(All this was originally contained in TypedDOMGenerator.)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
Provides "equal(a,b)" betweenDTD.AttDef
. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTypedAttrsGenerator
(TypedDOMGenerator typedDOMGenerator, PackageTemplate packageTemplate, @Opt Map<String, String> namespaceMapping) -
Method Summary
Modifier and TypeMethodDescriptionprotected GeneratedClass
makeSelectedIntegersAttr
(Location<XMLDocumentIdentifier> location, @Opt GeneratedClass elementClass, DTD.AttType type, String name) Generates the class which implements an Attribute of the SelectedIntegersAttribute type.(package private) void
prepareCommon
(DTD.Dtd dtd) Do all analysis needed before the first single element is visited.(package private) void
processOneAttDef
(DTD.AttDef attDef, @Opt ElementTemplate elementTemplate) Generate source code for one particular Attribute definition.(package private) void
processOneAttlist
(DTD.Attlist attlist, @Opt ElementTemplate elementTemplate) Generate source code for all Definitions in one Attlist.protected @Opt GeneratedField
reAdjustNormalEnum
(Location<XMLDocumentIdentifier> location, String piKey, GeneratedClass attrClass, GeneratedEnum valuesEnum, DTD.AttType type, boolean hasDefaultValue, DTD.DefaultDecl defaultValue) Creates additional source code for EnumerationAttribute-s.
-
Field Details
-
setPrivateType
-
setSortedType
-
-
Constructor Details
-
TypedAttrsGenerator
TypedAttrsGenerator(TypedDOMGenerator typedDOMGenerator, PackageTemplate packageTemplate, @Opt @Opt Map<String, String> namespaceMapping)
-
-
Method Details
-
prepareCommon
Do all analysis needed before the first single element is visited. Results are stored inselectedIntegersAtts
,commonAttrs
,commonAttlist
. Then the latter is processed and source code generated for all common attributes. This fills furthercommonAttrParentClasses
,commonAttrValueClasses
,commonAttrSharedOwnerInterfaces
,commonAttrSharedClasses
, for later usage with the elements' attlists. -
processOneAttlist
Generate source code for all Definitions in one Attlist. Can run in three modes: for the top-level common attributes with elementTemplate==null. Otherwise for an element. -
processOneAttDef
Generate source code for one particular Attribute definition. Can run in three modes: for the top-level common attributes with elementTemplate==null. Otherwise this is for an element, either with share==true, use a common attribute, or share==false, create a completely fresh implementation. -
reAdjustNormalEnum
@Opt protected @Opt GeneratedField reAdjustNormalEnum(Location<XMLDocumentIdentifier> location, String piKey, GeneratedClass attrClass, GeneratedEnum valuesEnum, DTD.AttType type, boolean hasDefaultValue, DTD.DefaultDecl defaultValue) Creates additional source code for EnumerationAttribute-s. This includes the inner enum class for the Value type, a conversion map and access methods. The (already generated) attrClass gets a corrected superclass, namely the runtime classEnumerationAttribute
instantiated with the value class. -
makeSelectedIntegersAttr
protected GeneratedClass makeSelectedIntegersAttr(Location<XMLDocumentIdentifier> location, @Opt @Opt GeneratedClass elementClass, DTD.AttType type, String name) Generates the class which implements an Attribute of the SelectedIntegersAttribute type. (only called fromprocessOneAttDef(eu.bandm.tools.dtd.DTD.AttDef,eu.bandm.tools.tdom.@eu.bandm.tools.annotations.Opt ElementTemplate)
and could be inlined. Extracted for readability only.)
-