Interface ICCBase

All Known Subinterfaces:
ICCBranchPoint, ICCExporterInfo, ICCExporterSettings, ICCFile, ICCFlowPoint, ICCImportBranchPoint, ICCImportFile, ICCImportFlowPoint, ICCImportFlowPointParent, ICCImportInput, ICCImportModule, ICCImportPart, ICCImportResult, ICCImportTestcase, ICCModule, ICCPart, ICCResult, ICCTestcase, ICCTreeItem
All Known Implementing Classes:
CCAbstractExporter, CCAbstractExporterInfo, CCAbstractExporterSettings, CCAbstractImportInput, CCAbstractItem, CCAbstractTreeItem, CCEmptyResult

public interface ICCBase
Base methods for result artifacts
Since:
3.1
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addEncodedMessage(String encodedMessage)
    Messages are stored in an encoded format This format consists of a message key and 0 or more parameters By storing the parameters separate from the message text the translated message can be combined at display time This method allows the already encoded message to be stored directly in the ICCBase object
    void
    addMessage(String messageKey, String... parms)
    Add a message to this artifact The format of the message can be: Message Key - the message key must match a message id in the supplied message property files. Plain text message - the text will be stored and returned as is. zero or more parameters that are substituted into the message.
    void
    Add a message with text from an exception
    Returns an array of decoded messages getMessages() returns the encoded form, this method returns the messages already decoded The messages will be decoded using the default locale
    Returns an array of decoded messages using the supplied locale getMessages() returns the encoded form, this method returns the messages already decoded
    int
    Get a unique ID associated with this artifact
    Return messages associated with this artifact Messages that were added as plain text will be returned as is Use CCMessageUtilities to decode the messages
    Returns a meaningful name for the item Items will have other methods if the name can have context information
    Returns the list of available properties
    Get a property associated with this artifact
    getProperty(String key, Object defaultValue)
    Get a property and if it doesn't exist return the default value
    boolean
    Returns true if there are messages
    boolean
    Returns true if the property has been set
    void
    Update name of this item.
    void
    setProperty(String key, Object value)
    Set a property associated with this artifact.
    Updates a property only if a valid value is passed.
  • Method Details

    • getName

      String getName()
      Returns a meaningful name for the item Items will have other methods if the name can have context information
      Returns:
      name assigned to item.
      Since:
      4.0
    • setName

      void setName(String name)
      Update name of this item. It is up the caller to ensure that doesn't cause a name collision It is recommended that the name be set when the artifact is created. There may be side effects to changing the name after it has been created. In addition, some artifacts have other forms of their name that may also need to be updated.
      Parameters:
      name - new name for this item
      Since:
      10.1
    • addMessage

      void addMessage(String messageKey, String... parms)
      Add a message to this artifact The format of the message can be:
      1. Message Key - the message key must match a message id in the supplied message property files.
      2. Plain text message - the text will be stored and returned as is.
      3. zero or more parameters that are substituted into the message.
      Parameters:
      messageKey - - message key or plain text message
      parms - zero or more substitution strings
      Since:
      9.0
      See Also:
    • addMessage

      void addMessage(Throwable cause)
      Add a message with text from an exception
      Parameters:
      cause - exception to add as a message
      Since:
      4.0
    • addEncodedMessage

      void addEncodedMessage(String encodedMessage)
      Messages are stored in an encoded format This format consists of a message key and 0 or more parameters By storing the parameters separate from the message text the translated message can be combined at display time This method allows the already encoded message to be stored directly in the ICCBase object
      Parameters:
      encodedMessage - encoded message to add to artifact
      Since:
      4.0
    • getMessages

      String[] getMessages()
      Return messages associated with this artifact Messages that were added as plain text will be returned as is Use CCMessageUtilities to decode the messages
      Returns:
      empty array or array of encoded messages
      See Also:
    • getDecodedMessages

      String[] getDecodedMessages()
      Returns an array of decoded messages getMessages() returns the encoded form, this method returns the messages already decoded The messages will be decoded using the default locale
      Returns:
      empty array or array of decoded messages
      Since:
      5.0
    • getDecodedMessages

      String[] getDecodedMessages(Locale locale)
      Returns an array of decoded messages using the supplied locale getMessages() returns the encoded form, this method returns the messages already decoded
      Parameters:
      locale - to use when decoding messages
      Returns:
      empty array or array of decoded messages
      Since:
      5.0
    • isMessage

      boolean isMessage()
      Returns true if there are messages
      Returns:
      true if there are messages
    • setProperty

      void setProperty(String key, Object value)
      Set a property associated with this artifact. It can be retrieved using getProperty(String) New in 9.0 the storing of null values for a property is no longer supported. If a null value is desired or has meaning then something like !NULL! should be used for the value. Properties unknown to the importer/exporter should be preserved. To help support this new behaviour the following changes have been made to how this method behaves
      1. Setting a property's value to null will remove it if it already exists
      2. Setting a property's value to null will do nothing if it does not already exist
      3. Setting a property to an empty string will remove it (same effect as passing in null)
      This will make it easier for exporters to preserve properties that were user supplied and avoid writing out empty properties. It will also all callers to write out properties without first checking if the value is null or an empty string.
      Parameters:
      key - property key
      value - property value
      Since:
      5.1 Property names with T_ prefix are considered temporary and are not returned by getProperties(), they can only be retrieved directly by name They can be checked using isProperty(String)
    • updateProperty

      Object updateProperty(String key, Object value)
      Updates a property only if a valid value is passed. To be valid a value must be non-null and if a String is must not be empty. The property is updated and the updated value of the property is returned.
      Parameters:
      key - property name
      value - to update the property if not null or an empty String
      Returns:
      updated value of the property or the original if it was not updated
      Since:
      9.0
    • getProperty

      Object getProperty(String key)
      Get a property associated with this artifact
      Parameters:
      key - or property name
      Returns:
      property value or null if the property does not exist
    • getProperty

      Object getProperty(String key, Object defaultValue)
      Get a property and if it doesn't exist return the default value
      Parameters:
      key - property key
      defaultValue - value to return if key not found
      Returns:
      property value or default value
      Since:
      7.0
    • isProperty

      boolean isProperty(String key)
      Returns true if the property has been set
      Parameters:
      key - property key
      Returns:
      true if property set
    • getID

      int getID()
      Get a unique ID associated with this artifact
      Returns:
      unique ID
    • getProperties

      String[] getProperties()
      Returns the list of available properties
      Returns:
      array of zero or more property keys
      Since:
      4.0