[DEV] need rework to manage hybride bean
This commit is contained in:
parent
77dd42e499
commit
b9fcbc6780
@ -59,7 +59,7 @@ public class IntrospectionModelComplex extends IntrospectionModel {
|
|||||||
// }
|
// }
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
private boolean checkIfOneIsNull(String[] values, int offset) {
|
private boolean checkIfOneIsNull(final String[] values, final int offset) {
|
||||||
for (int iii=offset; iii<values.length; iii++) {
|
for (int iii=offset; iii<values.length; iii++) {
|
||||||
if (values[iii] == null) {
|
if (values[iii] == null) {
|
||||||
return true;
|
return true;
|
||||||
@ -107,7 +107,7 @@ public class IntrospectionModelComplex extends IntrospectionModel {
|
|||||||
// Retrieve full description in constructor properties...
|
// Retrieve full description in constructor properties...
|
||||||
String[] names = ReflectTools.getNames(elem, null);
|
String[] names = ReflectTools.getNames(elem, null);
|
||||||
if (names == null) {
|
if (names == null) {
|
||||||
names = new String[elem.getParameterCount()];
|
names = new String[elem.getParameterCount()-1];
|
||||||
} else if (elem.getParameterCount() != names.length+1) {
|
} else if (elem.getParameterCount() != names.length+1) {
|
||||||
throw new ExmlBuilderException("Wrong number of parameter in constructor with ne number declared in the @XmlName");
|
throw new ExmlBuilderException("Wrong number of parameter in constructor with ne number declared in the @XmlName");
|
||||||
}
|
}
|
||||||
@ -119,13 +119,13 @@ public class IntrospectionModelComplex extends IntrospectionModel {
|
|||||||
isAttributes[iii-1] = ReflectTools.getIsAttribute(elem, paramElem, null);
|
isAttributes[iii-1] = ReflectTools.getIsAttribute(elem, paramElem, null);
|
||||||
String[] namesParam = ReflectTools.getNames(elem, paramElem, null);
|
String[] namesParam = ReflectTools.getNames(elem, paramElem, null);
|
||||||
if (namesParam != null && namesParam.length != 0 ) {
|
if (namesParam != null && namesParam.length != 0 ) {
|
||||||
// TODO: maybe do something id name is already set ???
|
// TODO maybe do something id name is already set ???
|
||||||
names[iii-1] = namesParam[0];
|
names[iii-1] = namesParam[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (checkIfOneIsNull(names,1)) {
|
if (checkIfOneIsNull(names,0)) {
|
||||||
Log.verbose(" - " + elem.toGenericString());
|
Log.verbose(" - " + elem.toGenericString());
|
||||||
Log.verbose(" ==> unmanaged (missing names description)");
|
Log.verbose(" ==> unmanaged (missing names description: " + Arrays.toString(names) + ")");
|
||||||
} else {
|
} else {
|
||||||
this.constructors.add(new ConstructorModel(names, isAttributes, elem));
|
this.constructors.add(new ConstructorModel(names, isAttributes, elem));
|
||||||
}
|
}
|
||||||
@ -149,7 +149,7 @@ public class IntrospectionModelComplex extends IntrospectionModel {
|
|||||||
isAttributes[iii] = ReflectTools.getIsAttribute(elem, paramElem, null);
|
isAttributes[iii] = ReflectTools.getIsAttribute(elem, paramElem, null);
|
||||||
String[] namesParam = ReflectTools.getNames(elem, paramElem, null);
|
String[] namesParam = ReflectTools.getNames(elem, paramElem, null);
|
||||||
if (namesParam != null && namesParam.length != 0 ) {
|
if (namesParam != null && namesParam.length != 0 ) {
|
||||||
// TODO: maybe do something id name is already set ???
|
// TODO maybe do something id name is already set ???
|
||||||
names[iii] = namesParam[0];
|
names[iii] = namesParam[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -915,7 +915,12 @@ public class IntrospectionModelComplex extends IntrospectionModel {
|
|||||||
class OrderData {
|
class OrderData {
|
||||||
public Method getter = null;
|
public Method getter = null;
|
||||||
public final String name;
|
public final String name;
|
||||||
|
public String[] names = null;
|
||||||
public Method setter = null;
|
public Method setter = null;
|
||||||
|
public Field field = null;
|
||||||
|
public Boolean isAttribute = null;
|
||||||
|
public Boolean isOptionnal = null;
|
||||||
|
public Boolean isManaged = null;
|
||||||
|
|
||||||
public OrderData(final String name) {
|
public OrderData(final String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -5,8 +5,6 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.atriasoft.etk.util.ArraysTools;
|
import org.atriasoft.etk.util.ArraysTools;
|
||||||
|
|
||||||
import org.atriasoft.eStringSerialize.StringSerializer;
|
|
||||||
import org.atriasoft.exml.builder.IntrospectionModel;
|
import org.atriasoft.exml.builder.IntrospectionModel;
|
||||||
import org.atriasoft.exml.builder.IntrospectionModelFactory;
|
import org.atriasoft.exml.builder.IntrospectionModelFactory;
|
||||||
import org.atriasoft.exml.builder.IntrospectionProperty;
|
import org.atriasoft.exml.builder.IntrospectionProperty;
|
||||||
|
@ -5,13 +5,12 @@
|
|||||||
*/
|
*/
|
||||||
package test.atriasoft.exml;
|
package test.atriasoft.exml;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.atriasoft.exml.Exml;
|
import org.atriasoft.exml.Exml;
|
||||||
import org.atriasoft.exml.annotation.XmlAttribute;
|
import org.atriasoft.exml.annotation.XmlAttribute;
|
||||||
import org.atriasoft.exml.annotation.XmlDefaultAttibute;
|
import org.atriasoft.exml.annotation.XmlDefaultAttibute;
|
||||||
import org.atriasoft.exml.annotation.XmlList;
|
|
||||||
import org.atriasoft.exml.annotation.XmlName;
|
import org.atriasoft.exml.annotation.XmlName;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@ -26,11 +25,11 @@ public class ExmlTestIntrospectionDecorator {
|
|||||||
// ** Attribute
|
// ** Attribute
|
||||||
// ************************************************************
|
// ************************************************************
|
||||||
|
|
||||||
@XmlDefaultAttibute()
|
@XmlDefaultAttibute
|
||||||
public class TestNodeObject {
|
public class TestNodeObject {
|
||||||
|
|
||||||
public int valueA;
|
public int valueA;
|
||||||
@XmlAttribute()
|
@XmlAttribute
|
||||||
public int valueB;
|
public int valueB;
|
||||||
@XmlAttribute(true)
|
@XmlAttribute(true)
|
||||||
public int valueC;
|
public int valueC;
|
||||||
@ -47,7 +46,7 @@ public class ExmlTestIntrospectionDecorator {
|
|||||||
|
|
||||||
|
|
||||||
public final int finalValueM;
|
public final int finalValueM;
|
||||||
@XmlAttribute()
|
@XmlAttribute
|
||||||
public final int finalValueN;
|
public final int finalValueN;
|
||||||
@XmlAttribute(true)
|
@XmlAttribute(true)
|
||||||
public final int finalValueO;
|
public final int finalValueO;
|
||||||
@ -69,9 +68,9 @@ public class ExmlTestIntrospectionDecorator {
|
|||||||
"finalValueQ", "finalValueR", "finalValueS", "finalValueT",
|
"finalValueQ", "finalValueR", "finalValueS", "finalValueT",
|
||||||
"pFinalValueQ", "pFinalValueR", "pFinalValueS", "pFinalValueT"})
|
"pFinalValueQ", "pFinalValueR", "pFinalValueS", "pFinalValueT"})
|
||||||
public TestNodeObject(
|
public TestNodeObject(
|
||||||
int finalValueM, int finalValueN, int finalValueO, int finalValueP,
|
final int finalValueM, final int finalValueN, final int finalValueO, final int finalValueP,
|
||||||
int finalValueQ, @XmlAttribute() int finalValueR, @XmlAttribute(true) int finalValueS, @XmlAttribute(false) int finalValueT,
|
final int finalValueQ, @XmlAttribute final int finalValueR, @XmlAttribute(true) final int finalValueS, @XmlAttribute(false) final int finalValueT,
|
||||||
int pFinalValueQ, int pFinalValueR, int pFinalValueS, int pFinalValueT) {
|
final int pFinalValueQ, final int pFinalValueR, final int pFinalValueS, final int pFinalValueT) {
|
||||||
this.finalValueM = finalValueM;
|
this.finalValueM = finalValueM;
|
||||||
this.finalValueN = finalValueN;
|
this.finalValueN = finalValueN;
|
||||||
this.finalValueO = finalValueO;
|
this.finalValueO = finalValueO;
|
||||||
@ -87,71 +86,71 @@ public class ExmlTestIntrospectionDecorator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getValueE() {
|
public int getValueE() {
|
||||||
return valueE;
|
return this.valueE;
|
||||||
}
|
}
|
||||||
public void setValueE(int valueE) {
|
public void setValueE(final int valueE) {
|
||||||
this.valueE = valueE;
|
this.valueE = valueE;
|
||||||
}
|
}
|
||||||
@XmlAttribute()
|
@XmlAttribute
|
||||||
public int getValueF() {
|
public int getValueF() {
|
||||||
return valueF;
|
return this.valueF;
|
||||||
}
|
}
|
||||||
public void setValueF(int valueF) {
|
public void setValueF(final int valueF) {
|
||||||
this.valueF = valueF;
|
this.valueF = valueF;
|
||||||
}
|
}
|
||||||
public int getValueG() {
|
public int getValueG() {
|
||||||
return valueG;
|
return this.valueG;
|
||||||
}
|
}
|
||||||
@XmlAttribute()
|
@XmlAttribute
|
||||||
public void setValueG(int valueG) {
|
public void setValueG(final int valueG) {
|
||||||
this.valueG = valueG;
|
this.valueG = valueG;
|
||||||
}
|
}
|
||||||
@XmlAttribute(true)
|
@XmlAttribute(true)
|
||||||
public int getValueH() {
|
public int getValueH() {
|
||||||
return valueH;
|
return this.valueH;
|
||||||
}
|
}
|
||||||
public void setValueH(int valueH) {
|
public void setValueH(final int valueH) {
|
||||||
this.valueH = valueH;
|
this.valueH = valueH;
|
||||||
}
|
}
|
||||||
public int getValueI() {
|
public int getValueI() {
|
||||||
return valueI;
|
return this.valueI;
|
||||||
}
|
}
|
||||||
@XmlAttribute(true)
|
@XmlAttribute(true)
|
||||||
public void setValueI(int valueI) {
|
public void setValueI(final int valueI) {
|
||||||
this.valueI = valueI;
|
this.valueI = valueI;
|
||||||
}
|
}
|
||||||
@XmlAttribute(false)
|
@XmlAttribute(false)
|
||||||
public int getValueJ() {
|
public int getValueJ() {
|
||||||
return valueJ;
|
return this.valueJ;
|
||||||
}
|
}
|
||||||
public void setValueJ(int valueJ) {
|
public void setValueJ(final int valueJ) {
|
||||||
this.valueJ = valueJ;
|
this.valueJ = valueJ;
|
||||||
}
|
}
|
||||||
public int getValueK() {
|
public int getValueK() {
|
||||||
return valueK;
|
return this.valueK;
|
||||||
}
|
}
|
||||||
@XmlAttribute(false)
|
@XmlAttribute(false)
|
||||||
public void setValueK(int valueK) {
|
public void setValueK(final int valueK) {
|
||||||
this.valueK = valueK;
|
this.valueK = valueK;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getPFinalValueQ() {
|
public int getPFinalValueQ() {
|
||||||
return pFinalValueQ;
|
return this.pFinalValueQ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlAttribute()
|
@XmlAttribute
|
||||||
public int getPFinalValueR() {
|
public int getPFinalValueR() {
|
||||||
return pFinalValueR;
|
return this.pFinalValueR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlAttribute(true)
|
@XmlAttribute(true)
|
||||||
public int getPFinalValueS() {
|
public int getPFinalValueS() {
|
||||||
return pFinalValueS;
|
return this.pFinalValueS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlAttribute(false)
|
@XmlAttribute(false)
|
||||||
public int getPFinalValueT() {
|
public int getPFinalValueT() {
|
||||||
return pFinalValueT;
|
return this.pFinalValueT;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -212,7 +211,7 @@ public class ExmlTestIntrospectionDecorator {
|
|||||||
@XmlDefaultAttibute(true)
|
@XmlDefaultAttibute(true)
|
||||||
public class TestNodeObjectTrue {
|
public class TestNodeObjectTrue {
|
||||||
public int valueA;
|
public int valueA;
|
||||||
@XmlAttribute()
|
@XmlAttribute
|
||||||
public int valueB;
|
public int valueB;
|
||||||
@XmlAttribute(true)
|
@XmlAttribute(true)
|
||||||
public int valueC;
|
public int valueC;
|
||||||
@ -228,51 +227,51 @@ public class ExmlTestIntrospectionDecorator {
|
|||||||
private int valueK;
|
private int valueK;
|
||||||
|
|
||||||
public int getValueE() {
|
public int getValueE() {
|
||||||
return valueE;
|
return this.valueE;
|
||||||
}
|
}
|
||||||
public void setValueE(int valueE) {
|
public void setValueE(final int valueE) {
|
||||||
this.valueE = valueE;
|
this.valueE = valueE;
|
||||||
}
|
}
|
||||||
@XmlAttribute()
|
@XmlAttribute
|
||||||
public int getValueF() {
|
public int getValueF() {
|
||||||
return valueF;
|
return this.valueF;
|
||||||
}
|
}
|
||||||
public void setValueF(int valueF) {
|
public void setValueF(final int valueF) {
|
||||||
this.valueF = valueF;
|
this.valueF = valueF;
|
||||||
}
|
}
|
||||||
public int getValueG() {
|
public int getValueG() {
|
||||||
return valueG;
|
return this.valueG;
|
||||||
}
|
}
|
||||||
@XmlAttribute()
|
@XmlAttribute
|
||||||
public void setValueG(int valueG) {
|
public void setValueG(final int valueG) {
|
||||||
this.valueG = valueG;
|
this.valueG = valueG;
|
||||||
}
|
}
|
||||||
@XmlAttribute(true)
|
@XmlAttribute(true)
|
||||||
public int getValueH() {
|
public int getValueH() {
|
||||||
return valueH;
|
return this.valueH;
|
||||||
}
|
}
|
||||||
public void setValueH(int valueH) {
|
public void setValueH(final int valueH) {
|
||||||
this.valueH = valueH;
|
this.valueH = valueH;
|
||||||
}
|
}
|
||||||
public int getValueI() {
|
public int getValueI() {
|
||||||
return valueI;
|
return this.valueI;
|
||||||
}
|
}
|
||||||
@XmlAttribute(true)
|
@XmlAttribute(true)
|
||||||
public void setValueI(int valueI) {
|
public void setValueI(final int valueI) {
|
||||||
this.valueI = valueI;
|
this.valueI = valueI;
|
||||||
}
|
}
|
||||||
@XmlAttribute(false)
|
@XmlAttribute(false)
|
||||||
public int getValueJ() {
|
public int getValueJ() {
|
||||||
return valueJ;
|
return this.valueJ;
|
||||||
}
|
}
|
||||||
public void setValueJ(int valueJ) {
|
public void setValueJ(final int valueJ) {
|
||||||
this.valueJ = valueJ;
|
this.valueJ = valueJ;
|
||||||
}
|
}
|
||||||
public int getValueK() {
|
public int getValueK() {
|
||||||
return valueK;
|
return this.valueK;
|
||||||
}
|
}
|
||||||
@XmlAttribute(false)
|
@XmlAttribute(false)
|
||||||
public void setValueK(int valueK) {
|
public void setValueK(final int valueK) {
|
||||||
this.valueK = valueK;
|
this.valueK = valueK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,7 +319,7 @@ public class ExmlTestIntrospectionDecorator {
|
|||||||
@XmlDefaultAttibute(false)
|
@XmlDefaultAttibute(false)
|
||||||
public class TestNodeObjectFalse {
|
public class TestNodeObjectFalse {
|
||||||
public int valueA;
|
public int valueA;
|
||||||
@XmlAttribute()
|
@XmlAttribute
|
||||||
public int valueB;
|
public int valueB;
|
||||||
@XmlAttribute(true)
|
@XmlAttribute(true)
|
||||||
public int valueC;
|
public int valueC;
|
||||||
@ -336,51 +335,51 @@ public class ExmlTestIntrospectionDecorator {
|
|||||||
private int valueK;
|
private int valueK;
|
||||||
|
|
||||||
public int getValueE() {
|
public int getValueE() {
|
||||||
return valueE;
|
return this.valueE;
|
||||||
}
|
}
|
||||||
public void setValueE(int valueE) {
|
public void setValueE(final int valueE) {
|
||||||
this.valueE = valueE;
|
this.valueE = valueE;
|
||||||
}
|
}
|
||||||
@XmlAttribute()
|
@XmlAttribute
|
||||||
public int getValueF() {
|
public int getValueF() {
|
||||||
return valueF;
|
return this.valueF;
|
||||||
}
|
}
|
||||||
public void setValueF(int valueF) {
|
public void setValueF(final int valueF) {
|
||||||
this.valueF = valueF;
|
this.valueF = valueF;
|
||||||
}
|
}
|
||||||
public int getValueG() {
|
public int getValueG() {
|
||||||
return valueG;
|
return this.valueG;
|
||||||
}
|
}
|
||||||
@XmlAttribute()
|
@XmlAttribute
|
||||||
public void setValueG(int valueG) {
|
public void setValueG(final int valueG) {
|
||||||
this.valueG = valueG;
|
this.valueG = valueG;
|
||||||
}
|
}
|
||||||
@XmlAttribute(true)
|
@XmlAttribute(true)
|
||||||
public int getValueH() {
|
public int getValueH() {
|
||||||
return valueH;
|
return this.valueH;
|
||||||
}
|
}
|
||||||
public void setValueH(int valueH) {
|
public void setValueH(final int valueH) {
|
||||||
this.valueH = valueH;
|
this.valueH = valueH;
|
||||||
}
|
}
|
||||||
public int getValueI() {
|
public int getValueI() {
|
||||||
return valueI;
|
return this.valueI;
|
||||||
}
|
}
|
||||||
@XmlAttribute(true)
|
@XmlAttribute(true)
|
||||||
public void setValueI(int valueI) {
|
public void setValueI(final int valueI) {
|
||||||
this.valueI = valueI;
|
this.valueI = valueI;
|
||||||
}
|
}
|
||||||
@XmlAttribute(false)
|
@XmlAttribute(false)
|
||||||
public int getValueJ() {
|
public int getValueJ() {
|
||||||
return valueJ;
|
return this.valueJ;
|
||||||
}
|
}
|
||||||
public void setValueJ(int valueJ) {
|
public void setValueJ(final int valueJ) {
|
||||||
this.valueJ = valueJ;
|
this.valueJ = valueJ;
|
||||||
}
|
}
|
||||||
public int getValueK() {
|
public int getValueK() {
|
||||||
return valueK;
|
return this.valueK;
|
||||||
}
|
}
|
||||||
@XmlAttribute(false)
|
@XmlAttribute(false)
|
||||||
public void setValueK(int valueK) {
|
public void setValueK(final int valueK) {
|
||||||
this.valueK = valueK;
|
this.valueK = valueK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user