org.kuali.rice.krad.datadictionary.validator
Class ErrorReport

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.validator.ErrorReport

public class ErrorReport
extends Object

Collection of information regarding a single error detected within a dictionary bean

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
static int ERROR
           
static int WARNING
           
 
Constructor Summary
ErrorReport(int ErrorStatus)
          Constructor creating a new report for an error
ErrorReport(int errorStatus, String validationFailed, String beanLocation)
          Constructor creating a new report for an error with set values
ErrorReport(int errorStatus, String validationFailed, String beanLocation, String[] values)
          Constructor creating a new report for an error with set values
ErrorReport(int errorStatus, String validationFailed, ValidationTrace trace)
          Constructor creating a new report for an error with set values
ErrorReport(int errorStatus, String validationFailed, ValidationTrace trace, String[] values)
          Constructor creating a new report for an error with set values
 
Method Summary
 void addCurrentValue(String value)
          Adds a value involved in the error
 void addXmlPage(String page)
          Adds a xml page involved in the error
 void addXmlPages(ArrayList<String> pages)
          Add a list of xml page involved in the error
static ErrorReport createError(String validationFailed, ValidationTrace trace)
          Creates a new ErrorReport of ERROR status
static ErrorReport createWarning(String validationFailed, ValidationTrace trace)
          Creates a new ErrorReport of WARNING status
 String errorMessage()
          Creates a message for the error being reported
 String errorPageList()
          Creates a message for the xml pages involved
 String getBeanLocation()
          Retrieves the location of the bean in the trace
 String getCurrentValue(int index)
          Retrieves a value involved in the error
 int getCurrentValueSize()
          Retrieves the number of values involved in the error.
 int getErrorStatus()
          Retrieves the type of error
 String getValidationFailed()
          Retrieves the validation that was failed
 String getXmlPage(int index)
          Retrieves a xml page file location involved in the error
 int getXmlPageSize()
          Retireves the number of xml pages involved in the error
 void modifyCurrentValue(int index, String value)
          Replaces a value in the list of those involved
 void modifyXmlPage(int index, String page)
          Replaces a xml page in the list of those involved
 void removeCurrentValue(int index)
          Removes a value from the list of those involved
 void removeXmlPage(int index)
          Removes a xml page from the list of those involved
 void setBeanLocation(String location)
          Sets the location of the bean in the trace
 void setValidationFailed(String validation)
          Sets the validation that was failed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR

public static final int ERROR
See Also:
Constant Field Values

WARNING

public static final int WARNING
See Also:
Constant Field Values
Constructor Detail

ErrorReport

public ErrorReport(int ErrorStatus)
Constructor creating a new report for an error

Parameters:
ErrorStatus - - The type of error being reported

ErrorReport

public ErrorReport(int errorStatus,
                   String validationFailed,
                   String beanLocation,
                   String[] values)
Constructor creating a new report for an error with set values

Parameters:
errorStatus - - The type of error being reported
validationFailed - - The validation that was failed
beanLocation - - The location of the bean in which error occured
values - - An array of the values effected

ErrorReport

public ErrorReport(int errorStatus,
                   String validationFailed,
                   ValidationTrace trace)
Constructor creating a new report for an error with set values

Parameters:
errorStatus - - The type of error being reported
validationFailed - - The validation that was failed
trace - - ValidationTrace containing information on xml files and location

ErrorReport

public ErrorReport(int errorStatus,
                   String validationFailed,
                   ValidationTrace trace,
                   String[] values)
Constructor creating a new report for an error with set values

Parameters:
errorStatus - - The type of error being reported
validationFailed - - The validation that was failed
trace - - ValidationTrace containing information on xml files and location
values - - An array of the values effected

ErrorReport

public ErrorReport(int errorStatus,
                   String validationFailed,
                   String beanLocation)
Constructor creating a new report for an error with set values

Parameters:
errorStatus - - The type of error being reported
validationFailed - - The validation that was failed
beanLocation - - The location of the bean in which error occured
Method Detail

createError

public static ErrorReport createError(String validationFailed,
                                      ValidationTrace trace)
Creates a new ErrorReport of ERROR status

Parameters:
validationFailed - - The validation that was failed
trace - - ValidationTrace containing information on xml files and location
Returns:
Returns a new ErrorReport of ERROR status

createWarning

public static ErrorReport createWarning(String validationFailed,
                                        ValidationTrace trace)
Creates a new ErrorReport of WARNING status

Parameters:
validationFailed - - The validation that was failed
trace - - ValidationTrace containing information on xml files and location
Returns:
Returns a new ErrorReport of WARNING status

addCurrentValue

public void addCurrentValue(String value)
Adds a value involved in the error

Parameters:
value - - Value involved ("Name of Value = Its Value")

addXmlPage

public void addXmlPage(String page)
Adds a xml page involved in the error

Parameters:
page - - The file path of the xml page involved

addXmlPages

public void addXmlPages(ArrayList<String> pages)
Add a list of xml page involved in the error

Parameters:
pages - - The file path of the xml page involved

removeCurrentValue

public void removeCurrentValue(int index)
Removes a value from the list of those involved

Parameters:
index - - The index of the value

removeXmlPage

public void removeXmlPage(int index)
Removes a xml page from the list of those involved

Parameters:
index - - The index of the xml page

modifyCurrentValue

public void modifyCurrentValue(int index,
                               String value)
Replaces a value in the list of those involved

Parameters:
index - - The index of the value
value - - The value to replace the value with

modifyXmlPage

public void modifyXmlPage(int index,
                          String page)
Replaces a xml page in the list of those involved

Parameters:
index - - The index of the page
page - - The page to replace the xml page with

errorMessage

public String errorMessage()
Creates a message for the error being reported

Returns:
A compiled message about the error in the report

errorPageList

public String errorPageList()
Creates a message for the xml pages involved

Returns:
A compiled list of the xml pages involved

setValidationFailed

public void setValidationFailed(String validation)
Sets the validation that was failed

Parameters:
validation - - The validation that failed

setBeanLocation

public void setBeanLocation(String location)
Sets the location of the bean in the trace

Parameters:
location - - The Bean location

getErrorStatus

public int getErrorStatus()
Retrieves the type of error

Returns:
Integer value of the type of error

getValidationFailed

public String getValidationFailed()
Retrieves the validation that was failed

Returns:
The failed validation

getBeanLocation

public String getBeanLocation()
Retrieves the location of the bean in the trace

Returns:
The location of the bean

getCurrentValue

public String getCurrentValue(int index)
Retrieves a value involved in the error

Parameters:
index - - The index of the value
Returns:
The value involved at the provided index

getXmlPage

public String getXmlPage(int index)
Retrieves a xml page file location involved in the error

Parameters:
index - - The index of the page
Returns:
The xml file involved at the provided index

getCurrentValueSize

public int getCurrentValueSize()
Retrieves the number of values involved in the error.

Returns:
The number of values involved

getXmlPageSize

public int getXmlPageSize()
Retireves the number of xml pages involved in the error

Returns:
The number of xml pages involved


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.