Class CCAbstractItem
java.lang.Object
com.ibm.debug.pdt.codecoverage.core.results.CCAbstractItem
- All Implemented Interfaces:
ICCBase
- Direct Known Subclasses:
CCAbstractExporter,CCAbstractExporterInfo,CCAbstractExporterSettings,CCAbstractImportInput,CCAbstractTreeItem
Base implementation of
ICCBase.
Implementors of the API exporter and importer interfaces can use this default implementation or implement ICCBase directly- Since:
- 3.1
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddEncodedMessage(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 theICCBaseobjectfinal voidaddMessage(String messageKey, String... parms) This is a helper method to store a message and its parms in a format that doesn't contain translatable text.final voidaddMessage(Throwable cause) Add message text from an exception to this artifactString[]Returns an array of decoded messagesICCBase.getMessages()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 localeICCBase.getMessages()returns the encoded form, this method returns the messages already decodedfinal intgetID()Get a unique ID associated with this artifactfinal String[]Return messages associated with this artifact Messages that were added as plain text will be returned as is UseCCMessageUtilitiesto decode the messagesfinal StringgetName()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 artifactfinal ObjectgetProperty(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 setvoidSet the name of this artifact In version 10.1 this became part of the APIfinal 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.
-
Field Details
-
TEMPPROP
- Since:
- 10.0
- See Also:
-
-
Method Details
-
addMessage
This is a helper method to store a message and its parms in a format that doesn't contain translatable text. Given a message key and an array of zero or more parms the message in converted to an internal format. This method can be used when adding a message to an #ICCBase object where the key and parms are stored.CCMessageUtilities.getMessage(String)can be used to retrieve the message and the text in the default language. New behavior in 7.0 supports enforcing a single instance of a message. Add messages usingaddSingletonMsg(String)- Specified by:
addMessagein interfaceICCBase- Parameters:
messageKey- message idparms- zero or more substitution text for the message- Since:
- 4.0
- See Also:
-
addMessage
Add message text from an exception to this artifact- Specified by:
addMessagein interfaceICCBase- Parameters:
cause- exception to add as a message- Since:
- 4.0
-
addEncodedMessage
Description copied from interface:ICCBaseMessages 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- Specified by:
addEncodedMessagein interfaceICCBase- Parameters:
encodedMessage- encoded message to add to artifact- Since:
- 4.0
-
getMessages
Description copied from interface:ICCBaseReturn messages associated with this artifact Messages that were added as plain text will be returned as is UseCCMessageUtilitiesto decode the messages- Specified by:
getMessagesin interfaceICCBase- Returns:
- empty array or array of encoded messages
- See Also:
-
getDecodedMessages
Description copied from interface:ICCBaseReturns an array of decoded messagesICCBase.getMessages()returns the encoded form, this method returns the messages already decoded The messages will be decoded using the default locale- Specified by:
getDecodedMessagesin interfaceICCBase- Returns:
- empty array or array of decoded messages
- Since:
- 5.0
-
getDecodedMessages
Description copied from interface:ICCBaseReturns an array of decoded messages using the supplied localeICCBase.getMessages()returns the encoded form, this method returns the messages already decoded- Specified by:
getDecodedMessagesin interfaceICCBase- Parameters:
locale- to use when decoding messages- Returns:
- empty array or array of decoded messages
- Since:
- 5.0
-
isMessage
public boolean isMessage()Description copied from interface:ICCBaseReturns true if there are messages -
setProperty
Description copied from interface:ICCBaseSet a property associated with this artifact. It can be retrieved usingICCBase.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- 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)
- Specified by:
setPropertyin interfaceICCBase- Parameters:
key- property keyvalue- property value
-
updateProperty
Description copied from interface:ICCBaseUpdates 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.- Specified by:
updatePropertyin interfaceICCBase- 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
-
getProperty
Description copied from interface:ICCBaseGet a property associated with this artifact- Specified by:
getPropertyin interfaceICCBase- Parameters:
key- or property name- Returns:
- property value or null if the property does not exist
-
getProperty
Description copied from interface:ICCBaseGet a property and if it doesn't exist return the default value- Specified by:
getPropertyin interfaceICCBase- Parameters:
key- property keydefaultValue- value to return if key not found- Returns:
- property value or default value
-
isProperty
Description copied from interface:ICCBaseReturns true if the property has been set- Specified by:
isPropertyin interfaceICCBase- Parameters:
key- property key- Returns:
- true if property set
-
getID
public final int getID()Description copied from interface:ICCBaseGet a unique ID associated with this artifact -
getName
Description copied from interface:ICCBaseReturns a meaningful name for the item Items will have other methods if the name can have context information -
getProperties
Description copied from interface:ICCBaseReturns the list of available properties- Specified by:
getPropertiesin interfaceICCBase- Returns:
- array of zero or more property keys
- Since:
- 4.0
- See Also:
-
setName
Set the name of this artifact In version 10.1 this became part of the API
-