public class KStringProp extends GProp<KString> implements IKStringValuePropHolder<KString>, ICircularRetargetParent
GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2
EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
Modifier | Constructor and Description |
---|---|
protected |
KStringProp()
Creates a KString property with no name and with a null value.
|
|
KStringProp(Atom propertyAtom)
Creates a KString property with the specified name with a null value.
|
|
KStringProp(Atom propertyAtom,
KString newValue)
Creates a KString property with the specified name and value.
|
|
KStringProp(Atom propertyAtom,
String newValue)
Creates a KString property with the specified name and value.
|
Modifier and Type | Method and Description |
---|---|
protected void |
appendPropValue(PropMgr propertyManager,
Transaction trans,
Object value)
Appends the KString property value as an HTML string.
|
KStringProp |
clone()
Clones the KString property.
|
KString |
createNewPropValue(KString ks)
Builds a new property value from a new externalized KString.
|
protected Object |
equalValues(GProp<?> compareTo,
KString thisValue,
KString compareValue,
int how)
Checks for property value equality.
|
KString |
getKString()
Gets the current value in as a KString.
|
protected Object |
getPropValue0(Object value,
int index)
Gets the property value in another class form than the "native" one.
|
int |
getReferences(List<Reference> references)
Gets the references of this property top others.
|
String |
getString()
Gets the current value in PLAIN text format as a String.
|
String |
getString(String defaultValue)
Gets the current value in PLAIN text format as a String using
defaultValue
for an uninitialized value. |
Class<?>[] |
getValueClasses()
Gets the list of possible native Java classes that can be used to set a value using
setPropertyValue , in order of importance. |
protected void |
initializeElement(Element element)
Called when the XML file for the property tree is serialized from properties.
|
protected void |
initializeProp(Element element)
Called to initialize the property from an
Element . |
boolean |
initializeValue(PropMgr propertyManager,
Transaction trans)
Initializes the property value from a transaction as a KString in HTML format.
|
boolean |
isCircularRetargetParent()
Checks if the parent is the target or not.
|
boolean |
isUserValidated()
Checks if this KStringProp has been validated.
|
KStringProp |
lookupLanguageKStringProp(String languageCode)
Attempts to look-up another KStringProp instead of this instance.
|
void |
onEventSelf(GEvent event)
Called when a property event is send to this property.
|
void |
onKStringRefactored(KStringHolder holder,
GEvent triggerEvent)
Called when a KString tag changed due to refactoring.
|
protected void |
onPropDispose()
Called when disposed of.
|
protected void |
onPropValueSet(Object oldValue)
Called when the property value has been set.
|
protected void |
onReferenceEvent(ResolveReferencesEvent event)
Called to perform reference resolving.
|
void |
onRemoteEvent(RemoteEvent event)
Processes remote hyperlink events.
|
void |
resolveKStrings(boolean doReCheck,
GEvent triggerEvent)
Resolves the references to KString's in all held KString's.
|
boolean |
setHTMLString(String newValue)
Sets a new HTML String value for this property.
|
boolean |
setPLAINString(String newValue)
Sets a new PLAIN String value for this property.
|
boolean |
setPLAINString(String newValue,
boolean usesTagProcessing)
Sets a new PLAIN String value for this property.
|
boolean |
setPropValue(KString newValue)
Sets a new value for this property.
|
boolean |
setPropValue(String newValue)
Sets a new PLAIN String value for this property.
|
boolean |
setUserValidated(boolean on)
Sets the KStringProp as validated or not.
|
protected Object |
toNativeValue0(Object value,
int index)
Tries conversion of possibly accepted properties values using the
setPropertyValue method
into the most preferred property value type. |
void |
validatePropType(Object newValue)
Validates that the value to set is of String instance.
|
void |
verify(PropVerification verification)
Verifies this property.
|
addPropError, addPropListener, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalsTree, extendsClone, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getParent, getParent, getProjectName, getPropAtom, getPropBaseReference, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParent, getTreeLock, getVSReference, hasChanged, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCommunicating, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, list, list, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropTreeInitialized, onVirtualizationCompleted, onVirtualized, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, resolveRuntimeReferences, setChanged, setConstraints, setConstraints, setCreateRequiredProp, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toElementString, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, validatePropValue, verifyHasPropertyItem, virtualize, warning, warning, warning
getClass, hashCode, notify, notifyAll, wait, wait, wait
doAddReference, getDPR, getExternalizableKString, getHTTPServer, getImageTarget, getResolveReferenceProperty, getResourcePrefix, getTargetLanguageCode, installFont, installFonts, shouldResolve
getKStringInfoProviderInstance, installFonts
addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getParent, getParent, getPropAtom, getPropBaseReference, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, getVSReference, hasChanged, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCommunicating, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, list, list, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onPropTreeInitialized, removePropError, removePropListener, renameProp, resolveRuntimeReferences, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toElementString, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, validatePropValue, verifyHasPropertyItem, warning, warning, warning
protected KStringProp()
public KStringProp(Atom propertyAtom)
propertyAtom
- the property atom.public KStringProp(Atom propertyAtom, KString newValue)
propertyAtom
- the property atom.newValue
- the new KString value for the property.public KStringProp(Atom propertyAtom, String newValue) throws PropValidateException
propertyAtom
- the property atom.newValue
- the new string value for the property.PropValidateException
- When the constraints are not met.public KStringProp clone()
public Class<?>[] getValueClasses()
setPropertyValue
, in order of importance. Note that loss of precision
in data if e.g. an Float property accepts a Double. However, the setPropertyValue
throws IllegalArgumentException
if the range in invalid, e.g. conversion
of a Integer to a Byte, and the value is not -127 to 128.getValueClasses
in interface IGProp<KString>
getValueClasses
in class GProp<KString>
setPropertyValue
method.
The first type is the "native" or most preferred type. The array is at least one item in length
and never null.public boolean setPLAINString(String newValue) throws PropValidateException
newValue
- the new value.PropValidateException
- When the constraints are not met.public boolean setPLAINString(String newValue, boolean usesTagProcessing) throws PropValidateException, KStringException, KStringParseException
The parameter usesTagProcessing
is used to control parsing
of the string to look-up potential references to e.g. the iiziApp.
newValue
- The new value.usesTagProcessing
- Flag indicating special iizi-tags might be included.PropValidateException
- When the constraints are not met.KStringException
- For string errors.KStringParseException
- For parsing errors.public boolean setHTMLString(String newValue) throws PropValidateException, KStringException, KStringParseException
newValue
- The new value.PropValidateException
- When the constraints are not met.KStringException
- For string errors.KStringParseException
- For parsing errors.public boolean setPropValue(String newValue) throws PropValidateException
This method is identical to setPLAINString(newValue)
.
newValue
- the new value.PropValidateException
- When the constraints are not met.public boolean setPropValue(KString newValue) throws PropValidateException
newValue
- the new value.PropValidateException
- When the constraints are not met.public void validatePropType(Object newValue) throws PropTypeException
Note: When this method is called, synchronization is done at the property itself, so no synchronization on the tree should be done.
validatePropType
in interface IGProp<KString>
validatePropType
in class GProp<KString>
newValue
- The new value to set.PropTypeException
- when the new value isn't of the correct class.public String getString()
null
for uninitialized value.public String getString(String defaultValue)
defaultValue
for an uninitialized value.defaultValue
- the value to return if the current value is uninitialized.defaultValue
for uninitialized value.public KString getKString()
getKString
in interface IKStringHolder<KString>
null
for uninitialized value.protected void appendPropValue(PropMgr propertyManager, Transaction trans, Object value)
appendPropValue
in class GProp<KString>
propertyManager
- the property manager instance.trans
- transaction to append the properties to.value
- the value to append to the transaction, a reference to the current property value.public boolean initializeValue(PropMgr propertyManager, Transaction trans) throws PropException
initializeValue
in class GProp<KString>
propertyManager
- the property manager.trans
- the transaction to initialize the property with.PropException
protected void initializeElement(Element element)
initializeElement
in class GProp<KString>
element
- The Element
to initialize.protected void initializeProp(Element element) throws PropException
Element
.
The property should initialize itself from attributes and nodes
with appropriate information.initializeProp
in class GProp<KString>
element
- The Element
.PropException
- when the initialization fails.public void onEventSelf(GEvent event)
A subclass can override this method to perform appropriate processing and is
not required to call super.onEventSelf(e)
.
onEventSelf
in interface IGProp<KString>
onEventSelf
in class GProp<KString>
event
- The property event.protected void onReferenceEvent(ResolveReferencesEvent event)
Subclasses override this method and only subclasses extending PropCnr
needs to
call super.onReferenceEvent(ResolveReferenceEvent event)
.
onReferenceEvent
in class GProp<KString>
event
- The resolve references event.public void resolveKStrings(boolean doReCheck, GEvent triggerEvent)
resolveKStrings
in interface IKStringHolder<KString>
doReCheck
- Re-check flag.triggerEvent
- The triggering property event.protected void onPropDispose()
onPropDispose
in class GProp<KString>
public void onRemoteEvent(RemoteEvent event)
onRemoteEvent
in interface IGProp<KString>
onRemoteEvent
in class GProp<KString>
event
- The remote event.public void onKStringRefactored(KStringHolder holder, GEvent triggerEvent)
onKStringRefactored
in interface IKStringHolder<KString>
holder
- The KStringHolder instance.triggerEvent
- Event that triggered the refactoring.protected Object getPropValue0(Object value, int index) throws Exception
getPropValue0
in class GProp<KString>
value
- The property value.index
- The index in the Class array returned by getValueClasses()
.Exception
- Other exceptions that could occur.protected Object toNativeValue0(Object value, int index) throws Exception
setPropertyValue
method
into the most preferred property value type. If the input value already is of the preferred type, the
same object is returned.toNativeValue0
in class GProp<KString>
value
- The input value to convert to native value.index
- The index in the array returned by getValueClasses()
, or -1 if not found.Exception
- For conversion exceptions.public boolean isCircularRetargetParent()
isCircularRetargetParent
in interface ICircularRetargetParent
public int getReferences(List<Reference> references)
getReferences
in interface IGProp<KString>
getReferences
in class GProp<KString>
references
- The references array is filled in by this method.protected void onPropValueSet(Object oldValue)
onPropValueSet
in class GProp<KString>
oldValue
- The old value.public boolean isUserValidated()
public boolean setUserValidated(boolean on)
on
- The validation state.protected Object equalValues(GProp<?> compareTo, KString thisValue, KString compareValue, int how)
equalValues
in class GProp<KString>
compareTo
- The comparing-to property that contains the value.thisValue
- This property value (for synchronization reasons).compareValue
- Another property value.how
- Flags EQC_* values for equal checking.public KString createNewPropValue(KString ks)
createNewPropValue
in interface ITextExternalizableProp<KString>
ks
- The new KString.public KStringProp lookupLanguageKStringProp(String languageCode)
languageCode
- The language code to use for derived tables.this
instance. It may also not be in the requested language code if there was
no defined text for the language ID.public void verify(PropVerification verification)
iizi® is a registered trademark of Mindus SARL. © Copyright 2019 Mindus SARL. All rights reserved.