All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.resteasy.api.validation.ViolationReport Maven / Gradle / Ivy

The newest version!
package org.jboss.resteasy.api.validation;

import java.util.ArrayList;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

/**
*
* @author Ron Sigal
* @version $Revision: 1.1 $
*
* Copyright July 27, 2013
*/
@XmlRootElement(name="violationReport")
@XmlAccessorType(XmlAccessType.FIELD)
public class ViolationReport
{
   private String exception;
   
   private ArrayList fieldViolations = new ArrayList();
   private ArrayList propertyViolations = new ArrayList();
   private ArrayList classViolations = new ArrayList();
   private ArrayList parameterViolations = new ArrayList();
   private ArrayList returnValueViolations = new ArrayList();

   public ViolationReport(ResteasyViolationException exception)
   {
      Exception e = exception.getException();
      if (e != null)
      {
         this.exception = e.toString();
      }
      this.fieldViolations = (ArrayList) exception.getFieldViolations();
      this.propertyViolations = (ArrayList) exception.getPropertyViolations();
      this.classViolations = (ArrayList) exception.getClassViolations();
      this.parameterViolations = (ArrayList) exception.getParameterViolations();
      this.returnValueViolations = (ArrayList) exception.getReturnValueViolations();
   }
   
   public ViolationReport(String s)
   {
      this(new ResteasyViolationException(s));
   }
   
   public ViolationReport()
   {
   }

   public String getException()
   {
      return exception;
   }

   public ArrayList getFieldViolations()
   {
      return fieldViolations;
   }

   public ArrayList getPropertyViolations()
   {
      return propertyViolations;
   }

   public ArrayList getClassViolations()
   {
      return classViolations;
   }

   public ArrayList getParameterViolations()
   {
      return parameterViolations;
   }

   public ArrayList getReturnValueViolations()
   {
      return returnValueViolations;
   }

   public void setException(String exception)
   {
      this.exception = exception;
   }

   public void setFieldViolations(ArrayList fieldViolations)
   {
      this.fieldViolations = fieldViolations;
   }

   public void setPropertyViolations(ArrayList propertyViolations)
   {
      this.propertyViolations = propertyViolations;
   }

   public void setClassViolations(ArrayList classViolations)
   {
      this.classViolations = classViolations;
   }

   public void setParameterViolations(ArrayList parameterViolations)
   {
      this.parameterViolations = parameterViolations;
   }

   public void setReturnValueViolations(ArrayList returnValueViolations)
   {
      this.returnValueViolations = returnValueViolations;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy