/*
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
*/
|
package com.megatim.dynamicjsonparser.pojo;
|
|
import com.megatim.dynamicjsonparser.enums.TypeDonnee;
|
import java.util.ArrayList;
|
import java.util.List;
|
|
/**
|
*
|
* @author ASUS
|
*/
|
public class JsonDataType {
|
|
//nom du champ
|
private String fieldName;
|
|
//Type du champ si ce type est un primitif
|
private TypeDonnee typeDonnee;
|
|
// Liste des attributs de l'objet, si le type du champ est un objet Java à définir
|
private List<JsonDataType> jsonDataTypes = new ArrayList<>();
|
|
//Renseigne si ce champ est une collection(liste)
|
private boolean collection;
|
|
//Nom de la classe à laquelle appartient ce champ
|
private String className;
|
|
private String formatDate;
|
|
private String separateurDate;
|
|
private boolean required;
|
|
public JsonDataType(String fieldName, TypeDonnee typeDonnee, String className, boolean collection) {
|
this.fieldName = fieldName;
|
this.typeDonnee = typeDonnee;
|
this.className = className;
|
this.collection = collection;
|
}
|
|
public JsonDataType(String fieldName, List<JsonDataType> jsonDataTypes, String className, boolean collection) {
|
this.fieldName = fieldName;
|
this.jsonDataTypes = jsonDataTypes;
|
this.className = className;
|
this.collection = collection;
|
this.typeDonnee = TypeDonnee.OBJET;
|
}
|
|
public JsonDataType(String fieldName, TypeDonnee typeDonnee, String className, boolean required, boolean collection) {
|
this.fieldName = fieldName;
|
this.typeDonnee = typeDonnee;
|
this.className = className;
|
this.required = required;
|
this.collection = collection;
|
}
|
|
public JsonDataType(String fieldName, List<JsonDataType> jsonDataTypes, String className, boolean required, boolean collection) {
|
this.fieldName = fieldName;
|
this.jsonDataTypes = jsonDataTypes;
|
this.className = className;
|
this.required = required;
|
this.collection = collection;
|
this.typeDonnee = TypeDonnee.OBJET;
|
}
|
|
@Override
|
public String toString() {
|
return "JsonDataType{" + "fieldName=" + fieldName + ", typeDonnee=" + typeDonnee + ", jsonDataTypes=" + jsonDataTypes + ", collection=" + collection + ", className=" + className + ", formatDate=" + formatDate + ", separateurDate=" + separateurDate + ", required=" + required + '}';
|
}
|
|
public String getFieldName() {
|
return fieldName;
|
}
|
|
public void setFieldName(String fieldName) {
|
this.fieldName = fieldName;
|
}
|
|
public TypeDonnee getTypeDonnee() {
|
return typeDonnee;
|
}
|
|
public void setTypeDonnee(TypeDonnee typeDonnee) {
|
this.typeDonnee = typeDonnee;
|
}
|
|
public List<JsonDataType> getJsonDataTypes() {
|
return jsonDataTypes;
|
}
|
|
public void setJsonDataTypes(List<JsonDataType> jsonDataTypes) {
|
this.jsonDataTypes = jsonDataTypes;
|
}
|
|
public String getClassName() {
|
return className;
|
}
|
|
public void setClassName(String className) {
|
this.className = className;
|
}
|
|
public boolean isCollection() {
|
return collection;
|
}
|
|
public void setCollection(boolean collection) {
|
this.collection = collection;
|
}
|
|
public String getFormatDate() {
|
return formatDate;
|
}
|
|
public void setFormatDate(String formatDate) {
|
this.formatDate = formatDate;
|
}
|
|
public String getSeparateurDate() {
|
return separateurDate;
|
}
|
|
public void setSeparateurDate(String separateurDate) {
|
this.separateurDate = separateurDate;
|
}
|
|
public boolean isRequired() {
|
return required;
|
}
|
|
public void setRequired(boolean required) {
|
this.required = required;
|
}
|
}
|