View Javadoc
1   package fr.paris.lutece.plugins.documentimport.util;
2   
3   /**
4    * 
5    * DocumentimportException
6    *
7    */
8   public class DocumentimportException extends Exception{
9   	
10  		private static final long serialVersionUID = 6610609149888544149L;
11  	    private String _strTitleField;
12  	    private String _strErrorMessage;
13  	    private boolean _bMandatoryError;
14  
15  	    /**
16  	     * Creates a new DocumentimportException
17  	     * @param strTitleField The title of the filed that caused the error
18  	     * @param strErrorMessage The error message
19  	     */
20  	    public DocumentimportException( String strTitleField, String strErrorMessage )
21  	    {
22  	        _strTitleField = strTitleField;
23  	        _strErrorMessage = strErrorMessage;
24  	        _bMandatoryError = false;
25  	    }
26  
27  	    /**
28  	     * Creates a new DocumentimportException
29  	     * @param strTitleField The title of the filed that caused the error
30  	     */
31  	    public DocumentimportException( String strTitleField )
32  	    {
33  	        _strTitleField = strTitleField;
34  	        _bMandatoryError = true;
35  	    }
36  
37  	    /**
38  	     * return true if the error is a mandatory error
39  	     * @return true if the error is a mandatory error
40  	     */
41  	    public boolean isMandatoryError(  )
42  	    {
43  	        return _bMandatoryError;
44  	    }
45  
46  	    /**
47  	     * set true if the error is a mandatory error
48  	     * @param mandatoryError true if the error is a mandatory error
49  	     */
50  	    public void setMandatoryError( boolean mandatoryError )
51  	    {
52  	        _bMandatoryError = mandatoryError;
53  	    }
54  
55  	    /**
56  	     * Gets the error Message
57  	     * @return the error Message
58  	     */
59  	    public String getErrorMessage(  )
60  	    {
61  	        return _strErrorMessage;
62  	    }
63  
64  	    /**
65  	     * set the error message
66  	     * @param errorMessage the erroer message
67  	     */
68  	    public void setErrorMessage( String errorMessage )
69  	    {
70  	        _strErrorMessage = errorMessage;
71  	    }
72  
73  	    /**
74  	     *
75  	     * @return the title of the field
76  	     */
77  	    public String getTitleField(  )
78  	    {
79  	        return _strTitleField;
80  	    }
81  
82  	    /**
83  	     * set the title of the field
84  	     * @param titleField the title of the field
85  	     */
86  	    public void setTitleField( String titleField )
87  	    {
88  	        _strTitleField = titleField;
89  	    }
90  
91  }