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 TypeMethodDescriptionvoidaddEncodedMessage(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 theICCBaseobjectvoidaddMessage(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.voidaddMessage(Throwable cause) Add a message with text from an exceptionString[]Returns an array of decoded messagesgetMessages()returns the encoded form, this method returns the messages already decoded The messages will be decoded using the default localeString[]getDecodedMessages(Locale locale) Returns an array of decoded messages using the supplied localegetMessages()returns the encoded form, this method returns the messages already decodedintgetID()Get a unique ID associated with this artifactString[]Return messages associated with this artifact Messages that were added as plain text will be returned as is UseCCMessageUtilitiesto decode the messagesgetName()Returns a meaningful name for the item Items will have other methods if the name can have context informationString[]Returns the list of available propertiesgetProperty(String key) Get a property associated with this artifactgetProperty(String key, Object defaultValue) Get a property and if it doesn't exist return the default valuebooleanReturns true if there are messagesbooleanisProperty(String key) Returns true if the property has been setvoidUpdate name of this item.voidsetProperty(String key, Object value) Set a property associated with this artifact.updateProperty(String key, Object value) 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
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
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.
- Parameters:
messageKey- - message key or plain text messageparms- zero or more substitution strings- Since:
- 9.0
- See Also:
-
addMessage
Add a message with text from an exception- Parameters:
cause- exception to add as a message- Since:
- 4.0
-
addEncodedMessage
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 theICCBaseobject- 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 UseCCMessageUtilitiesto decode the messages- Returns:
- empty array or array of encoded messages
- See Also:
-
getDecodedMessages
String[] getDecodedMessages()Returns an array of decoded messagesgetMessages()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
Returns an array of decoded messages using the supplied localegetMessages()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
Set a property associated with this artifact. It can be retrieved usinggetProperty(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- Setting a property's value to null will remove it if it already exists
- Setting a property's value to null will do nothing if it does not already exist
- Setting a property to an empty string will remove it (same effect as passing in null)
- Parameters:
key- property keyvalue- 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 usingisProperty(String)
-
updateProperty
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 namevalue- 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
Get a property associated with this artifact- Parameters:
key- or property name- Returns:
- property value or null if the property does not exist
-
getProperty
Get a property and if it doesn't exist return the default value- Parameters:
key- property keydefaultValue- value to return if key not found- Returns:
- property value or default value
- Since:
- 7.0
-
isProperty
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
-