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

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

public class ValidationTrace
extends Object

Linear collection of identifiers for individual Spring Beans starting with the base bean and ending with the most recent. Has the ability to located xml files related to the trace.

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

Field Summary
static int BUILD
           
static String NO_BEAN_ID
           
static int START_UP
           
 
Constructor Summary
ValidationTrace()
          Constructor for an empty token to start a trace
ValidationTrace(String[] files, org.springframework.core.io.ResourceLoader loader)
          Constructor for an empty token to start a trace
 
Method Summary
 void addBean(Component component)
          Adds a UIF Component to the trace
 void addBean(String beanType, String beanId)
          Adds a single entry into the trace
 void addBean(UifDictionaryBean configurable)
          Adds a UIF Configurable to the trace
 void createError(String validation, String[] values)
          Creates a new error report as an Error and adds it to the global list.
 void createWarning(String validation, String[] values)
          Creates a new error report as a Warning and adds it to the global list.
 ArrayList<String> findXmlFiles()
          Finds related xml files to an error by searching for files that contain beans that have been encountered in the validation.
 String getBeanId(int index)
          Retrieves a single entry in the BeanId trace list, a collection identifiers for the traced beans
 String getBeanLocation()
          Retrieves the complete trace path with each bean shown in the form beanId(BeanType)
 String getBeanType(int index)
          Retrieves a single entry in the BeanType trace list, a collection of types for the traced beansa collection identifiers for the traced beans
 ValidationTrace getCopy()
          Creates a copy of the ValidationTrace
 ArrayList<String> getRelatedXmls()
          Retrieves the list of xmls file paths found to be related to error
 int getTraceSize()
          Retrieves the number of beans in the trace list
 int getValidationStage()
          Retrieves the stage when the trace is taking place The stage is the time frame when the validation is taking place in the application
 void modifyBean(int index, String beanId, String beanType)
          Replaces a trace entry's information
 void removeBean(int index)
          Removes an entry from the trace
 void setValidationStage(int stage)
          Sets the stage of the validation where the trace is taking place
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_BEAN_ID

public static final String NO_BEAN_ID
See Also:
Constant Field Values

START_UP

public static final int START_UP
See Also:
Constant Field Values

BUILD

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

ValidationTrace

public ValidationTrace()
Constructor for an empty token to start a trace


ValidationTrace

public ValidationTrace(String[] files,
                       org.springframework.core.io.ResourceLoader loader)
Constructor for an empty token to start a trace

Method Detail

addBean

public void addBean(String beanType,
                    String beanId)
Adds a single entry into the trace

Parameters:
beanId - - An identifier for the bean
beanType - - The type of bean

addBean

public void addBean(Component component)
Adds a UIF Component to the trace

Parameters:
component - - The object to be added

addBean

public void addBean(UifDictionaryBean configurable)
Adds a UIF Configurable to the trace

Parameters:
configurable - - The object to be added

removeBean

public void removeBean(int index)
Removes an entry from the trace

Parameters:
index -

modifyBean

public void modifyBean(int index,
                       String beanId,
                       String beanType)
Replaces a trace entry's information

Parameters:
index - - The location of the bean
beanId - - An identifier for the bean
beanType - - The type of bean

getCopy

public ValidationTrace getCopy()
Creates a copy of the ValidationTrace

Returns:
A complete copy of the current token

findXmlFiles

public ArrayList<String> findXmlFiles()
Finds related xml files to an error by searching for files that contain beans that have been encountered in the validation. The file path and Document version of the xmls are paired and stored in a Map. This allows for returning the file paths easy when searching through the Documents.

Returns:
A list of file paths to the xmls in which the beans were found

setValidationStage

public void setValidationStage(int stage)
Sets the stage of the validation where the trace is taking place

Parameters:
stage - - The stage of the validation

createError

public void createError(String validation,
                        String[] values)
Creates a new error report as an Error and adds it to the global list.

Parameters:
validation - - The validation that fails.
values - - The values involved.

createWarning

public void createWarning(String validation,
                          String[] values)
Creates a new error report as a Warning and adds it to the global list.

Parameters:
validation - - The validation that fails.
values - - The values involved.

getBeanId

public String getBeanId(int index)
Retrieves a single entry in the BeanId trace list, a collection identifiers for the traced beans

Parameters:
index - - The location of the bean
Returns:
String Identifier for the bean at the provided index of the trace

getBeanType

public String getBeanType(int index)
Retrieves a single entry in the BeanType trace list, a collection of types for the traced beansa collection identifiers for the traced beans

Parameters:
index - - The location of the bean type
Returns:
String Type for the bean at the provided index of the trace

getValidationStage

public int getValidationStage()
Retrieves the stage when the trace is taking place The stage is the time frame when the validation is taking place in the application

Returns:
Returns the stage of the validation.

getTraceSize

public int getTraceSize()
Retrieves the number of beans in the trace list

Returns:
Number of beans stored in the trace

getBeanLocation

public String getBeanLocation()
Retrieves the complete trace path with each bean shown in the form beanId(BeanType)

Returns:
The String path of the trace

getRelatedXmls

public ArrayList<String> getRelatedXmls()
Retrieves the list of xmls file paths found to be related to error

Returns:
A list of file paths to the related xmls


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