Package com.iizix.prop
Class AssetReferences
- All Implemented Interfaces:
EventListener,IGProp<String>,IReferencingGProp,Cloneable
- Direct Known Subclasses:
CSSAssetReferences
The Asset References property class hold the references to zero or more FileURIPropCnr property containers. The reference names are separated by comma in the string.
- Author:
- Christopher Mindus
Field Summary
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_2Fields 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_PRIVATEConstructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a Asset References property with no name and with a null value.AssetReferences(Atom propertyAtom) Creates a Asset References property with the specified name with a null value.AssetReferences(Atom propertyAtom, String newValue) Creates a Asset References property with the specified name and value.Method Summary
Modifier and TypeMethodDescriptionvoidassignServerAppFiles(FileURIPropCnr[] serverFiles, String[] clientResourcePaths) The files when running in the server in a loaded app, null otherwise.clone()Clones this property.protected booleanequalsErrors(PropError pe1, PropError pe2, int how) Processes error property verification.protected voidCall this method to inform a listener.Gets the client resource URLs to the files when loaded from Jar in server.Gets the resources associates with the references.final IGProp<?> Gets the single-referenced target.final Set<FileURIPropCnr> Gets the properties that this referencing property directly references.Gets the properties that this referencing property directly references.protected abstract StringgetErrorMessage(String fullPathOrURL) Gets the error message for an invalid file extension.protected abstract StringThe file type description.Gets the reference Type.String[]Gets all the resource reference strings.final booleanGets if this referencing property is of single-reference type or that can have between zero and many references.protected abstract booleanValidates each asset file for correct file extension.voidonEventSelf(GEvent event) Called when a property event is send to this property.protected voidCalled when a project name has been changed.protected voidProperty disposed of: dispose of reference.protected voidCalled to perform reference resolving.booleanverify(PropVerification verification) Verifies this property.Methods inherited from class com.iizix.prop.StringProp
appendPropValue, getPropValue0, getString, getString, getValueClasses, initializeValue, setPropValue, toNativeValue0, validatePropTypeMethods 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, initializeElement, initializeGElement, initializeGProp, initializeProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCommunicating, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, 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, virtualize, warning, warning, warningMethods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.iizix.prop.IReferencingGProp
getParent, getReferencingOwner
Constructor Details
AssetReferences
protected AssetReferences()Creates a Asset References property with no name and with a null value.AssetReferences
Creates a Asset References property with the specified name with a null value.- Parameters:
propertyAtom- the property atom.
AssetReferences
Creates a Asset References property with the specified name and value.- Parameters:
propertyAtom- the property atom.newValue- the new string value for the property.- Throws:
PropValidateException- When the constraints are not met.
Method Details
clone
Clones this property.- Overrides:
clonein classStringProp- Returns:
- An AssetReferences instance.
onPropDispose
protected void onPropDispose()Property disposed of: dispose of reference.- Overrides:
onPropDisposein classGProp<String>
equalsErrors
Processes error property verification. The default processing is to verify the two error propertiespe1andpe2for equality ifincludeErrorsis 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 classGProp<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.
getReferenceType
Gets the reference Type.- Specified by:
getReferenceTypein interfaceIReferencingGProp- Returns:
IPropReference.RefType.AssetsFile.
onEventSelf
Called when a property event is send to this property.A subclass can override this method to perform appropriate processing and is not required to call
super.onEventSelf(e).- Specified by:
onEventSelfin interfaceIGProp<String>- Overrides:
onEventSelfin 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
PropCnrneeds to callsuper.onReferenceEvent(ResolveReferenceEvent event).- Overrides:
onReferenceEventin classGProp<String>- Parameters:
event- The resolve references event.
onProjectNameChanged
Called when a project name has been changed.- Parameters:
event- The project name event.
getAllFiles
Gets the resources associates with the references. The array may containnullmembers in which case that reference is not resolved.- Returns:
- The array returned is never null but may be of length zero.
getResourceReferences
Gets all the resource reference strings.- Returns:
- An array of string resources.
fireChanged
protected void fireChanged()Call this method to inform a listener.isReferencingMultipleTargets
public final boolean isReferencingMultipleTargets()Gets if this referencing property is of single-reference type or that can have between zero and many references.- Specified by:
isReferencingMultipleTargetsin interfaceIReferencingGProp- Returns:
trueas there can be multiple references.
getDirectReferencedTarget
Gets the single-referenced target. Referencing properties that can have multiple targets should ALWAYS returnnullfor this method and use the methodgetDirectReferencedTargetSet()instead.- Specified by:
getDirectReferencedTargetin interfaceIReferencingGProp- Returns:
- Always
nullas there can be multiple references.
getDirectReferencedTargetSet
Gets the properties that this referencing property directly references. Referencing properties that only has a single target should ALWAYS returnnullfor this method and use the methodgetDirectReferencedTarget()instead.- Specified by:
getDirectReferencedTargetSetin interfaceIReferencingGProp- Returns:
- A list of properties, or
nullfor none. All properties returned are of FileURIPropCnr types.
getDirectReferencedTargetFiles
Gets the properties that this referencing property directly references. Referencing properties that only has a single target should ALWAYS returnnullfor this method and use the methodgetDirectReferencedTarget()instead.- Returns:
- A list of target FileURIPropCnr's, or
nullfor none.
assignServerAppFiles
The files when running in the server in a loaded app, null otherwise.This method cannot be called from elsewhere than the server app loader, and once only.
- Parameters:
clientResourcePaths- The client resource paths.fixedServerFiles- The server files to assign.- Throws:
IllegalStateException- In case this is not done from the server app loader.
fixedClientResourceURLs
Gets the client resource URLs to the files when loaded from Jar in server. The list is not modifiable.- Returns:
- The list of client resource URLs, or
nullwhen app is not loaded from a Jar in the server.
isValidFileExtension
Validates each asset file for correct file extension.- Parameters:
ext- The asset file extension to verify, without the "." prefix, meaning if there is no file extension, then an empty string is passed.- Returns:
trueif extension is valid,falseotherwise.
getFileTypeDescr
The file type description.- Returns:
- The file type description, e.g. "CSS file".
getErrorMessage
Gets the error message for an invalid file extension.- Parameters:
fullPathOrURL- The full file name or URL path.- Returns:
- The error message.
verify
Verifies this property. The check performed is the extension of classes and that no circular reference is present.