Package com.iizigo.java.prop
Class EditorMethodReference
java.lang.Object
com.iizix.prop.GProp<String>
com.iizix.prop.StringProp
com.iizix.prop.MethodReference
com.iizigo.java.prop.EditorMethodReference
- All Implemented Interfaces:
EventListener
,IGProp<String>
,Cloneable
The Designer version of the Method Reference property class hold the reference to a Method that is in a Java class. This Java class reference "ClassReference" is held by a parent container in the tree. It includes support for Java Refactoring in Eclipse as well as Reference Validation.
- Author:
- Christopher Mindus
Field Summary
Fields inherited from class com.iizix.prop.MethodReference
requiredAnnotation, runtimeMethod
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_INCLUDE_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
ConstructorDescriptionCreates a Method Reference property with no name and with a null value.EditorMethodReference
(Atom propertyAtom) Creates a Method Reference property with the specified name with a null value.EditorMethodReference
(Atom propertyAtom, String newValue) Creates a Class Reference property with the specified name and value.Method Summary
Modifier and TypeMethodDescriptionstatic EditorClassReference
getClassReference
(PropCnr methodReferenceParent) Gets the ClassReference property from a parent.static IClassReferenceOwner
getClassReferenceOwner
(PropCnr methodReferenceParent) Gets the ClassReference parent that SHOULD or COULD hold the ClassReference for a MethodReference.static JavaClass
getJavaClass
(PropCnr methodReferenceParent) Gets the JavaClass (IClassReference) from a parent.Gets the Java element in resolve, could be a IType or IMethod (even the wrong IMethod due to missing annotation or compile error).Get the fully qualified annotation name that the Java Class should be annotated with.boolean
Checks for missing annotation.void
onEventSelf
(GEvent event) Event processing for Java Class Reference changed.protected void
Called when a property is disposed of.protected void
Called to perform reference resolving.resolve()
Resolves the reference.void
setRequiredAnnotation
(String requiredAnnotation) Assigns a fully qualified annotation name that the Java Class should be annotated with.Methods inherited from class com.iizix.prop.MethodReference
equalsErrors, getRuntimeMethod, initializeElement, initializeProp, isPropPrivateAtCreation, lookupMethod
Methods inherited from class com.iizix.prop.StringProp
appendPropValue, clone, getPropValue0, getString, getString, getValueClasses, initializeValue, setPropValue, toNativeValue0, validatePropType
Methods inherited from class com.iizix.prop.GProp
addPropError, addPropListener, appendProp, convertPropError, dispose, equals, equals, equalsObj, equalsPropValue, equalsTree, equalValues, 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, isSibling, list, list, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropTreeInitialized, onPropValueSet, onRemoteEvent, onVirtualizationCompleted, 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, virtualize, warning, warning, warning
Field Details
ERROR_ID
The ID of the property error.- See Also:
Constructor Details
EditorMethodReference
public EditorMethodReference()Creates a Method Reference property with no name and with a null value.EditorMethodReference
Creates a Method Reference property with the specified name with a null value.- Parameters:
propertyAtom
- the property atom.
EditorMethodReference
Creates 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
setRequiredAnnotation
Assigns a fully qualified annotation name that the Java Class should be annotated with.Setting the annotation name doesn't cause a property change.
- Parameters:
requiredAnnotation
- The annotation required, or null for none.
getRequiredAnnotation
Get the fully qualified annotation name that the Java Class should be annotated with.- Returns:
- Gets the required annotation name, null for none.
onEventSelf
Event processing for Java Class Reference changed.- Specified by:
onEventSelf
in interfaceIGProp<String>
- Overrides:
onEventSelf
in classGProp<String>
- Parameters:
event
- The property event.
onReferenceEvent
Called to perform reference resolving. A property should override this method if it needs to perform reference resolving and validation.Subclasses override this method and only subclasses extending
PropCnr
needs to callsuper.onReferenceEvent(ResolveReferenceEvent event)
.- Overrides:
onReferenceEvent
in classGProp<String>
- Parameters:
event
- The resolve references event.
getJavaClass
Gets the JavaClass (IClassReference) from a parent.- Returns:
- null if not found.
getClassReferenceOwner
Gets the ClassReference parent that SHOULD or COULD hold the ClassReference for a MethodReference.- Returns:
- null if not found.
getClassReference
Gets the ClassReference property from a parent.- Returns:
- null if not found.
resolve
Resolves the reference.- Returns:
- The method Object (IMethod for Designer), or class/type instance (IType for Designer) if class is present but not the method, or a String for the error (can also be null e.g. for no method name). Do not use the return code in other places than the Designer.
getJavaElement
Gets the Java element in resolve, could be a IType or IMethod (even the wrong IMethod due to missing annotation or compile error). This should only be used e.g. in the Show in Java Editor function.isAnnotationMissing
public boolean isAnnotationMissing()Checks for missing annotation. This call should only be used in the Designer.- Returns:
- null For not missing or can't do anything, otherwise the JavaClass instance.
onPropDispose
protected void onPropDispose()Called when a property is disposed of.- Overrides:
onPropDispose
in classGProp<String>