Package com.iizix.prop
Class PropErrorItem
- java.lang.Object
- com.iizix.prop.PropErrorItem
 
- All Implemented Interfaces:
- IPropErrorItem,- java.lang.Cloneable
 - Direct Known Subclasses:
- PropErrorItemValue
 - public class PropErrorItem extends java.lang.Object implements IPropErrorItem 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 - PropErrorItem()Constructs a new instance from an XML element.- PropErrorItem(java.lang.String id, java.lang.String message, int level)Constructs a new instance.- PropErrorItem(java.lang.String id, java.lang.String message, int level, java.lang.String... quickFixes)Constructs a new instance.- PropErrorItem(java.lang.String id, 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 - PropErrorItem- clone()Clones this instance.- boolean- equals(java.lang.Object o)Checks if two items are equal.- java.lang.String- getID()Gets the ID.- int- getIndex()Gets the index for a multi-property.- java.lang.String- getLocation()Gets the location of an error, for user info only.- java.lang.String- getLocationOrName()Gets the location or property name of an error, for user info only.- java.lang.String- getMessage()Gets the message.- java.lang.String[]- getQuickFixes()Gets the quick-fix ID's.- int- getSeverity()Gets the severity.- java.lang.String- getText(boolean includeID)Gets a textual error description as "LEVEL[{\t}id]{\t}text" (where {\t} is the tab character).- void- load(org.w3c.dom.Element element)Loads the error from XML.- protected java.lang.String- paramString()The parameter string.- void- save(org.w3c.dom.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.- java.lang.String- toString()Formats the error input to a string.- 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- PropErrorItem- public PropErrorItem() Constructs a new instance from an XML element.
 - PropErrorItem- public PropErrorItem(java.lang.String id, java.lang.String message, int level)Constructs a new instance.- Parameters:
- id- The ID of the message, 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 or message is null.
 
 - PropErrorItem- public PropErrorItem(java.lang.String id, java.lang.String message, int level, java.lang.String... quickFixes)Constructs a new instance.- Parameters:
- 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.
- Throws:
- java.lang.IllegalArgumentException- If level is not INFO, WARNING or ERROR.
- java.lang.NullPointerException- If id or message is null.
 
 - PropErrorItem- public PropErrorItem(java.lang.String id, 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.
- 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 or message is null.
 
 
 - Method Detail- load- public void load(org.w3c.dom.Element element) throws java.lang.ExceptionLoads the error from XML.- Specified by:
- loadin interface- IPropErrorItem
- Parameters:
- element- The- errorItemelement.
- Throws:
- java.lang.Exception- For errors in XML.
 
 - setIndex- public void setIndex(int index) Sets the index for a multi-property.- Specified by:
- setIndexin interface- IPropErrorItem
- Parameters:
- index- 0 for main part, otherwise one-based index for errored property value.
 
 - getID- public java.lang.String getID() Gets the ID.- Specified by:
- getIDin interface- IPropErrorItem
 
 - getMessage- public java.lang.String getMessage() Gets the message.- Specified by:
- getMessagein interface- IPropErrorItem
- Returns:
- The error message.
 
 - getIndex- public int getIndex() Gets the index for a multi-property.- Specified by:
- getIndexin interface- IPropErrorItem
- Returns:
- -1 for none, 0 for main part, otherwise one-based index for errored property value.
 
 - getLocation- public java.lang.String getLocation() Gets the location of an error, for user info only.- Specified by:
- getLocationin interface- IPropErrorItem
- Returns:
- The location, or null for none.
 
 - getLocationOrName- public java.lang.String getLocationOrName() Gets the location or property name of an error, for user info only.- Specified by:
- getLocationOrNamein interface- IPropErrorItem
- Returns:
- The location, or the property name if none is defined, never null.
 
 - getQuickFixes- public java.lang.String[] getQuickFixes() Gets the quick-fix ID's.- Specified by:
- getQuickFixesin interface- IPropErrorItem
- Returns:
- The list of quick-fix ID's or nullfor none.
 
 - getSeverity- public int getSeverity() Gets the severity.- Specified by:
- getSeverityin interface- IPropErrorItem
- Returns:
- INFO, WARNING or ERROR.
 
 - equals- public boolean equals(java.lang.Object o) Checks if two items are equal.- Specified by:
- equalsin interface- IPropErrorItem
- Overrides:
- equalsin class- java.lang.Object
 
 - toString- public java.lang.String toString() Formats the error input to a string.- Overrides:
- toStringin class- java.lang.Object
 
 - paramString- protected java.lang.String paramString() The parameter string.
 - getText- public java.lang.String getText(boolean includeID) Gets a textual error description as "LEVEL[{\t}id]{\t}text" (where {\t} is the tab character).- Specified by:
- getTextin interface- IPropErrorItem
- Parameters:
- includeID- Flag to include ID or not.
 
 - save- public void save(org.w3c.dom.Element element) Called when the XML file for the error tree is serialized from properties.- Specified by:
- savein interface- IPropErrorItem
- Parameters:
- element- The- Elementto initialize.
 
 - clone- public PropErrorItem clone() Clones this instance.- Specified by:
- clonein interface- IPropErrorItem
- Overrides:
- clonein class- java.lang.Object
- Returns:
- A clone.