public class PropErrorItem extends Object implements IPropErrorItem
CHILD_PROP_ERROR_PREFIX, ERROR, INFO, VERIFY_ERROR_CHILD_PREFIX, WARNING
Constructor and Description |
---|
PropErrorItem()
Constructs a new instance from an XML element.
|
PropErrorItem(String id,
String message,
int level)
Constructs a new instance.
|
PropErrorItem(String id,
String message,
int level,
String... quickFixes)
Constructs a new instance.
|
PropErrorItem(String id,
String message,
String location,
int level,
String... quickFixes)
Constructs a new instance.
|
Modifier and Type | Method and Description |
---|---|
PropErrorItem |
clone()
Clones this instance.
|
boolean |
equals(Object o)
Checks if two items are equal.
|
String |
getID()
Gets the ID.
|
int |
getIndex()
Gets the index for a multi-property.
|
String |
getLocation()
Gets the location of an error, for user info only.
|
String |
getLocationOrName()
Gets the location or property name of an error, for user info only.
|
String |
getMessage()
Gets the message.
|
String[] |
getQuickFixes()
Gets the quick-fix ID's.
|
int |
getSeverity()
Gets the severity.
|
String |
getText(boolean includeID)
Gets a textual error description as "LEVEL[{\t}id]{\t}text" (where {\t} is the tab character).
|
void |
load(Element element)
Loads the error from XML.
|
protected String |
paramString()
The parameter string.
|
void |
save(Element element)
Called when the XML file for the error tree is serialized from properties.
|
void |
setIndex(int index)
Sets the index for a multi-property.
|
String |
toString()
Formats the error input to a string.
|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChildPropName, isChildPropError
public PropErrorItem()
public PropErrorItem(String id, String message, int level)
id
- The ID of the message, never null.message
- The error message string, never null.level
- The severity level: INFO, WARNING or ERROR.IllegalArgumentException
- If level is not INFO, WARNING or ERROR.NullPointerException
- If id or message is null.public PropErrorItem(String id, String message, int level, String... quickFixes)
id
- The ID of the message, never null.message
- The error message string, never null.level
- The severity level: INFO, WARNING or ERROR.quickFixes
- The quick-fix ID's.IllegalArgumentException
- If level is not INFO, WARNING or ERROR.NullPointerException
- If id or message is null.public PropErrorItem(String id, String message, String location, int level, String... quickFixes)
id
- The ID of the message, never null.message
- The error message string, never null.location
- The location, null for none.level
- The severity level: INFO, WARNING or ERROR.quickFixes
- The quick-fix ID's.IllegalArgumentException
- If level is not INFO, WARNING or ERROR.NullPointerException
- If id or message is null.public void load(Element element) throws Exception
load
in interface IPropErrorItem
element
- The errorItem
element.Exception
- For errors in XML.public void setIndex(int index)
setIndex
in interface IPropErrorItem
index
- 0 for main part, otherwise one-based index for errored property value.public String getID()
getID
in interface IPropErrorItem
public String getMessage()
getMessage
in interface IPropErrorItem
public int getIndex()
getIndex
in interface IPropErrorItem
public String getLocation()
getLocation
in interface IPropErrorItem
public String getLocationOrName()
getLocationOrName
in interface IPropErrorItem
public String[] getQuickFixes()
getQuickFixes
in interface IPropErrorItem
null
for none.public int getSeverity()
getSeverity
in interface IPropErrorItem
public boolean equals(Object o)
equals
in interface IPropErrorItem
equals
in class Object
public String toString()
protected String paramString()
public String getText(boolean includeID)
getText
in interface IPropErrorItem
includeID
- Flag to include ID or not.public void save(Element element)
save
in interface IPropErrorItem
element
- The Element
to initialize.public PropErrorItem clone()
clone
in interface IPropErrorItem
clone
in class Object
iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.