Package eu.bandm.tools.tdom.runtime
Class UntypedVisitor<E extends TypedElement<E,X>,X extends TypedExtension>
java.lang.Object
eu.bandm.tools.tdom.runtime.UntypedVisitor<E,X>
Visits a tdom Element or Document class in a uniform way, e.g.
knows only about
TypedDocument
, TypedElement
, the
different subclasses of TypedAttribute
.
TypedProcessingInstruction
and TypedComment
.-
Field Summary
Modifier and TypeFieldDescriptionprotected E
boolean
If set to false, Attributes with no explicit value will not be visited. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Calls onlydescend(TypedElement)
; can be overridden by the user, if required.void
action
(CDataAttribute att) Does nothing; can be overridden by the user, if required.void
action
(IdAttribute att) Does nothing; can be overridden by the user, if required.void
action
(IdRefAttribute att) Does nothing; can be overridden by the user, if required.void
action
(IdRefsAttribute att) Does nothing; can be overridden by the user, if required.void
action
(NmTokenAttribute att) Does nothing; can be overridden by the user, if required.void
action
(NmTokensAttribute att) Does nothing; can be overridden by the user, if required.void
Does nothing; can be overridden by the user, if required.void
Callsmatch(TypedAttribute)
for an attribute.void
No-operation, can be overridden by the user, if required.void
action
(TypedDocument<E, X> doc) To be overridden by the user.void
Calls onlydescend(TypedPCData)
; can be overridden by the user, if required.void
No-operation, can be overridden by the user, if required.void
Calls action/match for preceding and leading Ethereals, than attributes, then contents bydescend_contents(TypedElement)
, then trailing and following Ethereals.void
descend
(TypedDocument<E, X> doc) Callsaction(TypedElement)
for the one top-level element.void
void
descend_attributes
(TypedElement<E, X> ec) Callsaction(TypedAttribute)
for some attributes of the element.void
descend_contents
(E ec) Callsmatch(TypedSubstantial)
for all contents.void
Callsmatch(TypedEthereal)
for all following ethereals.void
Callsmatch(TypedEthereal)
for all leading ethereals.void
Callsmatch(TypedEthereal)
for all preceding ethereals.void
Callsmatch(TypedEthereal)
for all trailing ethereals.The last entered element.void
match
(TypedAttribute ta) Calls one of the overloadedaction(X a)
methods for the different subtypes ofTypedAttribute
.void
match
(TypedEthereal te) Distinguishes betweenaction(TypedComment)
andaction(TypedProcessingInstruction)
void
match
(TypedSubstantial<X> te) Distinguishes betweenaction(TypedElement)
andaction(TypedPCData)
.
-
Field Details
-
validating
public boolean validatingIf set to false, Attributes with no explicit value will not be visited. Explicit value means that the attribute has been present when the model has been created (in source text, SAX event, constructor call), or that it has last been set to a non-null value byattribute.setValue()
.Default value of this field is
true
. -
nearestElement
-
-
Constructor Details
-
UntypedVisitor
public UntypedVisitor()
-
-
Method Details
-
getNearestElement
The last entered element.- Returns:
- (maybe null) the last entered Element.
-
action
To be overridden by the user. This default implementation simply callsdescend(TypedDocument)
-
descend
Callsaction(TypedElement)
for the one top-level element. -
match
Distinguishes betweenaction(TypedElement)
andaction(TypedPCData)
. -
action
Calls onlydescend(TypedPCData)
; can be overridden by the user, if required. -
descend
-
action
Calls onlydescend(TypedElement)
; can be overridden by the user, if required. -
descend
Calls action/match for preceding and leading Ethereals, than attributes, then contents bydescend_contents(TypedElement)
, then trailing and following Ethereals. -
descend_contents
Callsmatch(TypedSubstantial)
for all contents. (This will in turn callaction(TypedElement)
oraction(TypedPCData)
.) -
descend_leadingEthereals
Callsmatch(TypedEthereal)
for all leading ethereals. -
descend_trailingEthereals
Callsmatch(TypedEthereal)
for all trailing ethereals. -
descend_precedingEthereals
Callsmatch(TypedEthereal)
for all preceding ethereals. -
descend_followingEthereals
Callsmatch(TypedEthereal)
for all following ethereals. -
match
Distinguishes betweenaction(TypedComment)
andaction(TypedProcessingInstruction)
-
action
No-operation, can be overridden by the user, if required. -
action
No-operation, can be overridden by the user, if required. -
descend_attributes
Callsaction(TypedAttribute)
for some attributes of the element.
If the global switchvalidating
is true, then all attributes are visited which (a) had been assigned an explicit value when creating the document, or later byTypedAttribute.setValue(V)
, and (b) all those which have a default value in the DTD.
If the global switchvalidating
is false, then only the attributes from case (a) are visited. -
action
Callsmatch(TypedAttribute)
for an attribute. May be overridden. -
match
Calls one of the overloadedaction(X a)
methods for the different subtypes ofTypedAttribute
. -
action
Does nothing; can be overridden by the user, if required. -
action
Does nothing; can be overridden by the user, if required. -
action
Does nothing; can be overridden by the user, if required. -
action
Does nothing; can be overridden by the user, if required. -
action
Does nothing; can be overridden by the user, if required. -
action
Does nothing; can be overridden by the user, if required. -
action
Does nothing; can be overridden by the user, if required.
-