import java.sql.ResultSet;
import java.sql.SQLException;
-
import java.sql.Timestamp;
+
import org.apache.log4j.Logger;
public class ImportVOFull extends ImportVOPK implements java.io.Serializable {
- private static final Logger logger = Logger.getLogger(ImportVOFull.class);
-
- /**
- * MAPS UTI_LOGIN column.
- */
- protected java.lang.String utiLogin;
- protected boolean isUtiLoginSet = false;
- protected boolean isUtiLoginModified = false;
- /**
- * MAPS FILE_NAME column.
- */
- protected java.lang.String fileName;
- protected boolean isFileNameSet = false;
- protected boolean isFileNameModified = false;
- /**
- * MAPS FILE_TYPE column.
- */
- protected java.lang.String fileType;
- protected boolean isFileTypeSet = false;
- protected boolean isFileTypeModified = false;
- /**
- * MAPS SUBMIT_DATE column.
- */
- protected java.sql.Timestamp submitDate;
- protected boolean isSubmitDateSet = false;
- protected boolean isSubmitDateModified = false;
- /**
- * MAPS END_DATE column.
- */
- protected java.sql.Timestamp endDate;
- protected boolean isEndDateSet = false;
- protected boolean isEndDateModified = false;
- /**
- * MAPS STATUS column.
- */
- protected java.lang.Integer status;
- protected boolean isStatusSet = false;
- protected boolean isStatusModified = false;
- /**
- * MAPS COLLECTIVITE column.
- */
- protected java.lang.String collectivite;
- protected boolean isCollectiviteSet = false;
- protected boolean isCollectiviteModified = false;
- /**
- * MAPS BUDGET column.
- */
- protected java.lang.String budget;
- protected boolean isBudgetSet = false;
- protected boolean isBudgetModified = false;
- /**
- * MAPS COLLECTIVITE_LIB column.
- */
- protected java.lang.String collectiviteLib;
- protected boolean isCollectiviteLibSet = false;
- protected boolean isCollectiviteLibModified = false;
- /**
- * MAPS BUDGET_LIB column.
- */
- protected java.lang.String budgetLib;
- protected boolean isBudgetLibSet = false;
- protected boolean isBudgetLibModified = false;
- /**
- * MAPS ERROR_MESSAGE column.
- */
- protected java.lang.String errorMessage;
- protected boolean isErrorMessageSet = false;
- protected boolean isErrorMessageModified = false;
-
- /**
- * Default Constructor
- */
- public ImportVOFull() {
- super();
- }
-
- /**
- * Constructs a new Full object, initializing only PK fileds.
- */
- public ImportVOFull(java.lang.String importId) {
- super(importId);
- }
-
- public ImportVOFull(ResultSet rs) throws SQLException {
- this();
- int i = 1;
- setInnerUtiLogin(rs.getString(i++));
- setInnerImportId(rs.getString(i++));
- setInnerFileName(rs.getString(i++));
- setInnerFileType(rs.getString(i++));
- try {
- setInnerSubmitDate(rs.getTimestamp(i++));
- } catch(SQLException sqlEx) {
- // mysql jdbc driver throws a SQLException when value is null
- }
- try {
- setInnerEndDate(rs.getTimestamp(i++));
- } catch(SQLException sqlEx) {
- // mysql jdbc driver throws a SQLException when value is null
- }
- int statusTmp = rs.getInt(i++);
- if (!rs.wasNull()) {
- setInnerStatus(new java.lang.Integer(statusTmp));
- }
- setInnerCollectivite(rs.getString(i++));
- setInnerBudget(rs.getString(i++));
- setInnerCollectiviteLib(rs.getString(i++));
- setInnerBudgetLib(rs.getString(i++));
- setInnerErrorMessage(rs.getString(i++));
- }
-
- public java.lang.String getUtiLogin() {
- return utiLogin;
- }
-
- public void setUtiLogin(java.lang.String utiLogin) {
- this.utiLogin = utiLogin;
- this.isUtiLoginModified = true;
- }
-
- protected void setInnerUtiLogin(java.lang.String utiLogin) {
- this.utiLogin = utiLogin;
- this.isUtiLoginSet = true;
- }
-
- public java.lang.String getStrUtiLogin(java.lang.String returnInCaseOfNull) {
- return utiLogin != null ? utiLogin.toString() : returnInCaseOfNull;
- }
-
- public java.lang.String getFileName() {
- return fileName;
- }
-
- public void setFileName(java.lang.String fileName) {
- this.fileName = fileName;
- this.isFileNameModified = true;
- }
-
- protected void setInnerFileName(java.lang.String fileName) {
- this.fileName = fileName;
- this.isFileNameSet = true;
- }
-
- public java.lang.String getStrFileName(java.lang.String returnInCaseOfNull) {
- return fileName != null ? fileName.toString() : returnInCaseOfNull;
- }
-
- public java.lang.String getFileType() {
- return fileType;
- }
-
- public void setFileType(java.lang.String fileType) {
- this.fileType = fileType;
- this.isFileTypeModified = true;
- }
-
- protected void setInnerFileType(java.lang.String fileType) {
- this.fileType = fileType;
- this.isFileTypeSet = true;
- }
-
- public java.lang.String getStrFileType(java.lang.String returnInCaseOfNull) {
- return fileType != null ? fileType.toString() : returnInCaseOfNull;
- }
-
- public java.sql.Timestamp getSubmitDate() {
- return submitDate;
- }
-
- public void setSubmitDate(java.sql.Timestamp submitDate) {
- this.submitDate = submitDate;
- this.isSubmitDateModified = true;
- }
-
- protected void setInnerSubmitDate(java.sql.Timestamp submitDate) {
- this.submitDate = submitDate;
- this.isSubmitDateSet = true;
- }
-
- public java.lang.String getStrSubmitDate(java.lang.String returnInCaseOfNull) {
- return submitDate != null ? submitDate.toString() : returnInCaseOfNull;
- }
-
- public java.sql.Timestamp getEndDate() {
- return endDate;
- }
-
- public void setEndDate(java.sql.Timestamp endDate) {
- this.endDate = endDate;
- this.isEndDateModified = true;
- }
-
- protected void setInnerEndDate(java.sql.Timestamp endDate) {
- this.endDate = endDate;
- this.isEndDateSet = true;
- }
-
- public java.lang.String getStrEndDate(java.lang.String returnInCaseOfNull) {
- return endDate != null ? endDate.toString() : returnInCaseOfNull;
- }
-
- public java.lang.Integer getStatus() {
- return status;
- }
-
- public void setStatus(java.lang.Integer status) {
- this.status = status;
- this.isStatusModified = true;
- if(status==5 || status==4)
- setEndDate(new Timestamp(System.currentTimeMillis()));
-
- }
-
- protected void setInnerStatus(java.lang.Integer status) {
- this.status = status;
- this.isStatusSet = true;
- }
-
- public java.lang.String getStrStatus(java.lang.String returnInCaseOfNull) {
- return status != null ? status.toString() : returnInCaseOfNull;
- }
-
- public java.lang.String getCollectivite() {
- return collectivite;
- }
-
- public void setCollectivite(java.lang.String collectivite) {
- this.collectivite = collectivite;
- this.isCollectiviteModified = true;
- }
-
- protected void setInnerCollectivite(java.lang.String collectivite) {
- this.collectivite = collectivite;
- this.isCollectiviteSet = true;
- }
-
- public java.lang.String getStrCollectivite(java.lang.String returnInCaseOfNull) {
- return collectivite != null ? collectivite.toString() : returnInCaseOfNull;
- }
-
- public java.lang.String getBudget() {
- return budget;
- }
-
- public void setBudget(java.lang.String budget) {
- this.budget = budget;
- this.isBudgetModified = true;
- }
-
- protected void setInnerBudget(java.lang.String budget) {
- this.budget = budget;
- this.isBudgetSet = true;
- }
-
- public java.lang.String getStrBudget(java.lang.String returnInCaseOfNull) {
- return budget != null ? budget.toString() : returnInCaseOfNull;
- }
-
- public java.lang.String getCollectiviteLib() {
- return collectiviteLib;
- }
-
- public void setCollectiviteLib(java.lang.String collectiviteLib) {
- this.collectiviteLib = collectiviteLib;
- this.isCollectiviteLibModified = true;
- }
-
- protected void setInnerCollectiviteLib(java.lang.String collectiviteLib) {
- this.collectiviteLib = collectiviteLib;
- this.isCollectiviteLibSet = true;
- }
-
- public java.lang.String getStrCollectiviteLib(java.lang.String returnInCaseOfNull) {
- return collectiviteLib != null ? collectiviteLib.toString() : returnInCaseOfNull;
- }
-
- public java.lang.String getBudgetLib() {
- return budgetLib;
- }
-
- public void setBudgetLib(java.lang.String budgetLib) {
- this.budgetLib = budgetLib;
- this.isBudgetLibModified = true;
- }
-
- protected void setInnerBudgetLib(java.lang.String budgetLib) {
- this.budgetLib = budgetLib;
- this.isBudgetLibSet = true;
- }
-
- public java.lang.String getStrBudgetLib(java.lang.String returnInCaseOfNull) {
- return budgetLib != null ? budgetLib.toString() : returnInCaseOfNull;
- }
-
- public java.lang.String getErrorMessage() {
- return errorMessage;
- }
-
- public void setErrorMessage(java.lang.String errorMessage) {
- this.errorMessage = errorMessage;
- this.isErrorMessageModified = true;
- }
-
- protected void setInnerErrorMessage(java.lang.String errorMessage) {
- this.errorMessage = errorMessage;
- this.isErrorMessageSet = true;
- }
-
- public java.lang.String getStrErrorMessage(java.lang.String returnInCaseOfNull) {
- return errorMessage != null ? errorMessage.toString() : returnInCaseOfNull;
- }
-
- public void validate() throws IllegalStateException {
- if (utiLogin == null) {
- throw new IllegalStateException("UTI_LOGIN " + VoConstants.NOT_NULL_MSG);
- }
- if (utiLogin != null && utiLogin.length() > UTI_LOGIN_LEN) {
- throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "UTI_LOGIN" + VoConstants.TOO_LONG_MSG_SUFX);
- }
- if (importId == null) {
- throw new IllegalStateException("IMPORT_ID " + VoConstants.NOT_NULL_MSG);
- }
- if (importId != null && importId.length() > IMPORT_ID_LEN) {
- throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "IMPORT_ID" + VoConstants.TOO_LONG_MSG_SUFX);
- }
- if (fileName == null) {
- throw new IllegalStateException("FILE_NAME " + VoConstants.NOT_NULL_MSG);
- }
- if (fileName != null && fileName.length() > FILE_NAME_LEN) {
- throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "FILE_NAME" + VoConstants.TOO_LONG_MSG_SUFX);
- }
- if (fileType == null) {
- throw new IllegalStateException("FILE_TYPE " + VoConstants.NOT_NULL_MSG);
- }
- if (fileType != null && fileType.length() > FILE_TYPE_LEN) {
- throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "FILE_TYPE" + VoConstants.TOO_LONG_MSG_SUFX);
- }
- if (status == null) {
- throw new IllegalStateException("STATUS " + VoConstants.NOT_NULL_MSG);
- }
- if (collectivite != null && collectivite.length() > COLLECTIVITE_LEN) {
- throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "COLLECTIVITE" + VoConstants.TOO_LONG_MSG_SUFX);
- }
- if (budget != null && budget.length() > BUDGET_LEN) {
- throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "BUDGET" + VoConstants.TOO_LONG_MSG_SUFX);
- }
- if (collectiviteLib != null && collectiviteLib.length() > COLLECTIVITE_LIB_LEN) {
- throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "COLLECTIVITE_LIB" + VoConstants.TOO_LONG_MSG_SUFX);
- }
- if (budgetLib != null && budgetLib.length() > BUDGET_LIB_LEN) {
- throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "BUDGET_LIB" + VoConstants.TOO_LONG_MSG_SUFX);
- }
- if (errorMessage != null && errorMessage.length() > ERROR_MESSAGE_LEN) {
- throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "ERROR_MESSAGE" + VoConstants.TOO_LONG_MSG_SUFX);
- }
- }
- public void determinateStatus() {
- if(status==5) return;
- boolean correct = true;
- if(collectivite==null || collectivite.length()==0) correct = false;
- if(collectiviteLib==null || collectiviteLib.length()==0) correct = false;
- if(budget==null || budget.length()==0) correct=false;
- if(budgetLib==null || budgetLib.length()==0) correct=false;
- if(fileType==null || fileType.length()==0) correct=false;
- if(correct) setStatus(6);
- else setStatus(2);
- }
+ private static final Logger logger = Logger.getLogger(ImportVOFull.class);
+
+ /**
+ * MAPS UTI_LOGIN column.
+ */
+ protected java.lang.String utiLogin;
+ protected boolean isUtiLoginSet = false;
+ protected boolean isUtiLoginModified = false;
+ /**
+ * MAPS FILE_NAME column.
+ */
+ protected java.lang.String fileName;
+ protected boolean isFileNameSet = false;
+ protected boolean isFileNameModified = false;
+ /**
+ * MAPS FILE_TYPE column.
+ */
+ protected java.lang.String fileType;
+ protected boolean isFileTypeSet = false;
+ protected boolean isFileTypeModified = false;
+ /**
+ * MAPS SUBMIT_DATE column.
+ */
+ protected java.sql.Timestamp submitDate;
+ protected boolean isSubmitDateSet = false;
+ protected boolean isSubmitDateModified = false;
+ /**
+ * MAPS END_DATE column.
+ */
+ protected java.sql.Timestamp endDate;
+ protected boolean isEndDateSet = false;
+ protected boolean isEndDateModified = false;
+ /**
+ * MAPS STATUS column.
+ */
+ protected java.lang.Integer status;
+ protected boolean isStatusSet = false;
+ protected boolean isStatusModified = false;
+ /**
+ * MAPS COLLECTIVITE column.
+ */
+ protected java.lang.String collectivite;
+ protected boolean isCollectiviteSet = false;
+ protected boolean isCollectiviteModified = false;
+ /**
+ * MAPS BUDGET column.
+ */
+ protected java.lang.String budget;
+ protected boolean isBudgetSet = false;
+ protected boolean isBudgetModified = false;
+ /**
+ * MAPS COLLECTIVITE_LIB column.
+ */
+ protected java.lang.String collectiviteLib;
+ protected boolean isCollectiviteLibSet = false;
+ protected boolean isCollectiviteLibModified = false;
+ /**
+ * MAPS BUDGET_LIB column.
+ */
+ protected java.lang.String budgetLib;
+ protected boolean isBudgetLibSet = false;
+ protected boolean isBudgetLibModified = false;
+ /**
+ * MAPS ERROR_MESSAGE column.
+ */
+ protected java.lang.String errorMessage;
+ protected boolean isErrorMessageSet = false;
+ protected boolean isErrorMessageModified = false;
+
+ /**
+ * Default Constructor
+ */
+ public ImportVOFull() {
+ super();
+ }
+
+ /**
+ * Constructs a new Full object, initializing only PK fileds.
+ */
+ public ImportVOFull(final java.lang.String importId) {
+ super(importId);
+ }
+
+ public ImportVOFull(final ResultSet rs) throws SQLException {
+ this();
+ int i = 1;
+ this.setInnerUtiLogin(rs.getString(i++));
+ this.setInnerImportId(rs.getString(i++));
+ this.setInnerFileName(rs.getString(i++));
+ this.setInnerFileType(rs.getString(i++));
+ try {
+ this.setInnerSubmitDate(rs.getTimestamp(i++));
+ } catch (final SQLException sqlEx) {
+ // mysql jdbc driver throws a SQLException when value is null
+ }
+ try {
+ this.setInnerEndDate(rs.getTimestamp(i++));
+ } catch (final SQLException sqlEx) {
+ // mysql jdbc driver throws a SQLException when value is null
+ }
+ final int statusTmp = rs.getInt(i++);
+ if (!rs.wasNull()) {
+ this.setInnerStatus(new java.lang.Integer(statusTmp));
+ }
+ this.setInnerCollectivite(rs.getString(i++));
+ this.setInnerBudget(rs.getString(i++));
+ this.setInnerCollectiviteLib(rs.getString(i++));
+ this.setInnerBudgetLib(rs.getString(i++));
+ this.setInnerErrorMessage(rs.getString(i++));
+ }
+
+ public java.lang.String getUtiLogin() {
+ return this.utiLogin;
+ }
+
+ public void setUtiLogin(final java.lang.String utiLogin) {
+ this.utiLogin = utiLogin;
+ this.isUtiLoginModified = true;
+ }
+
+ protected void setInnerUtiLogin(final java.lang.String utiLogin) {
+ this.utiLogin = utiLogin;
+ this.isUtiLoginSet = true;
+ }
+
+ public java.lang.String getStrUtiLogin(final java.lang.String returnInCaseOfNull) {
+ return this.utiLogin != null ? this.utiLogin.toString() : returnInCaseOfNull;
+ }
+
+ public java.lang.String getFileName() {
+ return this.fileName;
+ }
+
+ public void setFileName(final java.lang.String fileName) {
+ this.fileName = fileName;
+ this.isFileNameModified = true;
+ }
+
+ protected void setInnerFileName(final java.lang.String fileName) {
+ this.fileName = fileName;
+ this.isFileNameSet = true;
+ }
+
+ public java.lang.String getStrFileName(final java.lang.String returnInCaseOfNull) {
+ return this.fileName != null ? this.fileName.toString() : returnInCaseOfNull;
+ }
+
+ public java.lang.String getFileType() {
+ return this.fileType;
+ }
+
+ public void setFileType(final java.lang.String fileType) {
+ this.fileType = fileType;
+ this.isFileTypeModified = true;
+ }
+
+ protected void setInnerFileType(final java.lang.String fileType) {
+ this.fileType = fileType;
+ this.isFileTypeSet = true;
+ }
+
+ public java.lang.String getStrFileType(final java.lang.String returnInCaseOfNull) {
+ return this.fileType != null ? this.fileType.toString() : returnInCaseOfNull;
+ }
+
+ public java.sql.Timestamp getSubmitDate() {
+ return this.submitDate;
+ }
+
+ public void setSubmitDate(final java.sql.Timestamp submitDate) {
+ this.submitDate = submitDate;
+ this.isSubmitDateModified = true;
+ }
+
+ protected void setInnerSubmitDate(final java.sql.Timestamp submitDate) {
+ this.submitDate = submitDate;
+ this.isSubmitDateSet = true;
+ }
+
+ public java.lang.String getStrSubmitDate(final java.lang.String returnInCaseOfNull) {
+ return this.submitDate != null ? this.submitDate.toString() : returnInCaseOfNull;
+ }
+
+ public java.sql.Timestamp getEndDate() {
+ return this.endDate;
+ }
+
+ public void setEndDate(final java.sql.Timestamp endDate) {
+ this.endDate = endDate;
+ this.isEndDateModified = true;
+ }
+
+ protected void setInnerEndDate(final java.sql.Timestamp endDate) {
+ this.endDate = endDate;
+ this.isEndDateSet = true;
+ }
+
+ public java.lang.String getStrEndDate(final java.lang.String returnInCaseOfNull) {
+ return this.endDate != null ? this.endDate.toString() : returnInCaseOfNull;
+ }
+
+ public java.lang.Integer getStatus() {
+ return this.status;
+ }
+
+ public void setStatus(final java.lang.Integer status) {
+ this.status = status;
+ this.isStatusModified = true;
+ if (status == 5 || status == 4) {
+ this.setEndDate(new Timestamp(System.currentTimeMillis()));
+ }
+
+ }
+
+ protected void setInnerStatus(final java.lang.Integer status) {
+ this.status = status;
+ this.isStatusSet = true;
+ }
+
+ public java.lang.String getStrStatus(final java.lang.String returnInCaseOfNull) {
+ return this.status != null ? this.status.toString() : returnInCaseOfNull;
+ }
+
+ public java.lang.String getCollectivite() {
+ return this.collectivite;
+ }
+
+ public void setCollectivite(final java.lang.String collectivite) {
+ this.collectivite = collectivite;
+ this.isCollectiviteModified = true;
+ }
+
+ protected void setInnerCollectivite(final java.lang.String collectivite) {
+ this.collectivite = collectivite;
+ this.isCollectiviteSet = true;
+ }
+
+ public java.lang.String getStrCollectivite(final java.lang.String returnInCaseOfNull) {
+ return this.collectivite != null ? this.collectivite.toString() : returnInCaseOfNull;
+ }
+
+ public java.lang.String getBudget() {
+ return this.budget;
+ }
+
+ public void setBudget(final java.lang.String budget) {
+ this.budget = budget;
+ this.isBudgetModified = true;
+ }
+
+ protected void setInnerBudget(final java.lang.String budget) {
+ this.budget = budget;
+ this.isBudgetSet = true;
+ }
+
+ public java.lang.String getStrBudget(final java.lang.String returnInCaseOfNull) {
+ return this.budget != null ? this.budget.toString() : returnInCaseOfNull;
+ }
+
+ public java.lang.String getCollectiviteLib() {
+ return this.collectiviteLib;
+ }
+
+ public void setCollectiviteLib(final java.lang.String collectiviteLib) {
+ this.collectiviteLib = collectiviteLib;
+ this.isCollectiviteLibModified = true;
+ }
+
+ protected void setInnerCollectiviteLib(final java.lang.String collectiviteLib) {
+ this.collectiviteLib = collectiviteLib;
+ this.isCollectiviteLibSet = true;
+ }
+
+ public java.lang.String getStrCollectiviteLib(final java.lang.String returnInCaseOfNull) {
+ return this.collectiviteLib != null ? this.collectiviteLib.toString() : returnInCaseOfNull;
+ }
+
+ public java.lang.String getBudgetLib() {
+ return this.budgetLib;
+ }
+
+ public void setBudgetLib(final java.lang.String budgetLib) {
+ this.budgetLib = budgetLib;
+ this.isBudgetLibModified = true;
+ }
+
+ protected void setInnerBudgetLib(final java.lang.String budgetLib) {
+ this.budgetLib = budgetLib;
+ this.isBudgetLibSet = true;
+ }
+
+ public java.lang.String getStrBudgetLib(final java.lang.String returnInCaseOfNull) {
+ return this.budgetLib != null ? this.budgetLib.toString() : returnInCaseOfNull;
+ }
+
+ public java.lang.String getErrorMessage() {
+ return this.errorMessage;
+ }
+
+ public void setErrorMessage(final java.lang.String errorMessage) {
+ this.errorMessage = errorMessage;
+ this.isErrorMessageModified = true;
+ }
+
+ protected void setInnerErrorMessage(final java.lang.String errorMessage) {
+ this.errorMessage = errorMessage;
+ this.isErrorMessageSet = true;
+ }
+
+ public java.lang.String getStrErrorMessage(final java.lang.String returnInCaseOfNull) {
+ return this.errorMessage != null ? this.errorMessage.toString() : returnInCaseOfNull;
+ }
+
+ public void validate() throws IllegalStateException {
+ if (this.utiLogin == null) {
+ throw new IllegalStateException("UTI_LOGIN " + VoConstants.NOT_NULL_MSG);
+ }
+ if (this.utiLogin != null && this.utiLogin.length() > UTI_LOGIN_LEN) {
+ throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "UTI_LOGIN" + VoConstants.TOO_LONG_MSG_SUFX);
+ }
+ if (this.importId == null) {
+ throw new IllegalStateException("IMPORT_ID " + VoConstants.NOT_NULL_MSG);
+ }
+ if (this.importId != null && this.importId.length() > IMPORT_ID_LEN) {
+ throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "IMPORT_ID" + VoConstants.TOO_LONG_MSG_SUFX);
+ }
+ if (this.fileName == null) {
+ throw new IllegalStateException("FILE_NAME " + VoConstants.NOT_NULL_MSG);
+ }
+ if (this.fileName != null && this.fileName.length() > FILE_NAME_LEN) {
+ throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "FILE_NAME" + VoConstants.TOO_LONG_MSG_SUFX);
+ }
+ if (this.fileType == null) {
+ throw new IllegalStateException("FILE_TYPE " + VoConstants.NOT_NULL_MSG);
+ }
+ if (this.fileType != null && this.fileType.length() > FILE_TYPE_LEN) {
+ throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "FILE_TYPE" + VoConstants.TOO_LONG_MSG_SUFX);
+ }
+ if (this.status == null) {
+ throw new IllegalStateException("STATUS " + VoConstants.NOT_NULL_MSG);
+ }
+ if (this.collectivite != null && this.collectivite.length() > COLLECTIVITE_LEN) {
+ throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "COLLECTIVITE" + VoConstants.TOO_LONG_MSG_SUFX);
+ }
+ if (this.budget != null && this.budget.length() > BUDGET_LEN) {
+ throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "BUDGET" + VoConstants.TOO_LONG_MSG_SUFX);
+ }
+ if (this.collectiviteLib != null && this.collectiviteLib.length() > COLLECTIVITE_LIB_LEN) {
+ throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "COLLECTIVITE_LIB" + VoConstants.TOO_LONG_MSG_SUFX);
+ }
+ if (this.budgetLib != null && this.budgetLib.length() > BUDGET_LIB_LEN) {
+ throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "BUDGET_LIB" + VoConstants.TOO_LONG_MSG_SUFX);
+ }
+ if (this.errorMessage != null && this.errorMessage.length() > ERROR_MESSAGE_LEN) {
+ throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX + "ERROR_MESSAGE" + VoConstants.TOO_LONG_MSG_SUFX);
+ }
+ }
+
+ public void determinateStatus() {
+ if (this.status == 5) {
+ return;
+ }
+ boolean correct = true;
+ if (this.collectivite == null || this.collectivite.length() == 0) {
+ correct = false;
+ }
+ if (this.collectiviteLib == null || this.collectiviteLib.length() == 0) {
+ correct = false;
+ }
+ if (this.budget == null || this.budget.length() == 0) {
+ correct = false;
+ }
+ if (this.budgetLib == null || this.budgetLib.length() == 0) {
+ correct = false;
+ }
+ if (this.fileType == null || this.fileType.length() == 0) {
+ correct = false;
+ }
+ if (correct) {
+ this.setStatus(6);
+ } else {
+ this.setStatus(2);
+ }
+ }
}
-
\ No newline at end of file