Package com.iizix.prop
Interface IPropErrorItem
- All Superinterfaces:
Cloneable
- All Known Implementing Classes:
PropErrorItem
,PropErrorItemValue
The generic property item error. A property can have several difference errors for each property, each one with a unique ID. One or more quick-fixes may be available, in which case there are Quick-fix IDs.
- Author:
- Christopher Mindus
Field Summary
Method Summary
Modifier and TypeMethodDescriptionclone()
Clones the error item.boolean
Checks if two error items are equal.default String
Gets the name of the child property that is "missing".getID()
Gets the ID of this error.int
getIndex()
Gets the index for a multi-property.Gets the location of an error, for user info only.Gets the location or property name of an error, for user info only.Gets the error message.String[]
Gets the quick-fix ID's.int
Gets the severity.getText
(boolean includeID) Gets a textual error description as "LEVEL[{\t}id]{\t}text" (where {\t} is the tab character).default boolean
Returns the flag indicating this error should be put in a child property with the name returned bygetChildPropName()
.void
Initializes the error from XML.void
Saves the item to XML.void
setIndex
(int index) Sets the index for a multi-property.
Field Details
ERROR
static final int ERRORThe error level: ERROR (=2).- See Also:
WARNING
static final int WARNINGThe error level: WARNING (=1).- See Also:
INFO
static final int INFOThe error level: INFO (=0).- See Also:
CHILD_PROP_ERROR_PREFIX
The prefix for child property error.- See Also:
VERIFY_ERROR_CHILD_PREFIX
The verification prefix for child errors.- See Also:
Method Details
setIndex
void setIndex(int index) Sets the index for a multi-property.- Parameters:
index
- 0 for main part, otherwise one-based index for errored property value.
getSeverity
int getSeverity()Gets the severity.- Returns:
- INFO, WARNING or ERROR.
getID
String getID()Gets the ID of this error.getMessage
String getMessage()Gets the error message.- Returns:
- The error message.
getLocation
String getLocation()Gets the location of an error, for user info only.- Returns:
- The location, or null for none.
getLocationOrName
String getLocationOrName()Gets the location or property name of an error, for user info only.- Returns:
- The location, or the property name if none is defined, never null.
getText
Gets a textual error description as "LEVEL[{\t}id]{\t}text" (where {\t} is the tab character).- Parameters:
includeID
- Flag to include ID or not.
getIndex
int getIndex()Gets the index for a multi-property.- Returns:
- -1 for none, 0 for main part, otherwise one-based index for errored property value.
getQuickFixes
String[] getQuickFixes()Gets the quick-fix ID's.- Returns:
- The list of quick-fix ID's or
null
for none.
clone
IPropErrorItem clone()Clones the error item.- Returns:
- A clone.
equals
Checks if two error items are equal.load
Initializes the error from XML.- Parameters:
element
- TheerrorItem
element.- Throws:
Exception
- For errors in XML.
save
Saves the item to XML.- Parameters:
element
- TheerrorItem
element to save the data to.
isChildPropError
default boolean isChildPropError()Returns the flag indicating this error should be put in a child property with the name returned bygetChildPropName()
.getChildPropName
Gets the name of the child property that is "missing".- Returns:
- The name of the child property, or null if not a child property error, i.e.
isChildPropError()
returns false.