Class PropCnr
- All Implemented Interfaces:
EventListener
,IGProp<GProp<?>[]>
,IPropCnr
,Cloneable
- Direct Known Subclasses:
AbstractImageDefinition
,AbstractImageResolution
,AbstractInputProps
,AbstractSettings
,AbstractStyles
,AbstractVSVariable
,ActionActors
,ActiveTerminalSession
,ActiveTerminalSessions
,AppLanguages
,Application
,AppPropCnr
,ArrayProp
,Axis2D
,CaptureFieldProp
,CaptureRootProp
,CaptureScreenProp
,ClientProps
,ClientSessionProp
,ConnectionProfileSetup
,ConnectionProfilesSetup
,DatabaseProps
,DesignerPropCnr
,DevParams
,DOMElement
,DragDropLinkAdapter
,DragDropPropCnr
,EditorInfoPropCnr
,EditorPropCnr
,EndPointPropCnr
,EndPointsPropCnr
,EnvProps
,FieldActors
,FileURIPropCnr
,Flash
,FolderSettingsProp
,FolderURIPropCnr
,FontFile
,FontFiles
,FontIconDefinition
,GeoProps
,ImageLocation
,ImagePreview
,ImageStyle
,JavaRootContainer
,JSONElementWrapper
,JSONEncodedInput
,JSONReplyDocument
,LayoutMgr
,LayoutProp
,LetsEncryptDomain
,LogicItemProp
,LogicProp
,MailProps
,MementoPropCnr
,MessageBox
,MethodReference2
,MLDefaultItemProp
,ModuleApp
,ModuleProjectPropCnr
,MultiPropCnr
,NativeSetting
,OutputProps
,ParsedJavaSourceContainer
,Plot2D
,PolicyProps
,ProjectRootPropCnr
,ProxyPropCnr
,PushPropCnr
,PushProps
,PWAPropCnr
,PWAProps
,RecordingProp
,RecordingRootProp
,RecordingScreenProp
,RecordingScreensProp
,ReferralsHolder
,ResultProps
,RuntimeBuilderProps
,ScreenActionProp
,ScreenActionsProp
,ScreenFieldGroupProp
,ScreenFieldProp
,ScreenFieldsProp
,ScreenIdentificationProp
,ScreenIdentificationsProp
,ScreenProp
,Selector
,Series
,SeriesValue
,ServerAppConfig
,ServerAppDistributionProps
,ServerClientSessionProps
,ServerConfigEnvProps
,ServerKeysProp
,ServerPluginConfig
,ServerProps
,ServerSettings
,ServerSocketCommProps
,ServerVSViewerPropCnr
,SessionConnectionStatProp
,SessionsProp
,SettingsPropCnr
,SocketCommProps
,SpeechRecognitionProp
,SpeechSynthesisProp
,SSLCommProps
,StylesCnr
,TableRow
,TableRows
,TerminalSettings
,TextTable
,Toaster
,UIComp
,UIComps
,VirtualizedMonitorPropCnr
,VirtualsContainer.VContainer
,VirtualSpace
,VirtualsPropCnr
,VSComponent
,VSVariables
,VSViewerPropCnr
,WebServerPortConfig
,WebServiceProp
,Windows
- Author:
- Christopher Mindus
Field Summary
Modifier and TypeFieldDescriptionstatic final GProp<?>[]
Empty array of properties.static final Class<?>[]
Empty array of classes.static final PropCnr[]
Empty array of property containers.static final String
The String ID for errors in the Extends Framework for PropErrorInput.The name HashMap, or null if not used.Fields inherited from class com.iizix.prop.GProp
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
Fields inherited from interface com.iizix.prop.IGProp
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
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionvoid
Transfers all properties from another container to this container.protected void
Adds the predefined properties for this container.final boolean
Adds a new property to this container at the end.final boolean
Adds a new property to this container at the end.final boolean
Adds a new property to this container at the end.final boolean
Adds a new property to this container at the end.protected void
appendPropValue
(PropMgr propertyManager, SendTransaction trans, Object value) Appends the container property value.canRequestFocus
(boolean ignoreVisibleFlag, boolean ignoreEnabledFlag) Returns if this component can receive focus.clone()
Creates a clone out of this property.final void
completeVirtualize
(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, PropCnr virtualizedProp) Once the property container has been virtualized and added into a virtualized container, a call to this routine should be done.boolean
containsProp
(Atom atom) Checks for presence of the property in the container.boolean
containsProp
(String name) Checks for presence of the property in the container.protected GProp<?>
convertLoadedProp
(GProp<?> childProp) Enables conversion or omission of a property loaded from XML.couldRequestFocusIfVirtualized
(boolean ignoreVisibleFlag, boolean ignoreEnabledFlag) Returns if this component could receive focus if it would be virtualized.final Atom
createCopyOfAtom
(Atom name) Creates a "Copy of NNN" or "Copy 2 of NNN" of an atom.final Atom
createUniqueAtom
(Atom name, String first, String next, String next2) Creates an atom with the base name specified with a unique serial number (starting with one) appended, making this atom unique within this property container.final Atom
createUniqueAtom
(String baseName) Creates an atom with the base name specified with a unique serial number (starting with one) appended, making this atom unique within this property container.final Atom
createUniqueAtom
(String baseName, String adder) Creates an atom with the base name specified with a unique serial number (starting with one) appended, making this atom unique within this property container.createVSReference
(Atom refAtom, PropCnr[] returnParent) Creates a VSReference instance from the container or any parent containers.protected boolean
Method checking if the property container should do a normal comparison with its contents based on extends framework, atoms, errors, etc.final boolean
enablePropCommunication
(boolean on) Enables communication of this container.final boolean
Enables usage of string hash map to property for fast access.protected Object
equalsTree
(PropCnr pc2, int how) Checks for equality in the whole container structure.protected Object
equalsTree
(PropCnr pc2, Class<? extends IGProp<?>> arrayItemClass, int how) Checks for equality in the whole container structure.final GProp<?>[]
getAllProps
(Class<?>[] classes, boolean includeErrors) Gets the properties of certain classes that are present in the tree below this container, i.e.final int
getAllProps
(Class<?>[] classes, List<GProp<?>> list) Gets the properties of a certain class that are present in the tree below this container, i.e.final int
getAllProps
(Class<?>[] classes, List<GProp<?>> list, boolean includeErrors) Gets the properties of certain classes that are present in the tree below this container, i.e.final GProp<?>[]
getAllProps
(Class<? extends GProp<?>>... classes) Gets the properties of certain classes that are present in the tree below this container, i.e.final <GP> GP[]
getAllProps
(Class<GP> clazz) Gets the properties of a certain class that are present in the tree below this container, i.e.final <GP> GP[]
getAllProps
(Class<GP> clazz, boolean includeErrors) Gets the properties of a certain class that are present in the tree below this container, i.e.final <GP> int
getAllProps
(Class<GP> clazz, List<GP> list) Gets the properties of a certain class that are present in the tree below this container, i.e.final <GP> int
getAllProps
(Class<GP> clazz, List<GP> list, boolean includeErrors) Gets the properties of a certain class that are present in the tree below this container, i.e.final boolean
Gets a boolean property from this property container.final boolean
Gets a boolean property from this property container.final boolean
Gets a boolean property from this property container.final boolean
Gets a boolean property from this property container.getChildPropError
(Atom atom) Gets the child property default error ID.getChildPropError
(String name) Gets the child property default error ID.final int
Gets the error severity of a child property.final int
Gets the error severity of a child property.getErrorsProp
(boolean createIfNotPresent) Gets the errors property.Gets the extends container.Gets the Extends Framework error.Gets the reference property name being extended.Atom[]
Gets the extends override atoms.Class<?>[]
Gets the possible classes this container supports for the Extends Framework.GProp<?>
getFirstProp
(Atom atom) Finds the first property with the specified atom in the property tree.GProp<?>
getFirstProp
(String name) Finds the first property with the specified name in the property tree.getFocusEngine
(IFocusComp comp) Locates the focus engine instance for the specified component.final int
Gets an integer property from this property container.final int
Gets an integer property from this property container.final int
Gets an integer property from this property container.final int
Gets an integer property from this property container.final long
Gets a long property from this property container.final long
Gets a long property from this property container.final long
Gets a long property from this property container.final long
Gets a long property from this property container.final double
Gets a Number property from this property container.final double
Gets a Number property from this property container.final double
Gets a Number property from this property container.final double
Gets a Number property from this property container.Class<?>[]
Gets the acceptable children property classes that can be used in conjunction with e.g.protected void
Gets potential references to predefined properties for this container.GProp<?>
getProp
(int index) Gets the property at requestedindex
.<GP extends IGProp<?>>
GPGets the property at requestedindex
.<GP extends IGProp<?>>
GPGets the property at requestedindex
.GProp<?>
Gets the property with theatom
name.final GProp<?>
Gets the property from a path of atoms.final GProp<?>
Gets the property from a path of atoms.<GP extends IGProp<?>>
GPGets the property with theatom
name and checking the class instance of the property.<GP extends IGProp<?>>
GPGets the property with theatom
name and checking the class instance of the property.GProp<?>
Gets the property with the specified name.<GP extends IGProp<?>>
GPGets the property with the specified name and checking the class instance of the property.<GP extends IGProp<?>>
GPGets the property with the specified name and checking the class instance of the property.Gets a base property container reference instance from the container or any parent containers.final PropCnr
Gets the property container instance.int
Gets the count of properties in the container.int
getPropCount
(String... propNames) Gets the count of present direct child properties.final int
getPropIndex
(Atom atom) Gets the index of an atom in this container.final int
getPropIndex
(IGProp<?> property) Gets the index of this property in this container.final Atom[]
Gets the indexes of all properties along with the atom names.GProp<?>[]
getProps()
Gets the current value set as a a property array,null
for an uninitialized value.<GP> GP[]
Gets the properties of a certain class, i.e.final Object
getPropValue
(int index) Gets the value of the property by theindex
.getPropValue
(Atom atom) Gets the value of the property by theatom
name.final <VALUE> VALUE
getPropValue
(Atom atom, Class<VALUE> clazz) Gets the value of the property by theatom
name.final <VALUE> VALUE
getPropValue
(Atom atom, Class<VALUE> clazz, boolean logError) Gets the value of the property by theatom
name.final Object
getPropValue
(String name) Gets the value of the property by thename
.final <VALUE> VALUE
getPropValue
(String name, Class<VALUE> clazz) Gets the value of the property by thename
.final <VALUE> VALUE
getPropValue
(String name, Class<VALUE> clazz, boolean logError) Gets the value of the property by thename
.protected Object
getPropValue0
(Object value, int index) Gets the property value in another class form than the "native" one.protected PropCnr
Gets the retargeted verification property container.final String
Gets a string property from this property container.final String
Gets a string property from this property container.Gets a string property from this property container.final String
Gets a string property from this property container.Class<?>[]
Gets the list of possible native Java classes that can be used to set a value usingsetPropertyValue
, in order of importance.getVSReference
(Atom refAtom) Gets a VSReference instance from the container or any parent containers.boolean
hasFocus()
Returns if the component currently has focus.boolean
Checks if any data is present in the property container that needs sending to the remote party.protected void
initializeElement
(Element element) Called when the XML file for the property tree is serialized from properties.boolean
initializeExtendsFramework
(GEvent triggerEvent) Initializes the extends framework for this container.void
initializeProp
(Element element) Called to initialize the property from anElement
.protected boolean
initializeValue
(PropMgr propertyManager, ReadTransaction trans) Initializes the property value from a transaction.protected void
Method called at the earliest possible stage in the constructor of a container property or it's extending classes, before possible initialization of other properties, etc.final boolean
insertProp
(IGProp<?> property, int index) Inserts a new property to this container at the specified index.final boolean
insertProp2
(IGProp<?> property, int index) Convenience method to inserts a new property to this container at the specified index.final boolean
Checks if the property parameter is a child property in this container property.boolean
isExtendsOverriden
(Atom atom) Checks if a property name is overridden in this container when using the Extends Framework.boolean
isExtendsPropertyValid
(GProp<?> property) Validates an extends property for the Extends Framework.final boolean
Checks if this container is an Extends Root container, i.e.final boolean
isPropAddRemoveAllowed
(PropMgr propertyManager) For property containers that are index-based, the creator of the container is the only one who is allowed to add/remove properties.final boolean
Checks if this property container is used with the communication framework.boolean
isPropExtended
(IGProp<?> property) Checks if a property is extended from another or if it is a child to this container.final boolean
Checks if the property parameter is a sibling property in this container property.void
list
(PrintStream out, int indent) Prints a listing of this container to the specified output stream.void
list
(PrintWriter out, int indent) Prints out a list, starting at the specified indentation, to the specified print writer.protected void
logPropNotFound
(String msg) Logs a warning message specific to a property updated from remote party that is not found during Remove, Modify or Rename.protected <GP extends IGProp<?>>
GPmaybeAddProp
(GP newlyCreated) Adds the newly created predefined property instance or returns the existing one.protected void
onInsertProp
(GProp<?> aProperty, int index, boolean replace, boolean isCloning, PropMgr propMgr, boolean isMoving) Method called when the internal functioninsertProp
is called to verify that this is allowed.protected void
Called when a property is disposed of by delete/remove in a container, or by the dispose method.protected void
onPropRemoved
(GProp<?> prop, PropMgr propMgr, boolean isMoving) Called when a property is removed in this container, before the event is fired, but after the property has been removed.void
Called when the property has initialized from the Element when streamed from an XML file, has had all (if any) children elements and nodes added as properties and that the property has been added into it's parent.protected void
Called to perform reference resolving.protected void
Called when a property container has been virtualized because it was added into another property container that was virtualized, and this container was not.protected void
onVirtualizationCompleted
(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, boolean isPostResolve) Called when virtualization completed.protected String
Returns the parameter string representing the state of this event.Prepares the property tree for application use by initializing and loading classes, etc.final boolean
Removes all properties from this container.final boolean
Removes all properties from this container.final boolean
removeProp
(int index) Removes a property from this container with the specified index.final boolean
removeProp
(Atom atom) Removes a property from this container with the specified atom.final boolean
removeProp
(Atom atom, IGProp<?> trigger) Removes a property from this container with the specified atom.final boolean
removeProp
(IGProp<?> property) Removes a property from this container.final boolean
removeProp
(IGProp<?> property, IGProp<?> trigger) Removes a property from this container.final boolean
removeProp
(String name) Removes a property from this container with the specified name.final boolean
removeProp
(String name, IGProp<?> trigger) Removes a property from this container with the specified name.final boolean
removeProp2
(int index) Removes a property from this container with the specified index.final boolean
removeProp2
(Atom atom) Convenience method to remove a property from this container with the specified atom.final boolean
removeProp2
(Atom atom, IGProp<?> trigger) Convenience method to remove a property from this container with the specified atom.final boolean
removeProp2
(IGProp<?> property) Convenience method to remove a property from this container.final boolean
removeProp2
(IGProp<?> property, IGProp<?> trigger) Convenience method to remove a property from this container.final boolean
removeProp2
(String name) Convenience method to remove a property from this container with the specified name.final boolean
removeProp2
(String name, IGProp<?> trigger) Convenience method to remove a property from this container with the specified name.final boolean
reorderProps
(Atom[] atoms) Reorders the properties according to the array.final void
replaceProps
(PropCnr cnr) Replaces all properties in this container with the ones from the specified one.requestFocus
(IGProp<?> trigger, boolean isRemoteInduced) Requests focus to this component.protected String
requestFocus
(IGProp<?> trigger, boolean isRemoteInduced, IFocusVetoListener callback) Requests focus to this component.boolean
requestFocusEx
(IGProp<?> trigger, boolean isRemoteInduced) Requests focus to this component.protected boolean
requestFocusEx
(IGProp<?> trigger, boolean isRemoteInduced, IFocusVetoListener callback) Requests focus to this component.void
resolveReferences
(boolean doReCheck) Resolves references for this container and its children by sending resolve references events.void
resolveRuntimeReferences
(IRuntimeResolver resolver) Called before transactions are prepared for sending.final boolean
Sets a boolean property with the specified atom to thevalue
in this property container.final boolean
Sets a boolean property with the specified atom to thevalue
in this property container.final boolean
Sets a boolean property with the specified atom to thevalue
in this property container.final boolean
Sets a boolean property with the specified name to thevalue
in this property container.protected final boolean
Sets the flag indicating property requires a "create transaction" when sent to the other party (server to client or vice versa).boolean
setExtendsName
(String newName) Sets the extends property name.boolean
setExtendsOverride
(Atom atom, boolean on) Sets a property name as overridden in this container using extendsFrom another container.final boolean
Sets an integer property with the specified atom to thevalue
in this property container.final boolean
Sets an integer property with the specified atom to thevalue
in this property container.final boolean
Sets an integer property with the specified name to thevalue
in this property container.final boolean
Sets a long property with the specified atom to thevalue
in this property container.final boolean
Sets an integer property with the specified atom to thevalue
in this property container.final boolean
Sets an integer property with the specified atom to thevalue
in this property container.final boolean
Sets a long property with the specified name to thevalue
in this property container.final boolean
Sets a Number property with the specified atom to thevalue
in this property container.final boolean
Sets an integer property with the specified atom to thevalue
in this property container.final boolean
Sets an integer property with the specified atom to thevalue
in this property container.final boolean
Sets an integer property with the specified name to thevalue
in this property container.final boolean
Sets a property to this container.final boolean
Adds a new property to this container at the indicated index.final boolean
Sets a property to this container.final boolean
Convenience method to set a property to this container.final boolean
Convenience method to set a property to this container.boolean
setPropValue
(int index, Object newValue) Sets the property atindex
tonewValue
.boolean
setPropValue
(Atom atom, Object newValue) Sets the property with theatom
name tonewValue
.<VALUE> boolean
setPropValue
(Atom atom, VALUE value, Class<? extends GProp<VALUE>> propClass) Sets a property value in the container.final boolean
setPropValue
(GProp<?>[] newProps) Sets a new properties array as the value.boolean
setPropValue
(String name, Object newValue) Sets the property with thename
tonewValue
.<VALUE> boolean
setPropValue
(String name, VALUE value, Class<? extends GProp<VALUE>> propClass) Sets a property value in the container.final boolean
Sets a string property with the specified atom to thevalue
in this property container.final boolean
Sets a string property with the specified atom to thevalue
in this property container.final boolean
Sets a string property with the specified atom to thevalue
in this property container.final boolean
Sets a string property with the specified name to thevalue
in this property container.protected boolean
shouldCreateProps
(Element element) Checks if a child Element should be created as properties or if it should be skipped.protected boolean
shouldSerializeToXML
(int programType, GProp<?> childProp) Method used to check for child property serialization to XML.toElementString
(Object value) Called from theinitializeProperty(Element element)
method once the element String is retrieved from the first child node of type "#text".protected Object
toNativeValue0
(Object value, int index) Tries conversion of possibly accepted properties values using thesetPropertyValue
method into the most preferred property value type.final boolean
Checks if a hash map is used for looking up properties by name/atom for fast access.boolean
Checks if index is relevant for this container, e.g.protected void
validateChildPropInValue
(GProp<?> child) Validates a single child property instance during the call tovalidatePropValue(Object newValue)
.boolean
validateClassInstances
(boolean doPerform, GProp<?>[] props, boolean isMove) Validates the target property container classes for paste/move with additional instance testing, extra check when the possible children are verified.void
validatePropType
(Object newValue) Validates the newValue against the property object type.void
validatePropValue
(Object newValue) Validates the value to set.boolean
verify
(PropVerification verification) Verifies this property container.final int
verifyInternalUseOnly
(Set<PropCnr> currentlyBeingVerifiedPropCnrs, IKStringInfoProvider provider) Verifies this property after editing.verifyTree
(IKStringInfoProvider provider) Verifies if this property container and its children for problems.protected PropCnr
virtualize
(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace) Call this method to "virtualize" a property tree.Methods inherited from class com.iizix.prop.GProp
addPropError, addPropListener, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, 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, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferencePropNameNoAssert, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParentNoAssert, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropValueSet, onRemoteEvent, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.iizix.prop.IGProp
addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onEventSelf, onRemoteEvent, removePropError, removePropListener, renameProp, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning
Methods inherited from interface com.iizix.prop.IPropCnr
canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized
Field Details
EMPTY
Empty array of properties.EMPTY_CNRS
Empty array of property containers.EMPTY_CLASSES
Empty array of classes.EXTENDS_FRAMEWORK_ERROR_ID
The String ID for errors in the Extends Framework for PropErrorInput.- See Also:
nameTable
The name HashMap, or null if not used.
Constructor Details
PropCnr
public PropCnr()Creates a property container without name.PropCnr
Creates a property container with the specified name.- Parameters:
propertyAtom
- the property atom.
PropCnr
Creates a property container with the specified name and properties.- Parameters:
propertyAtom
- the property atom.properties
- the property array value for the property.- Throws:
PropException
- as structural changes in containers on client is prohibited.
Method Details
onPropDispose
protected void onPropDispose()Called when a property is disposed of by delete/remove in a container, or by the dispose method.The Property Container clears the structure of unsent communication requests to clear memory.
This call is done just at the end of the delete/remove routine in the container, without synchronization.
During this call, whatever components that e.g. the client needs to disposed of is done.
Subclasses needing to perform some intelligent operations upon deletion should do it by overloading this method and always call the
super.onPropDispose()
method.- Overrides:
onPropDispose
in classGProp<GProp<?>[]>
getPropCnr
Gets the property container instance.- Specified by:
getPropCnr
in interfaceIPropCnr
- Returns:
- The PropCnr instance.
usesPropIndex
public boolean usesPropIndex()Checks if index is relevant for this container, e.g. to keep the Z-ordering of components.- Specified by:
usesPropIndex
in interfaceIPropCnr
- Returns:
- true if index is used, false for non-index based container.
enablePropCommunication
public final boolean enablePropCommunication(boolean on) Enables communication of this container. When communicating mode is turned on, adding and removing, as well as renaming properties causes the affected properties to be queued up in a later transaction update of the remote party. This requires quite some overhead in memory and processing, so this mode is only used when required.Note: this method is recursing down in the tree and is NOT synchronized for for performance reasons.
- Specified by:
enablePropCommunication
in interfaceIPropCnr
- Parameters:
on
- flag to turn enable or disable communication mode.- Returns:
- true if successful, false otherwise.
isPropCommunicating
public final boolean isPropCommunicating()Checks if this property container is used with the communication framework.- Specified by:
isPropCommunicating
in interfaceIGProp<GProp<?>[]>
- Overrides:
isPropCommunicating
in classGProp<GProp<?>[]>
- Returns:
- true if property is attached to a container that is communicating with a client, false otherwise.
isPropAddRemoveAllowed
For property containers that are index-based, the creator of the container is the only one who is allowed to add/remove properties. A PropertyException is otherwise thrown. This method checks if a call to add/remove is allowed.- Specified by:
isPropAddRemoveAllowed
in interfaceIPropCnr
- Parameters:
propertyManager
- The property manager.- Returns:
- true if the property container is not using index-based ordering of its properties, or the property container is created at the same side (i.e. server created and server is calling this function or client created and client is calling this function), false otherwise.
enablePropHashMap
public final boolean enablePropHashMap()Enables usage of string hash map to property for fast access. This is generally only required when the container contains many properties. This is a once-in-a-lifetime call and can only be done when the container is empty. It is recommended to call this method in the constructor(s) or the properties extending this container class.- Specified by:
enablePropHashMap
in interfaceIPropCnr
- Returns:
- true for success (if the name table was allocated and defined), false for failure, i.e. existing properties are already defined.
usePropHashMap
public final boolean usePropHashMap()Checks if a hash map is used for looking up properties by name/atom for fast access.- Specified by:
usePropHashMap
in interfaceIPropCnr
- Returns:
- true if enabled, false if disabled or not yet set.
isPropExtended
Checks if a property is extended from another or if it is a child to this container.- Specified by:
isPropExtended
in interfaceIPropCnr
- Parameters:
property
- The property to verify.- Returns:
- true if it is extended, false otherwise.
getValueClasses
Gets the list of possible native Java classes that can be used to set a value usingsetPropertyValue
, in order of importance. Note that loss of precision in data if e.g. an Float property accepts a Double. However, thesetPropertyValue
throwsIllegalArgumentException
if the range in invalid, e.g. conversion of a Integer to a Byte, and the value is not -127 to 128.- Specified by:
getValueClasses
in interfaceIGProp<GProp<?>[]>
- Specified by:
getValueClasses
in classGProp<GProp<?>[]>
- Returns:
- The array of Java classes that can be accepted in the
setPropertyValue
method. The first type is the "native" or most preferred type. The array is at least one item in length and never null.
clone
Creates a clone out of this property. The cloning is overridden by the subclasses in order to handle cloning of its class variables appropriately.Cloning is used for "virtualization" of a property tree in the server. Client property classes will therefore throw
CloneNotSupportedException
.Once a tree has been cloned, the change-flag is reset, and the create-flag is set. All listeners are also removed! The new cloned property is an orphan, i.e. has no parent set. All children properties are also (deep) cloned.
Note that the cloning process is done WITHOUT thread synchronization for performance reasons, thus no modifications should be done to the tree!
- Overrides:
clone
in classGProp<GProp<?>[]>
- Throws:
CloneNotSupportedException
- If a subclass doesn't allow cloning, e.g. the client properties.
onVirtualContainerCreated
protected void onVirtualContainerCreated()Called when a property container has been virtualized because it was added into another property container that was virtualized, and this container was not. Typically, UI and VS will issue a onUICreate or onVSCreate.UI and VS components should override this method. If this method is overridden, it is up to the subclass to handle the onXXCreate to be called first by containers, then its children recursively.
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)
.- Overrides:
onReferenceEvent
in classGProp<GProp<?>[]>
- Parameters:
event
- The resolve references event.
virtualize
protected PropCnr virtualize(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace) throws CloneNotSupportedException, PropException Call this method to "virtualize" a property tree. This method is used at runtime in the Server for the application session of virtual instances of VirtualSpace, but also virtual instances of panels, for the individual client session. The VirtualSpace is virtualized once for the application session and is shared for parallel client sessions.This method is similar to cloning, but enables references that are already resolved to remain if they point to a shared instance, e.g. the VirtualSpace pointing to its participants in the application property container shared instance, or a panel with references to text IDs, assets, etc.
It is up to the property class to handle this by overriding this method.
- Overrides:
virtualize
in classGProp<GProp<?>[]>
- Parameters:
appGyro
- The application gyro instance performing the virtualization.clientGyro
- The client gyro session, can benull
if not initialized from the client gyro.virtualSpace
- The virtualized VirtualSpace.- Returns:
- The virtualized property.
- Throws:
CloneNotSupportedException
- If a subclass doesn't allow cloning, e.g. the client properties.PropException
- For property errors during the virtualization.
completeVirtualize
public final void completeVirtualize(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, PropCnr virtualizedProp) Once the property container has been virtualized and added into a virtualized container, a call to this routine should be done. This method should only be called by the framework and not by client code.The following is done:
- resolves all references,
- if there are property errors, this will be output as a Warning event in the log,
- notification of virtualization completed.
- Parameters:
appGyro
- The Application Session Gyro causing the virtualization.clientGyro
- The client gyro session, can benull
if not initialized from the client gyro.virtualSpace
- The virtualized or virtualizing VirtualSpace.virtualizedProp
- The property being virtualized.- Throws:
IllegalStateException
- If the property container is not virtualized or added into a virtual container.
onVirtualizationCompleted
protected void onVirtualizationCompleted(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, boolean isPostResolve) Called when virtualization completed.Overriding classes must call
super.onVirtualizationCompleted(IAppSessionGyro appGyro,IClientSessionGyro clientGyro,VirtualSpace virtualSpace,boolean isPostResolve)
if they override this method.This method is called to the entire tree of the newly virtualized property container.
- Overrides:
onVirtualizationCompleted
in classGProp<GProp<?>[]>
- Parameters:
appGyro
- The application gyro instance performing the virtualization.clientGyro
- The client gyro session, can benull
if not initialized from the client gyro.virtualSpace
- The virtualized VirtualSpace.isPostResolve
- Flag indicating this call is done after references are attempted to be resolved.
prepare
Prepares the property tree for application use by initializing and loading classes, etc. This method calls all properties in the tree.- Parameters:
appOwner
- The application owner.- Returns:
- A list of errors that occurred but did not cause an abort.
- Throws:
PropException
- For property errors during the application preparation.
resolveReferences
public void resolveReferences(boolean doReCheck) Resolves references for this container and its children by sending resolve references events.- Parameters:
doReCheck
- Recheck flag, avoidtrue
unless really required.
setCreateRequiredProp
protected final boolean setCreateRequiredProp()Sets the flag indicating property requires a "create transaction" when sent to the other party (server to client or vice versa).The property container overrides this method by first calling
super.setCreateRequiredProp()
thensetCreateRequiredProp
to all its children.- Overrides:
setCreateRequiredProp
in classGProp<GProp<?>[]>
- Returns:
- true for change, false for no change.
initPropCnr
protected void initPropCnr()Method called at the earliest possible stage in the constructor of a container property or it's extending classes, before possible initialization of other properties, etc. The implementation of PropCnr doesn't do anything, so direct subclasses of PropCnr doesn't have to call thesuper.initPropCnr()
method, but lower down the extension change of classes, this is the first piece of code that should be executed.addPredefinedProps
Adds the predefined properties for this container. This method is called once just after construction of the property container and sometimes population of it.The method should add properties to create or get reference to using the
maybeAddProp
method. When the PropCnr instance is cloned, the methodgetPredefinedProps()
is called in order for the subclass to be able to retrieve the new instances to these properties, if stored in instance variables.Subclasses must override this method to do the appropriate initialization, as this method does nothing for the PropCnr class implementation.
- Throws:
PropException
- for property exceptions.
getPredefinedProps
protected void getPredefinedProps()Gets potential references to predefined properties for this container. This method is called once just after cloning of the property container.The method should get reference to using the
getProp(...)
methods. This allows the subclass to be able to retrieve the new instances to the properties created duringaddPredefinedProps()
if stored in instance variables.Subclasses must override this method to do the appropriate initialization, as this method does nothing for the PropCnr class implementation.
maybeAddProp
Adds the newly created predefined property instance or returns the existing one.- Parameters:
newlyCreated
- The newly created property to add if it is not existing.- Returns:
- The
newlyCreated
instance if the property did not exist, otherwise the existing instance. The newlyCreated property is disposed of. The property instance can safely be cast to the requested type (as the one ofnewlyCreated
). - Throws:
PropException
- If the property cannot be added or there is a property type error.
__transferChildProps
public void __transferChildProps(PropCnr pc) throws CloneNotSupportedException, IllegalStateException Transfers all properties from another container to this container. This container is cleared of all its properties.Note: this method is intended to be used by the framework and not by user code.
- Parameters:
pc
- The property container.- Throws:
CloneNotSupportedException
- If a property fails cloning.IllegalStateException
- If called outside of the Designer.
validatePropType
Validates the newValue against the property object type. Subclasses must override this method to perform optional value type validation.Note: When this method is called, synchronization is done at the property itself, so no synchronization on the tree should be done.
- Specified by:
validatePropType
in interfaceIGProp<GProp<?>[]>
- Specified by:
validatePropType
in classGProp<GProp<?>[]>
- Parameters:
newValue
- The new value to set.- Throws:
PropTypeException
- when the new value isn't of the correct class.
validatePropValue
Validates the value to set. The value must be an array where all the indexes are non-null and no property name is allowed to be duplicated.Note: When this method is called, synchronization is done at the property itself, so no synchronization on the tree should be done.
- Specified by:
validatePropValue
in interfaceIGProp<GProp<?>[]>
- Overrides:
validatePropValue
in classGProp<GProp<?>[]>
- Parameters:
newValue
- The new value to set.- Throws:
PropException
- when the new value doesn't validate correctly or as structural changes in containers on client is prohibited.
validateChildPropInValue
Validates a single child property instance during the call tovalidatePropValue(Object newValue)
. This method does nothing and subclasses may use it to validate e.g. the instance type.- Parameters:
child
- The child property to validate.- Throws:
PropException
- For validation errors.
setPropValue
Sets a new properties array as the value. If any listener is present and the value has changed compare to the last value, the listener is informed with aPropValueEvent
. Note: The eventPropCnrEvent
is not fired.- Specified by:
setPropValue
in interfaceIPropCnr
- Parameters:
newProps
- the new array.- Returns:
- boolean true for value has changed, false for no change or when at least one value couldn't be set.
- Throws:
PropException
- if read only or structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
setPropValue
Sets the property with theatom
name tonewValue
.- Specified by:
setPropValue
in interfaceIPropCnr
- Parameters:
atom
- the property atom.newValue
- the new value to set for the property- Returns:
- boolean true for value has changed, false for same value as current value for the property.
- Throws:
PropException
- when the new value doesn't validate correctly or the property with specifiedname
is not found.
setPropValue
Sets the property with thename
tonewValue
.- Specified by:
setPropValue
in interfaceIPropCnr
- Parameters:
name
- the name of the properties.newValue
- the new value to set for the property- Returns:
- boolean true for value has changed, false for same value as current value for the property.
- Throws:
PropException
- when the new value doesn't validate correctly or the property with specifiedname
is not found.
setPropValue
Sets the property atindex
tonewValue
.- Specified by:
setPropValue
in interfaceIPropCnr
- Parameters:
index
- the index in the properties array.newValue
- the new value to set for the property- Returns:
- boolean true for value has changed, false for same value as current value for the property.
- Throws:
PropException
- when the new value doesn't validate correctly.
getPropCount
public int getPropCount()Gets the count of properties in the container.- Specified by:
getPropCount
in interfaceIPropCnr
- Returns:
- int the array element count.
containsProp
Checks for presence of the property in the container.- Specified by:
containsProp
in interfaceIPropCnr
- Parameters:
name
- The property name.- Returns:
- true if property is present in the container, false otherwise.
containsProp
Checks for presence of the property in the container.- Specified by:
containsProp
in interfaceIPropCnr
- Parameters:
atom
- The property atom.- Returns:
- true if property is present in the container, false otherwise.
getProps
Gets the current value set as a a property array,null
for an uninitialized value.getProps
Gets the properties of a certain class, i.e. they must be instance from the specified class, e.g. an interface or a super (or the same) class. Not not use this method "too much" as there are some memory allocation overhead with garbage collection associated.getAllProps
Gets the properties of a certain class that are present in the tree below this container, i.e. they must be instance from the specified class, e.g. an interface or a super (or the same) class. Not not use this method "too much" as there are some memory allocation overhead with garbage collection associated.- Specified by:
getAllProps
in interfaceIPropCnr
- Type Parameters:
GP
- The property class requested.- Parameters:
clazz
- The property classes to retrieve.list
- The list that is filled with the properties found of the specified class.- Returns:
- The count of properties found.
getAllProps
Gets the properties of a certain class that are present in the tree below this container, i.e. they must be instance from the specified class, e.g. an interface or a super (or the same) class. Not not use this method "too much" as there are some memory allocation overhead with garbage collection associated.- Specified by:
getAllProps
in interfaceIPropCnr
- Parameters:
classes
- The array of property classes to retrieve.list
- The list that is filled with the properties found of the specified class.- Returns:
- The count of properties found.
getAllProps
Gets the properties of a certain class that are present in the tree below this container, i.e. they must be instance from the specified class, e.g. an interface or a super (or the same) class. Not not use this method "too much" as there are some memory allocation overhead with garbage collection associated.- Specified by:
getAllProps
in interfaceIPropCnr
- Type Parameters:
GP
- The property class requested.- Parameters:
clazz
- The property classes to retrieve.list
- The list that is filled with the properties found of the specified class.includeErrors
- Flag to include properties containing errors.- Returns:
- The count of properties found.
getAllProps
Gets the properties of certain classes that are present in the tree below this container, i.e. they must be instance from the specified class, e.g. an interface or a super (or the same) class. Not not use this method "too much" as there are some memory allocation overhead with garbage collection associated.- Specified by:
getAllProps
in interfaceIPropCnr
- Parameters:
classes
- The array property classes to retrieve.list
- The list that is filled with the properties found of the specified class.includeErrors
- Flag to include properties containing errors.- Returns:
- The count of properties found.
getAllProps
Gets the properties of a certain class that are present in the tree below this container, i.e. they must be instance from the specified class, e.g. an interface or a super (or the same) class. Not not use this method "too much" as there are some memory allocation overhead with garbage collection associated.- Specified by:
getAllProps
in interfaceIPropCnr
- Type Parameters:
GP
- The property class requested.- Parameters:
clazz
- The property classes to retrieve.- Returns:
- The array of properties found.
getAllProps
Gets the properties of certain classes that are present in the tree below this container, i.e. they must be instance from the specified class, e.g. an interface or a super (or the same) class. Not not use this method "too much" as there are some memory allocation overhead with garbage collection associated.- Specified by:
getAllProps
in interfaceIPropCnr
- Parameters:
classes
- The list or array of property classes to retrieve.- Returns:
- The array of properties found.
getAllProps
Gets the properties of a certain class that are present in the tree below this container, i.e. they must be instance from the specified class, e.g. an interface or a super (or the same) class. Not not use this method "too much" as there are some memory allocation overhead with garbage collection associated.- Specified by:
getAllProps
in interfaceIPropCnr
- Type Parameters:
GP
- The property class requested.- Parameters:
clazz
- The property classes to retrieve.includeErrors
- Flag to include properties containing errors.- Returns:
- The array of properties found.
getAllProps
Gets the properties of certain classes that are present in the tree below this container, i.e. they must be instance from the specified class, e.g. an interface or a super (or the same) class. Not not use this method "too much" as there are some memory allocation overhead with garbage collection associated.- Specified by:
getAllProps
in interfaceIPropCnr
- Parameters:
classes
- The array of property classes to retrieve.includeErrors
- Flag to include properties containing errors.- Returns:
- The array of properties found.
getProp
Gets the property from a path of atoms.getProp
Gets the property from a path of atoms.getProp
Gets the property with the specified name. If the atom name for this property is not set, aNullPointerException
may occur.getProp
Gets the property with the specified name and checking the class instance of the property. An error message is logged if the class is not matching. If the atom name for this property is not set, aNullPointerException
may occur.- Specified by:
getProp
in interfaceIPropCnr
- Type Parameters:
GP
- The property class requested.- Parameters:
name
- the name of the property to locate in this property container.clazz
- the class the property must be or extend, null for no checking.- Returns:
- GProp the property or
null
for uninitialized container or the property with specified name is not found, or the class type is not an instance of the specified class.
getProp
Gets the property with the specified name and checking the class instance of the property. An error message may be logged if the class is not matching. If the atom name for this property is not set, aNullPointerException
may occur.- Specified by:
getProp
in interfaceIPropCnr
- Type Parameters:
GP
- The property class requested.- Parameters:
name
- the name of the property to locate in this property container.clazz
- the class the property must be or extend, null for no checking.logError
- logs an error message if the property is of a different type.- Returns:
- GProp the property or
null
for uninitialized container or the property with specified name is not found, or the class type is not an instance of the specified class.
getProp
Gets the property with theatom
name.getProp
Gets the property with theatom
name and checking the class instance of the property. An error message is logged if the class is not matching.- Specified by:
getProp
in interfaceIPropCnr
- Type Parameters:
GP
- The property class requested.- Parameters:
atom
- the atom of the property to locate in this property container.clazz
- the class the property must be or extend, null for no checking.- Returns:
- GProp the property or
null
for uninitialized container or the property with specified name is not found, or the class type is not an instance of the specified class.
getProp
Gets the property with theatom
name and checking the class instance of the property.- Specified by:
getProp
in interfaceIPropCnr
- Type Parameters:
GP
- The property class requested.- Parameters:
atom
- the atom of the property to locate in this property container.clazz
- the class the property must be or extend, null for no checking.logError
- logs an error message if the property is of a different type.- Returns:
- GProp the property or
null
for uninitialized container or the property with specified name is not found, or the class type is not an instance of the specified class.
getFirstProp
Finds the first property with the specified name in the property tree. The search order is a match in the immediate children of this property container. Then all children property containers are searched recursively with the same mechanism as described here.- Specified by:
getFirstProp
in interfaceIPropCnr
- Parameters:
name
- The name of the property to locate in the tree.- Returns:
- GProp the property or
null
for uninitialized container or the property with specified name is not found.
getFirstProp
Finds the first property with the specified atom in the property tree. The search order is a match in the immediate children of this property container. Then all children property containers are searched recursively with the same mechanism as described here.- Specified by:
getFirstProp
in interfaceIPropCnr
- Parameters:
atom
- The atom of the property to locate in the tree.- Returns:
- GProp the property or
null
for uninitialized container or the property with specified atom is not found.
getProp
Gets the property at requestedindex
.- Specified by:
getProp
in interfaceIPropCnr
- Parameters:
index
- the index of the property in the array.- Returns:
- GProp the property at request index.
- Throws:
IndexOutOfBoundsException
- If the index is invalid.
getProp
Gets the property at requestedindex
. An error message is logged if the class is not matching.- Specified by:
getProp
in interfaceIPropCnr
- Parameters:
index
- the index of the property in the array.clazz
- the class the property must be or extend, null for no checking.- Returns:
- GProp the property or
null
if the class type is not an instance of the specified class. - Throws:
IndexOutOfBoundsException
- If the index is invalid.
getProp
Gets the property at requestedindex
. An error message is logged if the class is not matching depending on thelogError
flag.- Specified by:
getProp
in interfaceIPropCnr
- Parameters:
index
- the index of the property in the array.clazz
- the class the property must be or extend, null for no checking.logError
- logs an error message if the property is of a different type.- Returns:
- GProp the property or
null
if the class type is not an instance of the specified class.
getPropCount
Gets the count of present direct child properties.- Parameters:
propNames
- The property names.- Returns:
- The count of direct child properties found.
getPropValue
Gets the value of the property by theatom
name.- Specified by:
getPropValue
in interfaceIPropCnr
- Parameters:
atom
- the atom of the property to locate in the array.- Returns:
- Object the property or
null
for uninitialized container or the property with specified name is not found.
getPropValue
Gets the value of the property by theatom
name. An error is logged if the value is not of specified class.- Specified by:
getPropValue
in interfaceIPropCnr
- Type Parameters:
VALUE
- The value class of the property requested.- Parameters:
atom
- the atom of the property to locate in the array.clazz
- the class the property value must be or extend, null for no checking.- Returns:
- Object the property or
null
for uninitialized container or the property with specified name is not found.
getPropValue
Gets the value of the property by theatom
name.- Specified by:
getPropValue
in interfaceIPropCnr
- Type Parameters:
VALUE
- The value class of the property requested.- Parameters:
atom
- the atom of the property to locate in the array.clazz
- the class the property value must be or extend, null for no checking.logError
- logs an error message if the property is of a different type.- Returns:
- Object the property or
null
for uninitialized container or the property with specified name is not found.
getPropValue
Gets the value of the property by thename
.- Specified by:
getPropValue
in interfaceIPropCnr
- Parameters:
name
- the name of the property to locate in the array.- Returns:
- Object the property or
null
for uninitialized container or the property with specified name is not found.
getPropValue
Gets the value of the property by thename
. An error is logged if the value is not of specified class.- Specified by:
getPropValue
in interfaceIPropCnr
- Type Parameters:
VALUE
- The value class of the property requested.- Parameters:
name
- the name of the property to locate in the array.clazz
- the class the property value must be or extend, null for no checking.- Returns:
- Object the property or
null
for uninitialized container or the property with specified name is not found.
getPropValue
Gets the value of the property by thename
.- Specified by:
getPropValue
in interfaceIPropCnr
- Type Parameters:
VALUE
- The value class of the property requested.- Parameters:
name
- the name of the property to locate in the array.clazz
- the class the property value must be or extend, null for no checking.logError
- logs an error message if the property is of a different type.- Returns:
- Object the property or
null
for uninitialized container or the property with specified name is not found.
getPropValue
Gets the value of the property by theindex
.- Specified by:
getPropValue
in interfaceIPropCnr
- Parameters:
index
- the index of the property in the array.- Returns:
- Object the property or
null
for uninitialized container or the property with specified name is not found.
setPropValue
public <VALUE> boolean setPropValue(String name, VALUE value, Class<? extends GProp<VALUE>> propClass) Sets a property value in the container.- Specified by:
setPropValue
in interfaceIPropCnr
- Type Parameters:
VALUE
- The value class of the property requested.- Parameters:
name
- The name of the property.value
- The value to set, null to remove the property.propClass
- The property class.- Returns:
- true if value was changed, false for no changes.
- Throws:
InternalError
- If the property could not be removed or set due to errors.
setPropValue
public <VALUE> boolean setPropValue(Atom atom, VALUE value, Class<? extends GProp<VALUE>> propClass) Sets a property value in the container.- Specified by:
setPropValue
in interfaceIPropCnr
- Type Parameters:
VALUE
- The value class of the property requested.- Parameters:
atom
- The atom name of the property.value
- The value to set, null to remove the property.propClass
- The property class.- Returns:
- true if value was changed, false for no changes.
- Throws:
InternalError
- If the property could not be removed or set due to errors.
getPropIndex
Gets the index of this property in this container.- Specified by:
getPropIndex
in interfaceIPropCnr
- Parameters:
property
- The property who's index is to be located.- Returns:
- int, the index of this property, -1 if not found.
getPropIndex
Gets the index of an atom in this container.- Specified by:
getPropIndex
in interfaceIPropCnr
- Parameters:
atom
- The atom to look-up.- Returns:
- int, the index of the atom, -1 if not found.
createUniqueAtom
Creates an atom with the base name specified with a unique serial number (starting with one) appended, making this atom unique within this property container. This function is mainly used for indexed property containers.- Specified by:
createUniqueAtom
in interfaceIPropCnr
- Parameters:
baseName
- The base name for the property. A numeric value is appended to the name to make it unique.- Returns:
- Atom, an atom with the
baseName
requested, appended with a numeric value, making this atom unique within this property container.
createUniqueAtom
Creates an atom with the base name specified with a unique serial number (starting with one) appended, making this atom unique within this property container. This function is mainly used for indexed property containers.- Parameters:
baseName
- The base name for the property. A numeric value is appended to the name to make it unique.adder
- String to add before the number ifbaseName
was taken.- Returns:
- Atom, an atom with the
baseName
requested, appended with a numeric value, making this atom unique within this property container.
createUniqueAtom
Creates an atom with the base name specified with a unique serial number (starting with one) appended, making this atom unique within this property container. This function is mainly used for indexed property containers.- Specified by:
createUniqueAtom
in interfaceIPropCnr
- Parameters:
name
- The name of the property.first
- The first appended string, e.g. "Copy of ".next
- The next appended string, e.g. "Copy ". The next and next2 are used to append string, e.g. "Copy 2 of NNN".next2
- The next #2 appended string, e.g. " of ".- Returns:
- Atom, an atom with the
baseName
requested, appended with a numeric value, making this atom unique within this property container.
createCopyOfAtom
Creates a "Copy of NNN" or "Copy 2 of NNN" of an atom. If the atom name is not present, that atom is returned.- Specified by:
createCopyOfAtom
in interfaceIPropCnr
- Parameters:
name
- Input name.- Returns:
- An atom unique in this container, based on the input name, or if the input atom is not present in the container, the same atom is returned.
setProp
Sets a property to this container. If the property doesn't exist, it is added at the end. If it exists and is of the same instance, the value in the existing property is set from the new one being set or "put". If the property exists but is of another instance, a PropertyException is thrown.- Specified by:
setProp
in interfaceIPropCnr
- Parameters:
property
- Property to set.- Returns:
- true if the property was added or set successfully, false otherwise (also means no change!).
- Throws:
PropException
- when the property has a duplicate property name or if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
setProp
Sets a property to this container. If the property doesn't exist, it is added at the end. If it exists and is of the same instance, the value in the existing property is set from the new one being set or "put". If the property exists but is of another instance, a PropertyException is thrown.- Specified by:
setProp
in interfaceIPropCnr
- Parameters:
property
- Property to set.trigger
- The trigger, or null for none.- Returns:
- true if the property was added or set successfully, false otherwise (also means no change!).
- Throws:
PropException
- when the property has a duplicate property name or if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
setProp2
Convenience method to set a property to this container. If the property doesn't exist, it is added at the end. If it exists and is of the same instance, the value in the existing property is set from the new one being set or "put". If the property exists but is of another instance, anInternalError
is thrown.setProp2
Convenience method to set a property to this container. If the property doesn't exist, it is added at the end. If it exists and is of the same instance, the value in the existing property is set from the new one being set or "put". If the property exists but is of another instance, anInternalError
is thrown.addProp
Adds a new property to this container at the end.- Specified by:
addProp
in interfaceIPropCnr
- Parameters:
property
- the property to insert.- Returns:
- true, always, because property is added.
- Throws:
PropException
- when the property has a duplicate property name or if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
addProp
Adds a new property to this container at the end.- Specified by:
addProp
in interfaceIPropCnr
- Parameters:
property
- the property to insert.trigger
- The trigger, or null for none.- Returns:
- true, always, because property is added.
- Throws:
PropException
- when the property has a duplicate property name or if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
addProp2
Adds a new property to this container at the end.This method doesn't throw a PropException, but InternalError. It is intended to be used when the property can be added without exception, e.g. in a new container.
addProp2
Adds a new property to this container at the end.This method doesn't throw a PropException, but InternalError. It is intended to be used when the property can be added without exception, e.g. in a new container.
setProp
Adds a new property to this container at the indicated index. If the property already exists, the property is replaced. If it did not existed before, it is created.- Specified by:
setProp
in interfaceIPropCnr
- Parameters:
property
- the property to set.index
- the index to use if property is inserted.- Returns:
- true if the update was successful.
- Throws:
PropException
- when the property has a duplicate property name or if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
insertProp
Inserts a new property to this container at the specified index.- Specified by:
insertProp
in interfaceIPropCnr
- Parameters:
property
- the property to insert.index
- index where to insert the property.- Returns:
- true, always, because property is added.
- Throws:
PropException
- when the property has a duplicate property name or if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
insertProp2
Convenience method to inserts a new property to this container at the specified index.- Specified by:
insertProp2
in interfaceIPropCnr
- Parameters:
property
- the property to insert.index
- index where to insert the property.- Returns:
- true, always, because property is added.
- Throws:
InternalError
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
onInsertProp
protected void onInsertProp(GProp<?> aProperty, int index, boolean replace, boolean isCloning, PropMgr propMgr, boolean isMoving) throws PropException Method called when the internal functioninsertProp
is called to verify that this is allowed. This method is typically used for the runtime virtuals container in the server.- Parameters:
aProperty
- The property to insert.index
- Index where to insert the property.replace
- Flag indicating if the value should be replaced or not.isCloning
- Flag indicating this property is being cloned.propMgr
- The property manager for remote change, null for local.isMoving
- Flag indicating the property is moved.- Throws:
PropException
- when the property has a duplicate property name or if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
removeProp
Removes a property from this container.Note: removing a property automatically disposes of it, so there is no need to call
dispose()
on it.- Specified by:
removeProp
in interfaceIPropCnr
- Parameters:
property
- the property to remove.- Returns:
- true for success, false for failure.
- Throws:
PropException
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
removeProp
Removes a property from this container.Note: removing a property automatically disposes of it, so there is no need to call
dispose()
on it.- Specified by:
removeProp
in interfaceIPropCnr
- Parameters:
property
- The property to remove.trigger
- The trigger property, null for none.- Returns:
- true for success, false for failure.
- Throws:
PropException
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
removeProp2
Convenience method to remove a property from this container.Note: removing a property automatically disposes of it, so there is no need to call
dispose()
on it.- Specified by:
removeProp2
in interfaceIPropCnr
- Parameters:
property
- The property to remove.- Returns:
- true for success, false for failure.
- Throws:
InternalError
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
removeProp2
Convenience method to remove a property from this container.Note: removing a property automatically disposes of it, so there is no need to call
dispose()
on it.- Specified by:
removeProp2
in interfaceIPropCnr
- Parameters:
property
- The property to remove.trigger
- The trigger property, null for none.- Returns:
- true for success, false for failure.
- Throws:
InternalError
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
removeProp
Removes a property from this container with the specified name.Note: removing a property automatically disposes of it, so there is no need to call
dispose()
on it.- Specified by:
removeProp
in interfaceIPropCnr
- Parameters:
name
- The name of the property to remove.- Returns:
- true for success, false for failure.
- Throws:
PropException
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
removeProp
Removes a property from this container with the specified name.Note: removing a property automatically disposes of it, so there is no need to call
dispose()
on it.- Specified by:
removeProp
in interfaceIPropCnr
- Parameters:
name
- The name of the property to remove.trigger
- The trigger property, null for none.- Returns:
- true for success, false for failure.
- Throws:
PropException
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
removeProp2
Convenience method to remove a property from this container with the specified name.Note: removing a property automatically disposes of it, so there is no need to call
dispose()
on it.- Specified by:
removeProp2
in interfaceIPropCnr
- Parameters:
name
- The name of the property to remove.- Returns:
- true for success, false for failure.
- Throws:
InternalError
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
removeProp2
Convenience method to remove a property from this container with the specified name.Note: removing a property automatically disposes of it, so there is no need to call
dispose()
on it.- Specified by:
removeProp2
in interfaceIPropCnr
- Parameters:
name
- The name of the property to remove.trigger
- The trigger property, null for none.- Returns:
- true for success, false for failure.
- Throws:
InternalError
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
removeProp
Removes a property from this container with the specified atom.Note: removing a property automatically disposes of it, so there is no need to call
dispose()
on it.- Specified by:
removeProp
in interfaceIPropCnr
- Parameters:
atom
- The atom of the property to remove.- Returns:
- true for success, false for failure.
- Throws:
PropException
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
removeProp
Removes a property from this container with the specified atom.Note: removing a property automatically disposes of it, so there is no need to call
dispose()
on it.- Specified by:
removeProp
in interfaceIPropCnr
- Parameters:
atom
- The atom of the property to remove.trigger
- The trigger property, null for none.- Returns:
- true for success, false for failure.
- Throws:
PropException
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
removeProp2
Convenience method to remove a property from this container with the specified atom.Note: removing a property automatically disposes of it, so there is no need to call
dispose()
on it.- Specified by:
removeProp2
in interfaceIPropCnr
- Parameters:
atom
- The atom of the property to remove.- Returns:
- true for success, false for failure.
- Throws:
InternalError
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
removeProp2
Convenience method to remove a property from this container with the specified atom.Note: removing a property automatically disposes of it, so there is no need to call
dispose()
on it.- Specified by:
removeProp2
in interfaceIPropCnr
- Parameters:
atom
- The atom of the property to remove.trigger
- The trigger property, null for none.- Returns:
- true for success, false for failure.
- Throws:
InternalError
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
removeProp
Removes a property from this container with the specified index.Note: removing a property automatically disposes of it, so there is no need to call
dispose()
on it.- Specified by:
removeProp
in interfaceIPropCnr
- Parameters:
index
- the index of the property to remove.- Returns:
- true for success, false for failure.
- Throws:
PropException
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
removeProp2
public final boolean removeProp2(int index) Removes a property from this container with the specified index.Note: removing a property automatically disposes of it, so there is no need to call
dispose()
on it.- Specified by:
removeProp2
in interfaceIPropCnr
- Parameters:
index
- the index of the property to remove.- Returns:
- true for success, false for failure.
- Throws:
InternalError
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
onPropRemoved
Called when a property is removed in this container, before the event is fired, but after the property has been removed.- Parameters:
prop
- The property being removed.propMgr
- The property manager, null for local.isMoving
- Moving flag, i.e. the property is moved within containers.
removeAllProps
Removes all properties from this container.Note: removing properties automatically disposes of them, so there is no need to call
dispose()
on them.- Specified by:
removeAllProps
in interfaceIPropCnr
- Returns:
- true for changed, false for no change.
- Throws:
PropException
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
removeAllProps2
public final boolean removeAllProps2()Removes all properties from this container.Note: removing properties automatically disposes of them, so there is no need to call
dispose()
on them.- Specified by:
removeAllProps2
in interfaceIPropCnr
- Returns:
- true for changed, false for no change.
- Throws:
InternalError
- if structural changes in containers is prohibited due to creation-ship of container and who is requesting the structural change.
replaceProps
Replaces all properties in this container with the ones from the specified one. All replaced properties are "cloned-in".- Parameters:
cnr
- The property container.- Throws:
CloneNotSupportedException
- For cloning errors.PropException
- If the properties could not be replaced.
getPropIndexes
Gets the indexes of all properties along with the atom names. This array can be used for reordering purposes.- Specified by:
getPropIndexes
in interfaceIPropCnr
- Returns:
- The array of atoms.
reorderProps
Reorders the properties according to the array.- Specified by:
reorderProps
in interfaceIPropCnr
- Parameters:
atoms
- The array of the properties atoms.- Returns:
- true for change, false for no change.
- Throws:
PropException
- When the atoms does not correspond to the properties.
hasSendData
public boolean hasSendData()Checks if any data is present in the property container that needs sending to the remote party.- Returns:
- The data-present flag.
appendPropValue
Appends the container property value. If uninitialized, an empty properties array is appended.- Specified by:
appendPropValue
in classGProp<GProp<?>[]>
- Parameters:
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.
logPropNotFound
Logs a warning message specific to a property updated from remote party that is not found during Remove, Modify or Rename. For certain property containers, it is quite normal. They can override this method and avoid the logging message.By default a WARNING message is logged.
- Parameters:
msg
- The message.
initializeValue
protected boolean initializeValue(PropMgr propertyManager, ReadTransaction trans) throws ClassNotFoundException, InstantiationException, IllegalAccessException, PropException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException Initializes the property value from a transaction.- Specified by:
initializeValue
in classGProp<GProp<?>[]>
- Parameters:
propertyManager
- the property manager.trans
- the transaction to initialize the property with.- Returns:
- true if the value has changed, false otherwise.
- Throws:
ClassNotFoundException
- - if the class could not be found.IllegalAccessException
- - if the class or its nullary constructor is not accessible.InstantiationException
- - if this Class represents an abstract class, an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reason.ExceptionInInitializerError
- - if the initialization provoked by this method fails.SecurityException
- - if a security manager, s, is present and any of the following conditions is met:- invocation of s.checkMemberAccess(this, Member.PUBLIC) denies creation of new instances of this class,
- the caller's class loader is not the same as or an ancestor of the class loader for the current class and invocation of s.checkPackageAccess() denies access to the package of this class.
PropException
- - if the property cannot be initialized, because of erroneous data.NoSuchMethodException
InvocationTargetException
IllegalArgumentException
initializeProp
Called to initialize the property from anElement
. The property should initialize itself from attributes and nodes with appropriate information.This call does nothing in this class and should be overridden by subclasses wishing for special processing.
- Overrides:
initializeProp
in classGProp<GProp<?>[]>
- Parameters:
element
- TheElement
.- Throws:
PropException
- when the initialization fails.
onPropTreeInitialized
Called when the property has initialized from the Element when streamed from an XML file, has had all (if any) children elements and nodes added as properties and that the property has been added into it's parent.The
PropertyContainer
calls all its children with this method in order to inform the tree.The
ExtendablePropertyContainer
overrides this method to load all extended containers.- Specified by:
onPropTreeInitialized
in interfaceIGProp<GProp<?>[]>
- Overrides:
onPropTreeInitialized
in classGProp<GProp<?>[]>
- Throws:
IOException
- For file errors.PropException
- When there is an initialization problem.
initializeElement
Called when the XML file for the property tree is serialized from properties. The property should fill attributes and nodes with appropriate information.This call does nothing in this class and should be overridden by subclasses wishing for special processing.
- Overrides:
initializeElement
in classGProp<GProp<?>[]>
- Parameters:
element
- TheElement
to initialize.
shouldCreateProps
Checks if a child Element should be created as properties or if it should be skipped. Override this method (and callsuper.shouldCreateProps(element)
) if the container creates other child elements.- Parameters:
element
- The element in question.- Returns:
- true to create properties out of it, false to ignore the element.
shouldSerializeToXML
Method used to check for child property serialization to XML. Override this method and return false to avoid writing the child property to XML. The default is to write all properties.- Parameters:
programType
- From PropFactory.getProgramType(): 0=PropFactory.CLIENT
, 1=PropFactory.SERVER
or 2=PropFactory.EDITOR
.childProp
- The child property.- Returns:
- true (default if not VOLATILE) to save to XML, false to avoid writing the property to XML.
convertLoadedProp
Enables conversion or omission of a property loaded from XML.This method is typically used to process changes of e.g. property types, e.g. from IntProp to NumberProp, in case of a change of property definitions.
- Parameters:
childProp
- The child property that is about to be added.- Returns:
- The property to add, null to omit it. The default processing is to return the same property, i.e.
childProp
. - Throws:
PropException
- for property errors.
toElementString
Called from theinitializeProperty(Element element)
method once the element String is retrieved from the first child node of type "#text". Override this method to provide the appropriateObject
toString
conversion.The default implementation returns the
Object value.toString()
return code.- Specified by:
toElementString
in interfaceIGProp<GProp<?>[]>
- Overrides:
toElementString
in classGProp<GProp<?>[]>
- Parameters:
value
- the value in the object to convert to a string.- Returns:
- the string corresponding to the object value.
equalsTree
Checks for equality in the whole container structure.NOTE: This method should not be overridden except in extreme situations, e.g. for MememtoPropCnr.
- Overrides:
equalsTree
in classGProp<GProp<?>[]>
- Parameters:
pc2
- The property value to compare with.how
- Flags EQC_* values for equal checking.- Returns:
- Both atom and value are equal on all levels.
equalsTree
Checks for equality in the whole container structure.NOTE: This method should not be overridden except in extreme situations, e.g. for MememtoPropCnr.
- Parameters:
pc2
- The property value to compare with.how
- Flags EQC_* values for equal checking.- Returns:
- Both atom and value are equal on all levels.
doPropEqualsArrayValues
protected boolean doPropEqualsArrayValues()Method checking if the property container should do a normal comparison with its contents based on extends framework, atoms, errors, etc.- Returns:
- false (default) to perform normal checking, true to compare property values as a plain array container instead.
getPropValue0
Gets the property value in another class form than the "native" one. This method tries conversion of a "native" property value into another class type. This method is used when filling in a POJO variable (Plain Old Java Object Field) from a "native" property value.- Specified by:
getPropValue0
in classGProp<GProp<?>[]>
- Parameters:
value
- The property value.index
- The index in the Class array returned bygetValueClasses()
.- Returns:
- The property value in the requested class, after conversion.
- Throws:
IllegalArgumentException
- Invalid index, this should never happen though.Exception
- Other exceptions that could occur.
toNativeValue0
Tries conversion of possibly accepted properties values using thesetPropertyValue
method into the most preferred property value type. If the input value already is of the preferred type, the same object is returned.- Specified by:
toNativeValue0
in classGProp<GProp<?>[]>
- Parameters:
value
- The input value to convert to native value.index
- The index in the array returned bygetValueClasses()
, or -1 if not found.- Returns:
- The converted input value in the preferred property value object type.
- Throws:
IllegalArgumentException
- Invalid index, this should never happen though.Exception
- For conversion exceptions.
paramString
Returns the parameter string representing the state of this event. This string is useful for debugging. Subclasses adds extra information to the string by preceding it with a comma followed by the extra information.- Overrides:
paramString
in classGProp<GProp<?>[]>
- Returns:
- the parameter string of this event.
list
Prints a listing of this container to the specified output stream. The listing starts at the specified indentation.list
Prints out a list, starting at the specified indentation, to the specified print writer.getString
Gets a string property from this property container.getString
Gets a string property from this property container.getString
Gets a string property from this property container.getString
Gets a string property from this property container.setString
Sets a string property with the specified atom to thevalue
in this property container.If the string property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
setString
Sets a string property with the specified name to thevalue
in this property container.If the string property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
setString
Sets a string property with the specified atom to thevalue
in this property container.If the string property doesn't exist, it is created and added to this property container.
setString
Sets a string property with the specified atom to thevalue
in this property container.If the string property doesn't exist, it is created and added to this property container.
- Specified by:
setString
in interfaceIPropCnr
- Parameters:
atom
- The atom of the property.value
- The string value.logError
- Flag indicating if a warning event should be logged for failures.trigger
- The trigger property, null for none.- Returns:
- true when this property container has been changed, false otherwise (or for error).
getInt
Gets an integer property from this property container.getInt
Gets an integer property from this property container.getInt
Gets an integer property from this property container.getInt
Gets an integer property from this property container.setInt
Sets an integer property with the specified atom to thevalue
in this property container.If the integer property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
setInt
Sets an integer property with the specified name to thevalue
in this property container.If the integer property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
setInt
Sets an integer property with the specified atom to thevalue
in this property container.If the integer property doesn't exist, it is created and added to this property container.
getLong
Gets a long property from this property container.getLong
Gets a long property from this property container.getLong
Gets a long property from this property container.getLong
Gets a long property from this property container.setLong
Sets a long property with the specified atom to thevalue
in this property container.If the long property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
setLong
Sets a long property with the specified name to thevalue
in this property container.If the long property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
setLong
Sets an integer property with the specified atom to thevalue
in this property container.If the integer property doesn't exist, it is created and added to this property container.
setLong
Sets an integer property with the specified atom to thevalue
in this property container.If the integer property doesn't exist, it is created and added to this property container.
- Specified by:
setLong
in interfaceIPropCnr
- Parameters:
atom
- The atom of the property.value
- The integer value.logError
- Flag indicating if a warning event should be logged for failures.trigger
- The trigger property, or null for none.- Returns:
- true when this property container has been changed, false otherwise (or for error).
getNumber
Gets a Number property from this property container.getNumber
Gets a Number property from this property container.getNumber
Gets a Number property from this property container.getNumber
Gets a Number property from this property container.setNumber
Sets a Number property with the specified atom to thevalue
in this property container.If the Number property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
setNumber
Sets an integer property with the specified name to thevalue
in this property container.If the Number property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
setNumber
Sets an integer property with the specified atom to thevalue
in this property container.If the Number property doesn't exist, it is created and added to this property container.
setNumber
Sets an integer property with the specified atom to thevalue
in this property container.If the Number property doesn't exist, it is created and added to this property container.
- Specified by:
setNumber
in interfaceIPropCnr
- Parameters:
atom
- The atom of the property.value
- The Number value.logError
- Flag indicating if a warning event should be logged for failures.trigger
- The trigger property, null for none.- Returns:
- true when this property container has been changed, false otherwise (or for error).
getBool
Gets a boolean property from this property container.getBool
Gets a boolean property from this property container.getBool
Gets a boolean property from this property container.getBool
Gets a boolean property from this property container.setBool
Sets a boolean property with the specified atom to thevalue
in this property container.If the boolean property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
setBool
Sets a boolean property with the specified name to thevalue
in this property container.If the boolean property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
setBool
Sets a boolean property with the specified atom to thevalue
in this property container.If the boolean property doesn't exist, it is created and added to this property container.
setBool
Sets a boolean property with the specified atom to thevalue
in this property container.If the boolean property doesn't exist, it is created and added to this property container.
- Specified by:
setBool
in interfaceIPropCnr
- Parameters:
atom
- The atom of the property.value
- The boolean value.logError
- Flag indicating if a warning event should be logged for failures.trigger
- The trigger property or null for none.- Returns:
- true when this property container has been changed, false otherwise (or for error).
getFocusEngine
Locates the focus engine instance for the specified component.- Specified by:
getFocusEngine
in interfaceIPropCnr
- Parameters:
comp
- The component requesting the focus engine.- Returns:
- The focus engine instance, or null if not found.
canRequestFocus
Returns if this component can receive focus. Focus capable components may override to returnnull
for success, or other error message.Default processing is to return "Component not focusable" if the component doesn't implement the
IFocusComp
interface, "Not virtualized" if the component is not in a virtualized state, ornull
otherwise.- Specified by:
canRequestFocus
in interfaceIPropCnr
- Parameters:
ignoreVisibleFlag
- Flag indicating that the visible state should be ignored. If this flag is false and the component hidden an error message is returned.ignoreEnabledFlag
- Flag indicating that the enabled state should be ignored. If this flag is false and the component hidden an error message is returned.- Returns:
null
focus is possible to this component, or an error message describing why focus cannot be requested.
couldRequestFocusIfVirtualized
Returns if this component could receive focus if it would be virtualized. Focus capable components may override to returnnull
for success, or other error message.Default processing is to return "Component not focusable" if the component doesn't implement the
IFocusComp
interface ornull
otherwise.- Specified by:
couldRequestFocusIfVirtualized
in interfaceIPropCnr
- Parameters:
ignoreVisibleFlag
- Flag indicating that the visible state should be ignored. If this flag is false and the component hidden an error message is returned.ignoreEnabledFlag
- Flag indicating that the enabled state should be ignored. If this flag is false and the component hidden an error message is returned.- Returns:
null
focus is possible to this component, or an error message describing why focus cannot be requested.
requestFocus
Requests focus to this component. This call is redirected to the focus engine for the component type. The engine may veto the focus change, because it currently cannot change focus, or the request is not or cannot be virtualized.This method is less precise than
requestFocusEx(IGProp, boolean, IFocusVetoListener)
, but avoids try-catching.This method is implemented in
PropCnr
, but should only be called forIFocusComp
implementing property classes. This method will return "Component not focusable" if called on a non-focus component.- Specified by:
requestFocus
in interfaceIPropCnr
- Parameters:
trigger
- The trigger property, null for none.isRemoteInduced
- Flag for remote induced focus.- Returns:
null
for success, otherwise an error message indicating why focus was not able to be changed.
requestFocusEx
Requests focus to this component. This call is redirected to the focus engine for the component type. The engine may veto the focus change, because it currently cannot change focus, or the request is not or cannot be virtualized.This method is implemented in
PropCnr
, but should only be called forIFocusComp
implementing property classes. This method will throwFocusException
with message "Component not focusable" if called on a non-focus component.- Specified by:
requestFocusEx
in interfaceIPropCnr
- Parameters:
trigger
- The trigger property, null for none.isRemoteInduced
- Flag for remote induced focus.- Returns:
- true if focus was changed, false otherwise.
- Throws:
FocusException
- If focus could not be changed.
requestFocus
protected String requestFocus(IGProp<?> trigger, boolean isRemoteInduced, IFocusVetoListener callback) Requests focus to this component. This call is redirected to the focus engine for the component type. The engine may veto the focus change, because it currently cannot change focus, or the request is not or cannot be virtualized.This method is less precise than
requestFocusEx(IGProp, boolean, IFocusVetoListener)
, but avoids try-catching.This method is implemented in
PropCnr
, but should only be called forIFocusComp
implementing property classes. This method will return "Component not focusable" if called on a non-focus component.- Parameters:
trigger
- The trigger property, null for none.isRemoteInduced
- Flag for remote induced focus.callback
- Optional callback that may throw a veto exception, null for none. This callback is intended to perform focus changes in the tree, typically for UI containers.- Returns:
null
for success, otherwise an error message indicating why focus was not able to be changed.
requestFocusEx
protected boolean requestFocusEx(IGProp<?> trigger, boolean isRemoteInduced, IFocusVetoListener callback) throws FocusException Requests focus to this component. This call is redirected to the focus engine for the component type. The engine may veto the focus change, because it currently cannot change focus, or the request is not or cannot be virtualized.This method is implemented in
PropCnr
, but should only be called forIFocusComp
implementing property classes. This method will throwFocusException
with message "Component not focusable" if called on a non-focus component.- Parameters:
trigger
- The trigger property, null for none.isRemoteInduced
- Flag for remote induced focus.callback
- Optional callback that may throw a veto exception, null for none. This callback is intended to perform focus changes in the tree, typically for UI containers.- Returns:
- true if focus was changed, false otherwise.
- Throws:
FocusException
- If focus could not be changed.
hasFocus
public boolean hasFocus()Returns if the component currently has focus.getRetargetedVerifyContainer
Gets the retargeted verification property container.- Returns:
- The default is to return
null
.
verifyInternalUseOnly
public final int verifyInternalUseOnly(Set<PropCnr> currentlyBeingVerifiedPropCnrs, IKStringInfoProvider provider) Verifies this property after editing. This is done from the PropHelper during processing of queued verifications.To request a verification, use
com.iizigo.editor#queueVerify(PropCnr)
orcom.iizigo.editor#doVerify(PropCnr)
instead.This method will warn if called for a property not having the parent of
FileURIPropCnr
,FolderURIPropCnr
or a root property.- Parameters:
currentlyBeingVerifiedPropCnrs
- The synchronized set of properties currently being verified.provider
- The KString information provider.- Returns:
- 0 for no errors, 1 for errors present, -1 for not executed.
- Throws:
NullPointerException
- Ifprovider
isnull
.
getErrorsProp
Gets the errors property. If it's not present it may be created. An InternalError is thrown if the property is created by couldn't be added.- Specified by:
getErrorsProp
in interfaceIPropCnr
- Parameters:
createIfNotPresent
- Set to true to create the property if it's not present.- Returns:
- null if the errors property doesn't exist.
getChildPropErrorSeverity
Gets the error severity of a child property. This call makes it possible to check if the property is missing.- Specified by:
getChildPropErrorSeverity
in interfaceIPropCnr
- Parameters:
atom
- The atom name of the child property.- Returns:
- -1 for none, otherwise IPropErrorItem.INFO=0, WARNING=1, ERROR=2.
getChildPropErrorSeverity
Gets the error severity of a child property. This call makes it possible to check if the property is missing.- Specified by:
getChildPropErrorSeverity
in interfaceIPropCnr
- Parameters:
name
- The name of the child property.- Returns:
- -1 for none, otherwise IPropErrorItem.INFO=0, WARNING=1, ERROR=2.
getChildPropError
Gets the child property default error ID. This call makes it possible to get an error for a property that does not exist and the error is stored in this parent instead.- Specified by:
getChildPropError
in interfaceIPropCnr
- Parameters:
atom
- The atom name of the child property.- Returns:
- The error item property, or null for no error.
getChildPropError
Gets the child property default error ID. This call makes it possible to get an error for a property that does not exist and the error is stored in this parent instead.- Specified by:
getChildPropError
in interfaceIPropCnr
- Parameters:
name
- The name of the child property.- Returns:
- The error item property, or null for no error.
verify
Verifies this property container. The check performed is the extension of classes and that no circular reference is present. It is recommended to override the method rather than theverify
method.verifyTree
Verifies if this property container and its children for problems.- Parameters:
provider
- The KString information provider.- Returns:
- A list of errors, or null if OK.
- Throws:
NullPointerException
- Ifprovider
isnull
.
isChild
Checks if the property parameter is a child property in this container property.isSibling
Checks if the property parameter is a sibling property in this container property.getPossibleChildren
Gets the acceptable children property classes that can be used in conjunction with e.g. a Paste operation.- Specified by:
getPossibleChildren
in interfaceIPropCnr
- Returns:
- An array containing the classes of possible children, or null for no support.
validateClassInstances
Validates the target property container classes for paste/move with additional instance testing, extra check when the possible children are verified.Override this method that by default returns true to provide fine-tuned testing for validity.
- Specified by:
validateClassInstances
in interfaceIPropCnr
- Parameters:
doPerform
- The perform flag, false means just testing.props
- Properties to move or paste.isMove
- Flag for move if true, false means paste.- Returns:
- true if the class instances for move or paste are valid, false otherwise.
getVSReference
Gets a VSReference instance from the container or any parent containers. The method is used byVSRelativeReference
to look up theVSReference
instance in order to resolve the relative path to the target property.This method needs to be overridden by subclasses of
PropCnr
that has a VSReference as property, e.g. theJSONInProp
class in the Web Service plug-in.The default is to re-target the call to the parent container, and if the root, a folder or a file property is reached,
null
is returned.- Specified by:
getVSReference
in interfaceIGProp<GProp<?>[]>
- Overrides:
getVSReference
in classGProp<GProp<?>[]>
- Parameters:
refAtom
- The property asking for the VSReference.- Returns:
- The instance of the
VSReference
ornull
if unassigned. The returned instance could also be a VSParticipant and should therefore be processed accordingly.
createVSReference
Creates a VSReference instance from the container or any parent containers. The method is used in the Designer to create a VirtualSpace connection forVSRelativeReference
to look up theVSReference
instance in order to resolve the relative path to the target property.This method needs to be overridden by subclasses of
PropCnr
that has a VSReference as property, and *SHOULD* matchgetVSReference(Atom)
.The default is to re-target the call to the parent container, and if the root, a folder or a file property is reached,
null
is returned.- Parameters:
refAtom
- The property asking for the VSReference.returnParent
- An array of PropCnr [1] that will be filled in with the parent property of the VSRefernce.- Returns:
- The instance of the
VSReference
created ornull
if impossible. The instance has NOT been added to any container, i.e. is orphan.
getPropBaseReference
Gets a base property container reference instance from the container or any parent containers. The method is used byPropRelativeReference
to look up the reference instance in order to resolve the relative path to the target property.This method needs to be overridden by subclasses of
PropCnr
that has a PropRelativeReference as property, e.g. theScreenProp
class in the Terminal Core plug-in.The default is to re-target the call to the parent container, and if the root, a folder or a file property is reached,
null
is returned.- Specified by:
getPropBaseReference
in interfaceIGProp<GProp<?>[]>
- Overrides:
getPropBaseReference
in classGProp<GProp<?>[]>
- Returns:
- The instance of the
PropCnr
ornull
if unassigned.
resolveRuntimeReferences
Called before transactions are prepared for sending. This method allows creation of e.g. runtime references such as Styles or Panel references that adds a virtual instance for the Client.This call is propagated in the entire client tree.
- Specified by:
resolveRuntimeReferences
in interfaceIGProp<GProp<?>[]>
- Overrides:
resolveRuntimeReferences
in classGProp<GProp<?>[]>
- Parameters:
resolver
- The reference resolver.
getExtendsPossibleClasses
Gets the possible classes this container supports for the Extends Framework. The default implementation is to return null.- Specified by:
getExtendsPossibleClasses
in interfaceIPropCnr
- Returns:
- List of supported classes, or null for none.
isExtendsPropertyValid
Validates an extends property for the Extends Framework.- Parameters:
property
- The property to validate.- Returns:
- true if the extends property is valid.
setExtendsName
Sets the extends property name. The property name is set, but this can still result in an error (the reference is not found, or a circular reference occurred).- Specified by:
setExtendsName
in interfaceIPropCnr
- Parameters:
newName
- The new extends from property, null to clear.- Returns:
- Change flag, i.e. if there was a change, or false for no change or failure.
- Throws:
PropException
- If called from the Server or Client, or if this property container doesn't support the Extends Framework.
getExtendsName
Gets the reference property name being extended.- Specified by:
getExtendsName
in interfaceIPropCnr
- Returns:
- The reference name of the extended container, or null for none.
getExtendsError
Gets the Extends Framework error.- Specified by:
getExtendsError
in interfaceIPropCnr
- Returns:
- An error string with the error, or null for no error.
setExtendsOverride
Sets a property name as overridden in this container using extendsFrom another container. This effectively removes the property that is present in the extends-from-container from this container, leaving a null-reply at e.g. getProp(...).- Specified by:
setExtendsOverride
in interfaceIPropCnr
- Parameters:
atom
- The atom to override.on
- When set, adds this as being an overridden property. When cleared, removes the property from being overridden.- Returns:
- true for change, false for no change or failure.
isExtendsOverriden
Checks if a property name is overridden in this container when using the Extends Framework.- Specified by:
isExtendsOverriden
in interfaceIPropCnr
- Parameters:
atom
- The atom to override.- Returns:
- true for overridden, false otherwise.
initializeExtendsFramework
Initializes the extends framework for this container. It must first have been defined usingsetExtendsName
.If an exception occurs, use
getExtendsError()
to get the error message.- Specified by:
initializeExtendsFramework
in interfaceIPropCnr
- Parameters:
triggerEvent
- The event that triggered this reference event, null for none.- Returns:
- true if initialized, false for already initialize.
- Throws:
PropException
- An exception for initializing errors (e.g. invalid reference, invalid properties).
getExtendsOverride
Gets the extends override atoms.- Returns:
- The atom array (never empty), or null for none.
isExtendsRoot
public final boolean isExtendsRoot()Checks if this container is an Extends Root container, i.e. one that has a defined Extends Name defined.- Specified by:
isExtendsRoot
in interfaceIPropCnr
- Returns:
- true if this container is the root of an extended container, or false for all other properties.
getExtendsContainer
Gets the extends container. This method will only work in the Designer and when the extends name has been resolved.- Returns:
- The container being extended, null for none or if the name is not resolved.