Package com.iizix.prop
Class PropErrorItemValue
- java.lang.Object
- com.iizix.prop.PropErrorItem
- com.iizix.prop.PropErrorItemValue
- All Implemented Interfaces:
IPropErrorItem
,java.lang.Cloneable
public class PropErrorItemValue extends PropErrorItem
Class holding information about an error for the Property Editor in the Designer. Several errors can be set for a single property, e.g. when there are of multi-style.- Author:
- Christopher Mindus
Field Summary
Fields inherited from interface com.iizix.prop.IPropErrorItem
CHILD_PROP_ERROR_PREFIX, ERROR, INFO, VERIFY_ERROR_CHILD_PREFIX, WARNING
Constructor Summary
Constructors Constructor Description PropErrorItemValue()
Constructs a new instance from an XML element.PropErrorItemValue(java.lang.String input, java.lang.String message)
Constructs a new instance without ID (empty string).PropErrorItemValue(java.lang.String id, java.lang.String input, java.lang.String message)
Constructs a new instance.PropErrorItemValue(java.lang.String id, java.lang.String input, java.lang.String message, int level)
Constructs a new instance.PropErrorItemValue(java.lang.String id, java.lang.String input, java.lang.String message, int level, java.lang.String... quickFixes)
Constructs a new instance.PropErrorItemValue(java.lang.String id, java.lang.String input, java.lang.String message, java.lang.String location, int level, java.lang.String... quickFixes)
Constructs a new instance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Checks if two items are equal.java.lang.String
getInput()
Gets the user input.void
load(org.w3c.dom.Element element)
Loads the error from XML.protected java.lang.String
paramString()
Formats the error input to a string.void
save(org.w3c.dom.Element element)
Called when the XML file for the error tree is serialized from properties.Methods inherited from class com.iizix.prop.PropErrorItem
clone, getID, getIndex, getLocation, getLocationOrName, getMessage, getQuickFixes, getSeverity, getText, setIndex, toString
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.iizix.prop.IPropErrorItem
getChildPropName, isChildPropError
Constructor Detail
PropErrorItemValue
public PropErrorItemValue()
Constructs a new instance from an XML element.
PropErrorItemValue
public PropErrorItemValue(java.lang.String input, java.lang.String message)
Constructs a new instance without ID (empty string).- Parameters:
input
- The user input string, never null.message
- The error message string, never null.- Throws:
java.lang.NullPointerException
- If input or message is null.
PropErrorItemValue
public PropErrorItemValue(java.lang.String id, java.lang.String input, java.lang.String message)
Constructs a new instance.- Parameters:
id
- The ID of the message, never null.input
- The user input string, never null.message
- The error message string, never null.- Throws:
java.lang.NullPointerException
- If id, input or message is null.
PropErrorItemValue
public PropErrorItemValue(java.lang.String id, java.lang.String input, java.lang.String message, int level)
Constructs a new instance.- Parameters:
id
- The ID of the message, never null.input
- The user input string, never null.message
- The error message string, never null.level
- The severity level: INFO, WARNING or ERROR.- Throws:
java.lang.IllegalArgumentException
- If level is not INFO, WARNING or ERROR.java.lang.NullPointerException
- If id, input or message is null.
PropErrorItemValue
public PropErrorItemValue(java.lang.String id, java.lang.String input, java.lang.String message, int level, java.lang.String... quickFixes)
Constructs a new instance.- Parameters:
id
- The ID of the message, never null.input
- The user input string, never null.message
- The error message string, never null.level
- The severity level: INFO, WARNING or ERROR.quickFixes
- The quick-fix ID's.- Throws:
java.lang.IllegalArgumentException
- If level is not INFO, WARNING or ERROR.java.lang.NullPointerException
- If id, input or message is null.
PropErrorItemValue
public PropErrorItemValue(java.lang.String id, java.lang.String input, java.lang.String message, java.lang.String location, int level, java.lang.String... quickFixes)
Constructs a new instance.- Parameters:
id
- The ID of the message, never null.input
- The user input string, 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.- Throws:
java.lang.IllegalArgumentException
- If level is not INFO, WARNING or ERROR.java.lang.NullPointerException
- If id, input or message is null.
Method Detail
load
public void load(org.w3c.dom.Element element) throws java.lang.Exception
Loads the error from XML.- Specified by:
load
in interfaceIPropErrorItem
- Overrides:
load
in classPropErrorItem
- Parameters:
element
- TheerrorItem
element.- Throws:
java.lang.Exception
- For errors in XML.
getInput
public java.lang.String getInput()
Gets the user input.
equals
public boolean equals(java.lang.Object o)
Checks if two items are equal.- Specified by:
equals
in interfaceIPropErrorItem
- Overrides:
equals
in classPropErrorItem
paramString
protected java.lang.String paramString()
Formats the error input to a string.- Overrides:
paramString
in classPropErrorItem
save
public void save(org.w3c.dom.Element element)
Called when the XML file for the error tree is serialized from properties.- Specified by:
save
in interfaceIPropErrorItem
- Overrides:
save
in classPropErrorItem
- Parameters:
element
- TheElement
to initialize.