Class ClassReference
- All Implemented Interfaces:
- EventListener,- IGProp<String>,- Cloneable
- Direct Known Subclasses:
- EditorClassReference
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- protected StringThe required Interface, or null for none.- protected StringThe required annotation, or null for none.- 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 SummaryConstructorsModifierConstructorDescription- protectedCreates a Class Reference property with no name and with a null value.- ClassReference- (Atom propertyAtom) Creates a Class Reference property with the specified name with a null value.- ClassReference- (Atom propertyAtom, String newValue) Creates a Class Reference property with the specified name and value.
- Method SummaryModifier and TypeMethodDescription- clone()Creates a clone out of this property.- protected boolean- equalsErrors- (PropError pe1, PropError pe2, int how) Processes error property verification.- static ClassReference- getClassReference- (PropCnr pc, String id) Gets a ClassReference instance from a property.Gets the method in the loaded runtime class with the specified parameters types.- Class<?>Gets the loaded class for runtime.Gets the runtime instance of the class.- <T> T- getRuntimeInstance- (Class<T> instanceClass) Gets the runtime instance of the class.- protected void- initializeElement- (Element element) Called when the XML file for the property tree is serialized from properties.- protected void- initializeProp- (Element element) Called to initialize the property from an- Element.- protected booleanCalled upon creation of the property to check it's private state.- protected void- onPrepare- (IAppOwner appOwner, IModuleOwner moduleOwner, boolean isPostCall, List<Throwable> errors) Called when the application is being prepared.- protected voidDisposal of the instance.- protected void- onVirtualizationCompleted- (IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, boolean isPostResolve) Called when virtualization completed.- boolean- setPropValue- (String newValue) Sets a new value for this property.- boolean- verifyInterface- (Class<?> interfaceClass, List<Throwable> errors) Validates that the class implements an interface.- protected final ClassReference- virtualize- (IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace) Call this method to "virtualize" a property tree.- Methods inherited from class com.iizix.prop.StringProp- appendPropValue, getPropValue0, getString, getString, getValueClasses, initializeValue, toNativeValue0, validatePropType- Methods inherited from class com.iizix.prop.GProp- addPropError, addPropListener, convertPropError, dispose, equals, equals, equalsObj, equalsPropValue, equalsTree, 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, getPropBaseReference, 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, getVSReference, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCommunicating, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, list, list, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPropInvalidateCache, onPropParentChanged, onPropTreeInitialized, onPropValueSet, onReferenceEvent, onRemoteEvent, paramString, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, resolveRuntimeReferences, setChanged, setConstraints, setConstraints, setCreateRequiredProp, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toElementString, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, validatePropValue, verify, warning, warning, warning
- Field Details- implementsInterfaceThe required Interface, or null for none.
- requiredAnnotationThe required annotation, or null for none.
 
- Constructor Details- ClassReferenceprotected ClassReference()Creates a Class Reference property with no name and with a null value.
- ClassReferenceCreates a Class Reference property with the specified name with a null value.- Parameters:
- propertyAtom- the property atom.
 
- ClassReferenceCreates a Class Reference property with the specified name and value.- Parameters:
- propertyAtom- the property atom.
- newValue- the new string value for the property.
 
 
- Method Details- getClassReferenceGets a ClassReference instance from a property. The IClassReferenceOwner interfaces is searched for upwards in the property tree and from there the ClassReference instance is returned.- Parameters:
- pc- The property container to start search on.
- id- The ID of the ClassReference property, used when multiple are present in the container.
- Returns:
- The ClassReference instance, of null if none is found.
 
- isPropPrivateAtCreationprotected boolean isPropPrivateAtCreation()Called upon creation of the property to check it's private state. This is used by properties that are not distributed to the remote party.- Overrides:
- isPropPrivateAtCreationin class- GProp<String>
- Returns:
- true, always.
 
