Package com.iizix.text
Class KStringHolder
java.lang.Object
com.iizix.text.KStringHolder
- All Implemented Interfaces:
EventListener
Helper class used to maintain a KString for its dynamic tags with references, i.e. the image, text table, VirtualSpace and Connector tags.
- Author:
- Christopher Mindus
Nested Class Summary
Modifier and TypeClassDescriptionclass
Class that holds and maintains the reference for a tag.Field Summary
Constructor Summary
ConstructorDescriptionKStringHolder
(IKStringHolder<?> holder) Constructor for a holder of a single KString.Method Summary
Modifier and TypeMethodDescriptionvoid
Disposes of the instance and the KString and removes property listener.Gets the refactored KString.protected boolean
Verifies if the tree is valid for reference creation, i.e.void
Called when a property event is send to the holder property.protected void
Called to perform reference resolving.void
Resolves the references.void
Resolves the references in the KString if required before sending it to the remote party.void
setKString
(KString ks) Called when a KString is assigned in the holder.void
verify
(PropVerification verification, String location) Called when a KString requires verification of the references due to broken or valid references.
Field Details
BASE_ERROR_ID
The error ID base.- See Also:
Constructor Details
KStringHolder
Constructor for a holder of a single KString.- Parameters:
holder
- The holder property.- Throws:
NullPointerException
- If the holder is null.
Method Details
disposeHolder
public void disposeHolder()Disposes of the instance and the KString and removes property listener. Disposal can be done followed by calling setKString() with a new KString.setKString
Called when a KString is assigned in the holder.- Parameters:
ks
- The KString, or null for none (same as calling dispose() method).
getRefactoredKString
Gets the refactored KString.The returned instance is of the same type, i.e. if a PlainKString is the original string, this will also be the return from this call.
- Returns:
- The refactored KString, or null if this instance is disposed of.
resolve
Resolves the references.- Parameters:
doReCheck
- Re-check flag.triggerEvent
- The triggering property event.
resolveBeforeSend
public void resolveBeforeSend()Resolves the references in the KString if required before sending it to the remote party. The reference tree is assumed valid.isReferenceTreeValid
protected boolean isReferenceTreeValid()Verifies if the tree is valid for reference creation, i.e. that there is a valid Property Manager owning the root. This method can be overridden in order for references not to be created for the particular configuration (e.g. Client-related references such as LabelForReference that does not create references when communicating).- Returns:
- true if the root property manager is found, false otherwise.
onEvent
Called when a property event is send to the holder property.- Specified by:
onEvent
in interfaceEventListener
- Parameters:
event
- The property event.
onReferenceEvent
Called to perform reference resolving. A property should override this method if it needs to perform reference resolving and validation.Subclasses override this method and only subclasses extending
PropCnr
needs to callsuper.onReferenceEvent(ResolveReferenceEvent event)
.- Parameters:
event
- The resolve references event.
verify
Called when a KString requires verification of the references due to broken or valid references. This event is fired only in the Designer.- Parameters:
verification
- The property verification class.location
- The location.