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
FieldsModifier and TypeFieldDescriptionprotected EbooleanIf set to false, Attributes with no explicit value will not be visited. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalls onlydescend(TypedElement); can be overridden by the user, if required.voidaction(CDataAttribute att) Does nothing; can be overridden by the user, if required.voidaction(IdAttribute att) Does nothing; can be overridden by the user, if required.voidaction(IdRefAttribute att) Does nothing; can be overridden by the user, if required.voidaction(IdRefsAttribute att) Does nothing; can be overridden by the user, if required.voidaction(NmTokenAttribute att) Does nothing; can be overridden by the user, if required.voidaction(NmTokensAttribute att) Does nothing; can be overridden by the user, if required.voidDoes nothing; can be overridden by the user, if required.voidCallsmatch(TypedAttribute)for an attribute.voidNo-operation, can be overridden by the user, if required.voidaction(TypedDocument<E, X> doc) To be overridden by the user.voidCalls onlydescend(TypedPCData); can be overridden by the user, if required.voidNo-operation, can be overridden by the user, if required.voidCalls action/match for preceding and leading Ethereals, than attributes, then contents bydescend_contents(TypedElement), then trailing and following Ethereals.voiddescend(TypedDocument<E, X> doc) Callsaction(TypedElement)for the one top-level element.voidvoiddescend_attributes(TypedElement<E, X> ec) Callsaction(TypedAttribute)for some attributes of the element.voiddescend_contents(E ec) Callsmatch(TypedSubstantial)for all contents.voidCallsmatch(TypedEthereal)for all following ethereals.voidCallsmatch(TypedEthereal)for all leading ethereals.voidCallsmatch(TypedEthereal)for all preceding ethereals.voidCallsmatch(TypedEthereal)for all trailing ethereals.The last entered element.voidmatch(TypedAttribute ta) Calls one of the overloadedaction(X a)methods for the different subtypes ofTypedAttribute.voidmatch(TypedEthereal te) Distinguishes betweenaction(TypedComment)andaction(TypedProcessingInstruction)voidmatch(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 switchvalidatingis 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 switchvalidatingis 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.
-