- equalsErrorsProcesses error property verification. The default processing is to verify the two error properties- pe1and- pe2for equality if- includeErrorsis 0 or 1, and returns true if the value is 2=no comparison with error properties.- Override to verify property errors for reference properties. - Overrides:
- equalsErrorsin class- GProp<String>
- Parameters:
- pe1- The first error property, may be null.
- pe2- The second error property, may be null.
- how- Flags EQC_* values for equal checking.
- Returns:
- Equality flag depending on includeErrorsvalue.
 
- cloneCreates a clone out of this property. The cloning is overridden by the super classes 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. - Note that the cloning process is done WITHOUT thread synchronization for performance reasons, thus no modifications should be done to the tree! - Overrides:
- clonein class- StringProp
- Returns:
- A new cloned String property.
 
- setPropValueSets a new value for this property. If any listener is present and the value has changed compare to the last value, the listener is informed.- Overrides:
- setPropValuein class- StringProp
- Parameters:
- newValue- the new value.
- Returns:
- boolean true for value has changed, false for same value as current value.
 
- initializeElementCalled when the XML file for the property tree is serialized from properties. The property should fill attributes and nodes with appropriate information.- Overrides:
- initializeElementin class- GProp<String>
- Parameters:
- element- The- Elementto initialize.
 
- initializePropCalled to initialize the property from an- Element. The property should initialize itself from attributes and nodes with appropriate information.- Overrides:
- initializePropin class- GProp<String>
- Parameters:
- element- The- Element.
- Throws:
- PropException- when the initialization fails.
 
- onPrepareprotected void onPrepare- (IAppOwner appOwner, IModuleOwner moduleOwner, boolean isPostCall, List<Throwable> errors) throws PropException Called when the application is being prepared. The order of- onPreparecalls is always parent first, the children. The method is called twice, first time with- isPostCallset to- false, then a second time with- true.- Overrides:
- onPreparein class- GProp<String>
- Parameters:
- appOwner- The application owner.
- moduleOwner- The Module owner.
- isPostCall- Flag indicating this is a post-call.
- errors- A list of errors that occurred but did not cause an abort.
- Throws:
- PropException- For property errors during the application preparation to need to abort.
 
- virtualizeprotected final ClassReference 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. - Overrides:
- virtualizein class- GProp<String>
- Parameters:
- appGyro- The application gyro instance performing the virtualization.
- clientGyro- The client gyro session, can be- nullif 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.
 
- onVirtualizationCompletedprotected void onVirtualizationCompleted- (IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, boolean isPostResolve) Called when virtualization completed.- This method is called to the entire tree of the newly virtualized property container. - Overrides:
- onVirtualizationCompletedin class- GProp<String>
- Parameters:
- appGyro- The application gyro instance performing the virtualization.
- clientGyro- The client gyro session, can be- nullif not initialized from the client gyro.
- virtualSpace- The virtualized VirtualSpace.
- isPostResolve- Flag indicating this call is done after references are attempted to be resolved.
 
- getMethodGets the method in the loaded runtime class with the specified parameters types.- Parameters:
- methodName- The method name.
- errors- A list of errors that occurred but did not cause an abort.
- parameterTypes- The list of parameters.
- Returns:
- The method loaded, or nullif not found (and the error is added to the list).
 
- getRuntimeClassGets the loaded class for runtime.- Returns:
- The loaded class, or nullfor none.
 
- getRuntimeInstanceGets the runtime instance of the class.- Returns:
- The instance that was created during virtualization, or nullif there is no loaded class for this reference or if virtualization has not taken place.
 
- getRuntimeInstanceGets the runtime instance of the class.- Parameters:
- instanceClass- The class the runtime instance should be assignable from.
- Returns:
- The instance that was created during virtualization, or nullif there is no loaded class for this reference or if virtualization has not taken place. It is alsonullif the instance is not an instance of the specified classinstanceClass.
 
- onPropDisposeprotected void onPropDispose()Disposal of the instance.- Overrides:
- onPropDisposein class- GProp<String>
 
- verifyInterfaceValidates that the class implements an interface. This method is generally called during the "prepare" phase of the application.- Returns:
- true if the runtime class is defined and implements the interface, false otherwise. When a defined class does not implement the interface, an error is added.