Class AssetReferences

All Implemented Interfaces:
EventListener, IGProp<String>, IReferencingGProp, Cloneable

public class AssetReferences extends StringProp implements IReferencingGProp
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
  • Constructor Details

    • AssetReferences

      protected AssetReferences()
      Creates a Asset References property with no name and with a null value.
    • AssetReferences

      public AssetReferences(Atom propertyAtom)
      Creates a Asset References property with the specified name with a null value.
      Parameters:
      propertyAtom - the property atom.
    • AssetReferences

      public AssetReferences(Atom propertyAtom, String newValue) throws PropValidateException
      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

    • onPropDispose

      protected void onPropDispose()
      Property disposed of: dispose of reference.
      Overrides:
      onPropDispose in class GProp<String>
    • equalsErrors

      protected boolean equalsErrors(PropError pe1, PropError pe2, int how)
      Processes error property verification. The default processing is to verify the two error properties pe1 and pe2 for equality if includeErrors is 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:
      equalsErrors in 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 includeErrors value.
    • getReferenceType

      public IPropReference.IRefType getReferenceType()
      Gets the reference Type.
      Specified by:
      getReferenceType in interface IReferencingGProp
      Returns:
      IPropReference.RefType.AssetsFile.
    • onEventSelf

      public void onEventSelf(GEvent event)
      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:
      onEventSelf in interface IGProp<String>
      Overrides:
      onEventSelf in class GProp<String>
      Parameters:
      event - The property event.
    • onReferenceEvent

      protected void onReferenceEvent(ResolveReferencesEvent event)
      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 call super.onReferenceEvent(ResolveReferenceEvent event).

      Overrides:
      onReferenceEvent in class GProp<String>
      Parameters:
      event - The resolve references event.
    • onProjectNameChanged

      protected void onProjectNameChanged(ProjectNameEvent event)
      Called when a project name has been changed.
      Parameters:
      event - The project name event.
    • getAllFiles

      public FileURIPropCnr[] getAllFiles()
      Gets the Styles associates with the references. The array may contain null members in which case that reference is not resolved.
      Returns:
      The array returned is never null but may be of length zero.
    • 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:
      isReferencingMultipleTargets in interface IReferencingGProp
      Returns:
      true as there can be multiple references.
    • getDirectReferencedTarget

      public final IGProp<?> getDirectReferencedTarget()
      Gets the single-referenced target. Referencing properties that can have multiple targets should ALWAYS return null for this method and use the method getDirectReferencedTargetSet() instead.
      Specified by:
      getDirectReferencedTarget in interface IReferencingGProp
      Returns:
      Always null as there can be multiple references.
    • getDirectReferencedTargetSet

      public final Set<IGProp<?>> getDirectReferencedTargetSet()
      Gets the properties that this referencing property directly references. Referencing properties that only has a single target should ALWAYS return null for this method and use the method getDirectReferencedTarget() instead.
      Specified by:
      getDirectReferencedTargetSet in interface IReferencingGProp
      Returns:
      A list of properties, or null for none. The default is that this method returns null unless overridden.