Class ValidationTrace

java.lang.Object
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

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final String
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    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

    Modifier and Type
    Method
    Description
    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
    addBean(Component component)
    Adds a UIF Component 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.
    Finds related xml files to an error by searching for files that contain beans that have been encountered in the validation.
    getBeanId(int index)
    Retrieves a single entry in the BeanId trace list, a collection identifiers for the traced beans
    Retrieves the complete trace path with each bean shown in the form beanId(BeanType)
    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
    Creates a copy of the ValidationTrace
    Retrieves the list of xmls file paths found to be related to error
    int
    Retrieves the number of beans in the trace list
    int
    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 Details

  • Constructor Details

    • 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
      Parameters:
      files - files to load
      loader - resource loader
  • Method Details

    • addBean

      public void addBean(String beanType, String beanId)
      Adds a single entry into the trace
      Parameters:
      beanType - - The type of bean
      beanId - - An identifier for the 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