[DEV] update

This commit is contained in:
Edouard DUPIN 2023-07-27 07:33:48 +02:00
parent b040811197
commit eb5455693e
11 changed files with 261 additions and 188 deletions

View File

@ -1,15 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry including="**/*.java" kind="src" output="out/eclipse/classes-test" path="test/src"> <classpathentry kind="src" output="out/maven/test-classes" path="test/src">
<attributes> <attributes>
<attribute name="test" value="true"/> <attribute name="test" value="true"/>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="out/maven/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes> <attributes>
<attribute name="module" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"> <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5">
@ -17,10 +23,10 @@
<attribute name="test" value="true"/> <attribute name="test" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/atriasoft-etk"> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes> <attributes>
<attribute name="module" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="out/eclipse/classes"/> <classpathentry kind="output" path="out/maven/classes"/>
</classpath> </classpath>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="net.sf.eclipsecs.core.CheckstyleBuilder"/>
<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
</launchConfiguration>

View File

@ -12,12 +12,23 @@
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>net.sf.eclipsecs.core.CheckstyleBuilder</name> <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/net.sf.eclipsecs.core.CheckstyleBuilder (1).launch</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>net.sf.eclipsecs.core.CheckstyleNature</nature> <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
</natures> </natures>

118
pom.xml Normal file
View File

@ -0,0 +1,118 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>jatria-soft</groupId>
<artifactId>aknot</artifactId>
<version>0.1.0</version>
<properties>
<maven.compiler.version>3.1</maven.compiler.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.dependency.version>3.1.1</maven.dependency.version>
</properties>
<repositories>
<repository>
<id>gitea</id>
<url>https://gitea.atria-soft.org/api/packages/jatria-soft/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>gitea</id>
<url>https://gitea.atria-soft.org/api/packages/jatria-soft/maven</url>
</repository>
<snapshotRepository>
<id>gitea</id>
<url>https://gitea.atria-soft.org/api/packages/jatria-soft/maven</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>jatria-soft</groupId>
<artifactId>etk</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test/src</testSourceDirectory>
<directory>${project.basedir}/out/maven/</directory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<!--<encoding>${project.build.sourceEncoding}</encoding>-->
</configuration>
</plugin>
<!-- Create the source bundle -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- junit results -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>fully.qualified.MainClass</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<!-- Java-doc generation for stand-alone site -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<show>private</show>
<nohelp>true</nohelp>
</configuration>
</plugin>
</plugins>
</build>
<!-- Generate Java-docs As Part Of Project Reports -->
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<show>public</show>
</configuration>
</plugin>
</plugins>
</reporting>
</project>

View File

@ -12,6 +12,5 @@ open module org.atriasoft.aknot {
exports org.atriasoft.aknot.exception; exports org.atriasoft.aknot.exception;
requires transitive org.atriasoft.etk; requires transitive org.atriasoft.etk;
requires transitive org.atriasoft.reggol;
requires java.base; requires java.base;
} }

View File

@ -1,6 +1,8 @@
package org.atriasoft.aknot; package org.atriasoft.aknot;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Method; import java.lang.reflect.Method;
@ -26,9 +28,10 @@ import org.atriasoft.aknot.annotation.AknotOptional;
import org.atriasoft.aknot.annotation.AknotSignal; import org.atriasoft.aknot.annotation.AknotSignal;
import org.atriasoft.aknot.annotation.AknotText; import org.atriasoft.aknot.annotation.AknotText;
import org.atriasoft.aknot.exception.AknotException; import org.atriasoft.aknot.exception.AknotException;
import org.atriasoft.aknot.internal.Log;
public class ReflectTools { public class ReflectTools {
final static Logger LOGGER = LoggerFactory.getLogger(ReflectTools.class);
public static String getDescription(final Class<?> element) throws Exception { public static String getDescription(final Class<?> element) throws Exception {
final Annotation[] annotation = element.getDeclaredAnnotationsByType(AknotDescription.class); final Annotation[] annotation = element.getDeclaredAnnotationsByType(AknotDescription.class);
if (annotation.length == 0) { if (annotation.length == 0) {
@ -570,7 +573,7 @@ public class ReflectTools {
final Type[] realType = plopppppp.getActualTypeArguments(); final Type[] realType = plopppppp.getActualTypeArguments();
//Log.info("ppplllppp: " + realType.length); //Log.info("ppplllppp: " + realType.length);
if (realType.length > 0) { if (realType.length > 0) {
Log.verbose(" -->> " + realType[0]); LOGGER.trace(" -->> {}", realType[0]);
internalModelClass = Class.forName(realType[0].getTypeName()); internalModelClass = Class.forName(realType[0].getTypeName());
} }
} }
@ -592,7 +595,7 @@ public class ReflectTools {
if (empppe[0] instanceof final ParameterizedType plopppppp) { if (empppe[0] instanceof final ParameterizedType plopppppp) {
final Type[] realType = plopppppp.getActualTypeArguments(); final Type[] realType = plopppppp.getActualTypeArguments();
if (realType.length > 0) { if (realType.length > 0) {
Log.verbose(" -->> " + realType[0]); LOGGER.trace(" -->> {}", realType[0]);
internalModelClass = Class.forName(realType[0].getTypeName()); internalModelClass = Class.forName(realType[0].getTypeName());
} }
} }

View File

@ -1,81 +0,0 @@
/** @file
* @author Edouard DUPIN
* @copyright 2021, Edouard DUPIN, all right reserved
* @license MPL v2.0 (see license file)
*/
package org.atriasoft.aknot.internal;
import org.atriasoft.reggol.LogLevel;
import org.atriasoft.reggol.Logger;
public class Log {
private static final String LIB_NAME = "aknot";
private static final boolean FORCE_ALL = false;
private static final String LIB_NAME_DRAW = Logger.getDrawableName(Log.LIB_NAME);
private static final boolean PRINT_CRITICAL = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.CRITICAL);
private static final boolean PRINT_DEBUG = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.DEBUG);
private static final boolean PRINT_ERROR = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.ERROR);
private static final boolean PRINT_INFO = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.INFO);
private static final boolean PRINT_PRINT = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.PRINT);
private static final boolean PRINT_TODO = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.TODO);
private static final boolean PRINT_VERBOSE = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.VERBOSE);
private static final boolean PRINT_WARNING = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.WARNING);
public static void critical(final Exception e, final String data) {
e.printStackTrace();
if (PRINT_CRITICAL || FORCE_ALL) {
Logger.critical(LIB_NAME_DRAW, data + " : " + e.getMessage());
}
}
public static void critical(final String data, final Object... objects) {
if (PRINT_CRITICAL || FORCE_ALL) {
Logger.critical(LIB_NAME_DRAW, data, objects);
}
}
public static void debug(final String data, final Object... objects) {
if (PRINT_DEBUG || FORCE_ALL) {
Logger.debug(LIB_NAME_DRAW, data, objects);
}
}
public static void error(final String data, final Object... objects) {
if (PRINT_ERROR || FORCE_ALL) {
Logger.error(LIB_NAME_DRAW, data, objects);
}
}
public static void info(final String data, final Object... objects) {
if (PRINT_INFO || FORCE_ALL) {
Logger.info(LIB_NAME_DRAW, data, objects);
}
}
public static void print(final String data, final Object... objects) {
if (PRINT_PRINT || FORCE_ALL) {
Logger.print(LIB_NAME_DRAW, data, objects);
}
}
public static void todo(final String data, final Object... objects) {
if (PRINT_TODO || FORCE_ALL) {
Logger.todo(LIB_NAME_DRAW, data, objects);
}
}
public static void verbose(final String data, final Object... objects) {
if (PRINT_VERBOSE || FORCE_ALL) {
Logger.verbose(LIB_NAME_DRAW, data, objects);
}
}
public static void warning(final String data, final Object... objects) {
if (PRINT_WARNING || FORCE_ALL) {
Logger.warning(LIB_NAME_DRAW, data, objects);
}
}
private Log() {}
}

View File

@ -4,10 +4,13 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.atriasoft.aknot.exception.AknotException; import org.atriasoft.aknot.exception.AknotException;
import org.atriasoft.aknot.internal.Log;
import org.atriasoft.aknot.pojo.IntrospectionProperty; import org.atriasoft.aknot.pojo.IntrospectionProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public abstract class IntrospectionModel { public abstract class IntrospectionModel {
final static Logger LOGGER = LoggerFactory.getLogger(IntrospectionModel.class);
public static final String STUPID_TOCKEN = "___aé\"'__-è==**ù!^$:;,;AZEARTYUIOPMLKJHGFDSQW>XCVBN?"; // can not exist .... public static final String STUPID_TOCKEN = "___aé\"'__-è==**ù!^$:;,;AZEARTYUIOPMLKJHGFDSQW>XCVBN?"; // can not exist ....
protected static final Boolean DEFAULT_ATTRIBUTE = false; protected static final Boolean DEFAULT_ATTRIBUTE = false;
protected static final Boolean DEFAULT_IGNORE_UNBKNOWN = false; protected static final Boolean DEFAULT_IGNORE_UNBKNOWN = false;
@ -106,7 +109,7 @@ public abstract class IntrospectionModel {
*/ */
public Object getValueConverted(final Object value, final Class<?> classTypeLocal) throws AknotException { public Object getValueConverted(final Object value, final Class<?> classTypeLocal) throws AknotException {
// Note if the type is an Array<>() or a List<>() ==> we parse element by element ... then we need to keep the undertype... // Note if the type is an Array<>() or a List<>() ==> we parse element by element ... then we need to keep the undertype...
Log.debug("======>>>>>>> convert : {} ==> {} ", value.getClass().getCanonicalName(), classTypeLocal.getCanonicalName()); LOGGER.debug("======>>>>>>> convert : {} ==> {} ", value.getClass().getCanonicalName(), classTypeLocal.getCanonicalName());
if (value.getClass() == Long.class) { if (value.getClass() == Long.class) {
if (classTypeLocal == long.class || classTypeLocal == Long.class) { if (classTypeLocal == long.class || classTypeLocal == Long.class) {
return value; return value;
@ -197,7 +200,7 @@ public abstract class IntrospectionModel {
return (double) 0; return (double) 0;
} }
} }
Log.error("======>>>>>>> convert : {} ==> {} Can not do it !!!", value.getClass().getCanonicalName(), classTypeLocal.getCanonicalName()); LOGGER.error("======>>>>>>> convert : {} ==> {} Can not do it !!!", value.getClass().getCanonicalName(), classTypeLocal.getCanonicalName());
return value; return value;
} }

View File

@ -19,13 +19,15 @@ import org.atriasoft.aknot.ReflectClass;
import org.atriasoft.aknot.ReflectTools; import org.atriasoft.aknot.ReflectTools;
import org.atriasoft.aknot.StringSerializer; import org.atriasoft.aknot.StringSerializer;
import org.atriasoft.aknot.exception.AknotException; import org.atriasoft.aknot.exception.AknotException;
import org.atriasoft.aknot.internal.Log;
import org.atriasoft.aknot.model.ConstructorModel; import org.atriasoft.aknot.model.ConstructorModel;
import org.atriasoft.aknot.model.IntrospectionModel; import org.atriasoft.aknot.model.IntrospectionModel;
import org.atriasoft.etk.Tools; import org.atriasoft.etk.Tools;
import org.atriasoft.etk.util.ArraysTools; import org.atriasoft.etk.util.ArraysTools;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class IntrospectionModelComplex extends IntrospectionModel { public class IntrospectionModelComplex extends IntrospectionModel {
final static Logger LOGGER = LoggerFactory.getLogger(IntrospectionModelComplex.class);
private final boolean isRecord; private final boolean isRecord;
// TODO Optimize this with external object for basic types.... // TODO Optimize this with external object for basic types....
private final Method valueof; // used for the set Text if the object is an end point... private final Method valueof; // used for the set Text if the object is an end point...
@ -53,18 +55,18 @@ public class IntrospectionModelComplex extends IntrospectionModel {
} }
this.isRecord = Record.class.isAssignableFrom(classType); this.isRecord = Record.class.isAssignableFrom(classType);
if (classType.isPrimitive()) { if (classType.isPrimitive()) {
Log.critical("Detect primitive ==> impossible case !!! "); LOGGER.error("[CRITICAL] Detect primitive ==> impossible case !!! ");
} }
final Boolean isDefaultManaged = ReflectTools.getIsDefaultManaged(classType, IntrospectionModel.DEFAULT_MANAGED); final Boolean isDefaultManaged = ReflectTools.getIsDefaultManaged(classType, IntrospectionModel.DEFAULT_MANAGED);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// -- Parse constructor // -- Parse constructor
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
Log.error("Introspect class: '" + classType.getCanonicalName() + "'"); LOGGER.error("Introspect class: '" + classType.getCanonicalName() + "'");
final Constructor<?>[] constructors = this.classType.getConstructors(); final Constructor<?>[] constructors = this.classType.getConstructors();
Log.warning(" Constructors: (" + constructors.length + ")"); LOGGER.warn(" Constructors: (" + constructors.length + ")");
Constructor<?> emptyConstructorTmp = null; Constructor<?> emptyConstructorTmp = null;
for (final Constructor<?> elem : constructors) { for (final Constructor<?> elem : constructors) {
Log.error(" Constructor ??? : {}", elem.toGenericString()); LOGGER.error(" Constructor ??? : {}", elem.toGenericString());
// we does not manage private field // we does not manage private field
if (!Modifier.isPublic(elem.getModifiers())) { if (!Modifier.isPublic(elem.getModifiers())) {
continue; continue;
@ -76,7 +78,7 @@ public class IntrospectionModelComplex extends IntrospectionModel {
} }
if (elem.getParameterCount() == 0) { if (elem.getParameterCount() == 0) {
emptyConstructorTmp = elem; emptyConstructorTmp = elem;
Log.error(" >>> " + elem.toGenericString()); LOGGER.error(" >>> " + elem.toGenericString());
} else { } else {
int offsetSubClass = 0; int offsetSubClass = 0;
if (this.isSubClass) { if (this.isSubClass) {
@ -84,7 +86,7 @@ public class IntrospectionModelComplex extends IntrospectionModel {
} }
if (elem.getParameterCount() == 1 && offsetSubClass == 1) { if (elem.getParameterCount() == 1 && offsetSubClass == 1) {
emptyConstructorTmp = elem; emptyConstructorTmp = elem;
Log.error(" >>> " + elem.toGenericString()); LOGGER.error(" >>> " + elem.toGenericString());
} else { } else {
// Retrieve full description in constructor properties... // Retrieve full description in constructor properties...
String[] namesBeans = ReflectTools.getNames(elem, null); String[] namesBeans = ReflectTools.getNames(elem, null);
@ -129,8 +131,8 @@ public class IntrospectionModelComplex extends IntrospectionModel {
continue; continue;
} }
if (checkIfOneIsNull(namesBeans, 0)) { if (checkIfOneIsNull(namesBeans, 0)) {
Log.verbose(" - " + elem.toGenericString()); LOGGER.trace(" - " + elem.toGenericString());
Log.verbose(" ==> unmanaged (missing names description: " + Arrays.toString(namesBeans) + ")"); LOGGER.trace(" ==> unmanaged (missing names description: " + Arrays.toString(namesBeans) + ")");
} else { } else {
// check default attributes in the global list ... (do it at the end to be sure the constructor is VALID ... // check default attributes in the global list ... (do it at the end to be sure the constructor is VALID ...
for (int iii = 0; iii < namesBeans.length; iii++) { for (int iii = 0; iii < namesBeans.length; iii++) {
@ -197,11 +199,11 @@ public class IntrospectionModelComplex extends IntrospectionModel {
} }
} }
this.constructorEmpty = emptyConstructorTmp; this.constructorEmpty = emptyConstructorTmp;
Log.error(" ==> constructor = {}", this.constructorEmpty); LOGGER.error(" ==> constructor = {}", this.constructorEmpty);
// Order the constructor from the bigger number of element to the lowest... // Order the constructor from the bigger number of element to the lowest...
Collections.sort(this.constructors, (a, b) -> a.values().length - b.values().length); Collections.sort(this.constructors, (a, b) -> a.values().length - b.values().length);
for (final ConstructorModel elem : this.constructors) { for (final ConstructorModel elem : this.constructors) {
Log.verbose(" * " + elem.constructor().toGenericString()); LOGGER.trace(" * " + elem.constructor().toGenericString());
final StringBuilder tmpPrint = new StringBuilder(" ==> ("); final StringBuilder tmpPrint = new StringBuilder(" ==> (");
if (this.isSubClass) { if (this.isSubClass) {
tmpPrint.append("null, "); tmpPrint.append("null, ");
@ -213,7 +215,7 @@ public class IntrospectionModelComplex extends IntrospectionModel {
tmpPrint.append(elem.values()[iii]); tmpPrint.append(elem.values()[iii]);
} }
tmpPrint.append(")"); tmpPrint.append(")");
Log.verbose(tmpPrint.toString()); LOGGER.trace(tmpPrint.toString());
} }
final List<String> recordAllPossibleValues = new ArrayList<>(); final List<String> recordAllPossibleValues = new ArrayList<>();
@ -231,7 +233,7 @@ public class IntrospectionModelComplex extends IntrospectionModel {
// -- Parse Field // -- Parse Field
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
final Field[] fields = this.classType.getFields(); final Field[] fields = this.classType.getFields();
Log.verbose(" Fields: (" + fields.length + ")"); LOGGER.trace(" Fields: (" + fields.length + ")");
for (final Field elem : fields) { for (final Field elem : fields) {
// we does not manage static field // we does not manage static field
if (Modifier.isStatic(elem.getModifiers())) { if (Modifier.isStatic(elem.getModifiers())) {
@ -313,14 +315,14 @@ public class IntrospectionModelComplex extends IntrospectionModel {
prop.setSetter(modifier); prop.setSetter(modifier);
prop.setGetter(modifier); prop.setGetter(modifier);
} }
Log.verbose(" - " + elem.toGenericString()); LOGGER.trace(" - " + elem.toGenericString());
} }
final List<Method> methods = ReflectClass.getFilterGenericFucntion(this.classType, recordAllPossibleValues, true, true, true); final List<Method> methods = ReflectClass.getFilterGenericFucntion(this.classType, recordAllPossibleValues, true, true, true);
Log.verbose(" Methods: (" + methods.size() + ")"); LOGGER.trace(" Methods: (" + methods.size() + ")");
for (final Method elem : methods) { for (final Method elem : methods) {
Log.verbose(" - " + elem.toGenericString()); LOGGER.trace(" - " + elem.toGenericString());
} }
// Separate the methods and filer as: // Separate the methods and filer as:
@ -549,8 +551,8 @@ public class IntrospectionModelComplex extends IntrospectionModel {
throw new AknotException("No constructor accessible for class: " + this.classType.getCanonicalName()); throw new AknotException("No constructor accessible for class: " + this.classType.getCanonicalName());
} }
try { try {
Log.error("create class : {} with subClass={}", this.classType.getCanonicalName(), this.isSubClass); LOGGER.error("create class : {} with subClass={}", this.classType.getCanonicalName(), this.isSubClass);
Log.error(" ==> constructor = {}", this.constructorEmpty); LOGGER.error(" ==> constructor = {}", this.constructorEmpty);
if (this.isSubClass) { if (this.isSubClass) {
final Object tmp2 = null; final Object tmp2 = null;
tmp = this.constructorEmpty.newInstance(tmp2); tmp = this.constructorEmpty.newInstance(tmp2);
@ -573,51 +575,51 @@ public class IntrospectionModelComplex extends IntrospectionModel {
} }
public void display() { public void display() {
Log.print("Class: {} nbProperty:{}", this.classType.getCanonicalName(), this.elements.size()); LOGGER.info("Class: {} nbProperty:{}", this.classType.getCanonicalName(), this.elements.size());
Log.print("Managed:"); LOGGER.info("Managed:");
for (final IntrospectionProperty prop : this.elements) { for (final IntrospectionProperty prop : this.elements) {
Log.print(" * Property/node : {}", prop.getBeanName()); LOGGER.info(" * Property/node : {}", prop.getBeanName());
Log.print(" names: {}", Arrays.toString(prop.getNames())); LOGGER.info(" names: {}", Arrays.toString(prop.getNames()));
Log.print(" list: {}", prop.getListName()); LOGGER.info(" list: {}", prop.getListName());
//Log.print(" managed: {}", prop.isManaged()); //LOGGER.info(" managed: {}", prop.isManaged());
Log.print(" attribute: {}", prop.isAttribute()); LOGGER.info(" attribute: {}", prop.isAttribute());
Log.print(" text: {}", prop.isText()); LOGGER.info(" text: {}", prop.isText());
Log.print(" case-sensitive: {}", prop.isCaseSensitive()); LOGGER.info(" case-sensitive: {}", prop.isCaseSensitive());
Log.print(" optionnal: {}", prop.isOptionnal()); LOGGER.info(" optionnal: {}", prop.isOptionnal());
Log.print(" constructor: {}", prop.isCanBeSetByConstructor()); LOGGER.info(" constructor: {}", prop.isCanBeSetByConstructor());
Log.print(" get/set: {} / {}", prop.canGetValue(), prop.canSetValue()); LOGGER.info(" get/set: {} / {}", prop.canGetValue(), prop.canSetValue());
Log.print(" type: {}", prop.getType().getCanonicalName()); LOGGER.info(" type: {}", prop.getType().getCanonicalName());
if (prop.getSubType() != null) { if (prop.getSubType() != null) {
Log.print(" sub-type: {}", prop.getSubType().getCanonicalName()); LOGGER.info(" sub-type: {}", prop.getSubType().getCanonicalName());
} else { } else {
Log.print(" sub-type: null"); LOGGER.info(" sub-type: null");
} }
} }
Log.info("Un-Managed:"); LOGGER.info("Un-Managed:");
for (final IntrospectionProperty prop : this.elementUnManaged) { for (final IntrospectionProperty prop : this.elementUnManaged) {
Log.print(" * Property/node : {}", prop.getBeanName()); LOGGER.info(" * Property/node : {}", prop.getBeanName());
Log.print(" names: {}", Arrays.toString(prop.getNames())); LOGGER.info(" names: {}", Arrays.toString(prop.getNames()));
Log.print(" list: {}", prop.getListName()); LOGGER.info(" list: {}", prop.getListName());
//Log.print(" managed: {}", prop.isManaged()); //LOGGER.info(" managed: {}", prop.isManaged());
Log.print(" attribute: {}", prop.isAttribute()); LOGGER.info(" attribute: {}", prop.isAttribute());
Log.print(" text: {}", prop.isText()); LOGGER.info(" text: {}", prop.isText());
Log.print(" case-sensitive: {}", prop.isCaseSensitive()); LOGGER.info(" case-sensitive: {}", prop.isCaseSensitive());
Log.print(" optionnal: {}", prop.isOptionnal()); LOGGER.info(" optionnal: {}", prop.isOptionnal());
Log.print(" constructor: {}", prop.isCanBeSetByConstructor()); LOGGER.info(" constructor: {}", prop.isCanBeSetByConstructor());
Log.print(" get/set: {} / {}", prop.canGetValue(), prop.canSetValue()); LOGGER.info(" get/set: {} / {}", prop.canGetValue(), prop.canSetValue());
Log.print(" type: {}", prop.getType().getCanonicalName()); LOGGER.info(" type: {}", prop.getType().getCanonicalName());
if (prop.getSubType() != null) { if (prop.getSubType() != null) {
Log.print(" sub-type: {}", prop.getSubType().getCanonicalName()); LOGGER.info(" sub-type: {}", prop.getSubType().getCanonicalName());
} else { } else {
Log.print(" sub-type: null"); LOGGER.info(" sub-type: null");
} }
} }
} }
protected IntrospectionProperty findBeanNodeDescription(final String propertyBeanName, final boolean attributeIndependent) throws AknotException { protected IntrospectionProperty findBeanNodeDescription(final String propertyBeanName, final boolean attributeIndependent) throws AknotException {
Log.debug("Find node description for element: {}", propertyBeanName); LOGGER.debug("Find node description for element: {}", propertyBeanName);
for (final IntrospectionProperty prop : this.elements) { for (final IntrospectionProperty prop : this.elements) {
Log.debug(" ==> {} => {}", prop.getBeanName(), prop.isAttribute()); LOGGER.debug(" ==> {} => {}", prop.getBeanName(), prop.isAttribute());
if (!attributeIndependent && prop.isAttribute()) { if (!attributeIndependent && prop.isAttribute()) {
continue; continue;
} }
@ -755,10 +757,10 @@ public class IntrospectionModelComplex extends IntrospectionModel {
@Override @Override
public String getTreeNameOfSubNode(final String nodeBeanName, final boolean attributeIndependent) throws AknotException { public String getTreeNameOfSubNode(final String nodeBeanName, final boolean attributeIndependent) throws AknotException {
Log.debug(" nodeType='" + nodeBeanName + "'"); LOGGER.debug(" nodeType='" + nodeBeanName + "'");
final IntrospectionProperty propMethode = findBeanNodeDescription(nodeBeanName, attributeIndependent); final IntrospectionProperty propMethode = findBeanNodeDescription(nodeBeanName, attributeIndependent);
if (propMethode != null && propMethode.canSetValue()) { if (propMethode != null && propMethode.canSetValue()) {
Log.debug(" ==> find '" + propMethode.getNames()); LOGGER.debug(" ==> find '" + propMethode.getNames());
return propMethode.getListName(); return propMethode.getListName();
} }
throw new AknotException("can not find the field '" + nodeBeanName + "'"); throw new AknotException("can not find the field '" + nodeBeanName + "'");
@ -766,10 +768,10 @@ public class IntrospectionModelComplex extends IntrospectionModel {
@Override @Override
public Class<?> getTypeOfProperty(final String nodeName) throws AknotException { public Class<?> getTypeOfProperty(final String nodeName) throws AknotException {
Log.debug("nodeType='" + nodeName + "'"); LOGGER.debug("nodeType='" + nodeName + "'");
final IntrospectionProperty propField = findPropertyDescription(nodeName); final IntrospectionProperty propField = findPropertyDescription(nodeName);
if (propField != null && propField.canSetValue()) { if (propField != null && propField.canSetValue()) {
Log.debug(" ==> find '" + propField.getNames()); LOGGER.debug(" ==> find '" + propField.getNames());
return propField.getType(); return propField.getType();
} }
@ -785,10 +787,10 @@ public class IntrospectionModelComplex extends IntrospectionModel {
public Class<?> getTypeOfSubNode(final String nodeBeanNames, final boolean attributeIndependent) throws AknotException { public Class<?> getTypeOfSubNode(final String nodeBeanNames, final boolean attributeIndependent) throws AknotException {
final String[] elemstNames = nodeBeanNames.split("#"); final String[] elemstNames = nodeBeanNames.split("#");
final String nodeBeanName = elemstNames[0]; final String nodeBeanName = elemstNames[0];
Log.debug("NodeType='" + nodeBeanName + "'"); LOGGER.debug("NodeType='" + nodeBeanName + "'");
final IntrospectionProperty propMethode = findBeanNodeDescription(nodeBeanName, attributeIndependent); final IntrospectionProperty propMethode = findBeanNodeDescription(nodeBeanName, attributeIndependent);
if (propMethode != null && propMethode.canSetValue()) { if (propMethode != null && propMethode.canSetValue()) {
Log.debug(" ==> find '" + propMethode.getNames()); LOGGER.debug(" ==> find '" + propMethode.getNames());
if (propMethode.hasFactory()) { if (propMethode.hasFactory()) {
return propMethode.getCompatible(elemstNames[1]); return propMethode.getCompatible(elemstNames[1]);
} else { } else {
@ -802,10 +804,10 @@ public class IntrospectionModelComplex extends IntrospectionModel {
public Class<?> getTypeOfSubNodeList(final String nodeBeanNames, final boolean attributeIndependent) throws AknotException { public Class<?> getTypeOfSubNodeList(final String nodeBeanNames, final boolean attributeIndependent) throws AknotException {
final String[] elemstNames = nodeBeanNames.split("#"); final String[] elemstNames = nodeBeanNames.split("#");
final String nodeBeanName = elemstNames[0]; final String nodeBeanName = elemstNames[0];
Log.debug(" nodeType='" + nodeBeanName + "'"); LOGGER.debug(" nodeType='" + nodeBeanName + "'");
final IntrospectionProperty propMethode = findBeanNodeDescription(nodeBeanName, attributeIndependent); final IntrospectionProperty propMethode = findBeanNodeDescription(nodeBeanName, attributeIndependent);
if (propMethode != null && propMethode.canSetValue()) { if (propMethode != null && propMethode.canSetValue()) {
Log.debug(" ==> find '" + propMethode.getNames()); LOGGER.debug(" ==> find '" + propMethode.getNames());
if (propMethode.hasFactory()) { if (propMethode.hasFactory()) {
return propMethode.getCompatible(elemstNames[1]); return propMethode.getCompatible(elemstNames[1]);
} else { } else {
@ -817,10 +819,10 @@ public class IntrospectionModelComplex extends IntrospectionModel {
@Override @Override
public Class<?> getTypeOfSubProperty(final String nodeName) throws AknotException { public Class<?> getTypeOfSubProperty(final String nodeName) throws AknotException {
Log.debug(" nodeType='" + nodeName + "'"); LOGGER.debug(" nodeType='" + nodeName + "'");
final IntrospectionProperty propField = findPropertyDescription(nodeName); final IntrospectionProperty propField = findPropertyDescription(nodeName);
if (propField != null && propField.canSetValue()) { if (propField != null && propField.canSetValue()) {
Log.debug(" ==> find '" + propField.getNames()); LOGGER.debug(" ==> find '" + propField.getNames());
return propField.getSubType(); return propField.getSubType();
} }
throw new AknotException("can not find the field '" + nodeName + "' available: " + getNodeAvaillable()); throw new AknotException("can not find the field '" + nodeName + "' available: " + getNodeAvaillable());
@ -839,17 +841,17 @@ public class IntrospectionModelComplex extends IntrospectionModel {
@Override @Override
public Object getValue(final String propertyName, final String propertyValue) throws AknotException { public Object getValue(final String propertyName, final String propertyValue) throws AknotException {
Log.debug(" propertyName='" + propertyName + "' propertyValue='" + propertyValue + "' "); LOGGER.debug(" propertyName='" + propertyName + "' propertyValue='" + propertyValue + "' ");
// by default use setter to set the property // by default use setter to set the property
final IntrospectionProperty propMethode = findNodeDescription(propertyName); final IntrospectionProperty propMethode = findNodeDescription(propertyName);
if (propMethode != null && propMethode.canSetValue()) { if (propMethode != null && propMethode.canSetValue()) {
Log.verbose(" ==> find '" + propMethode.getNames()); LOGGER.trace(" ==> find '" + propMethode.getNames());
return propMethode.createValue(propertyValue); return propMethode.createValue(propertyValue);
} }
// try with direct field // try with direct field
final IntrospectionProperty propField = findPropertyDescription(propertyName); final IntrospectionProperty propField = findPropertyDescription(propertyName);
if (propField != null && propField.canSetValue()) { if (propField != null && propField.canSetValue()) {
Log.verbose(" ==> find '" + propField.getNames()); LOGGER.trace(" ==> find '" + propField.getNames());
return propField.createValue(propertyValue); return propField.createValue(propertyValue);
} }
throw new AknotException("can not find the field '" + propertyName + "'"); throw new AknotException("can not find the field '" + propertyName + "'");
@ -859,8 +861,8 @@ public class IntrospectionModelComplex extends IntrospectionModel {
public Object getValueFromText(final String text) throws AknotException { public Object getValueFromText(final String text) throws AknotException {
// Note if the type is an Array<>() or a List<>() ==> we parse element by element ... then we need to keep the undertype... // Note if the type is an Array<>() or a List<>() ==> we parse element by element ... then we need to keep the undertype...
Class<?> classTypeLocal = this.classType; Class<?> classTypeLocal = this.classType;
Log.debug("======>>>>>>> Get input type : " + this.classType.getCanonicalName()); LOGGER.debug("======>>>>>>> Get input type : " + this.classType.getCanonicalName());
//Log.debug("======>>>>>>> Get input component type : " + this.classType.getComponentType().getCanonicalName()); //LOGGER.debug("======>>>>>>> Get input component type : " + this.classType.getComponentType().getCanonicalName());
if (this.classType.isArray()) { if (this.classType.isArray()) {
// generic array ... // generic array ...
classTypeLocal = this.classType.getComponentType(); classTypeLocal = this.classType.getComponentType();
@ -881,12 +883,12 @@ public class IntrospectionModelComplex extends IntrospectionModel {
*/ */
//Type tmpp = classType.getGenericSuperclass(); //Type tmpp = classType.getGenericSuperclass();
// Class<?> tmpp = classType.getInterfaces(); // Class<?> tmpp = classType.getInterfaces();
// Log.warning("======>>>>>>> Find List '" + tmpp + "'"); // LOGGER.warn("======>>>>>>> Find List '" + tmpp + "'");
// for (int iii = 0; iii < tmpp.length; iii++) { // for (int iii = 0; iii < tmpp.length; iii++) {
// Log.warning(" - " + tmpp[iii]); // LOGGER.warn(" - " + tmpp[iii]);
// } // }
} }
Log.debug("======>>>>>>> subElement input type : " + classTypeLocal.getCanonicalName()); LOGGER.debug("======>>>>>>> subElement input type : " + classTypeLocal.getCanonicalName());
if (this.valueof == null) { if (this.valueof == null) {
if (StringSerializer.contains(classTypeLocal)) { if (StringSerializer.contains(classTypeLocal)) {
@ -908,9 +910,9 @@ public class IntrospectionModelComplex extends IntrospectionModel {
@Override @Override
public boolean hasTextModel() { public boolean hasTextModel() {
Log.warning("in {}", this.classType.getCanonicalName()); LOGGER.warn("in {}", this.classType.getCanonicalName());
for (final IntrospectionProperty prop : this.elements) { for (final IntrospectionProperty prop : this.elements) {
Log.warning(" check {}, manage={} cas setValue={} isText={}", prop.getBeanName(), prop.isManaged(), prop.canSetValue(), prop.isText()); LOGGER.warn(" check {}, manage={} cas setValue={} isText={}", prop.getBeanName(), prop.isManaged(), prop.canSetValue(), prop.isText());
final Boolean isText = prop.isText(); final Boolean isText = prop.isText();
if (isText != null && isText) { if (isText != null && isText) {
return true; return true;
@ -925,12 +927,12 @@ public class IntrospectionModelComplex extends IntrospectionModel {
} }
private void setValue(final Object data, final String beanName, final Object value, final boolean attributeIndependent) throws AknotException { private void setValue(final Object data, final String beanName, final Object value, final boolean attributeIndependent) throws AknotException {
Log.verbose(" Set value ='" + beanName + "' propertyValue='" + value + "' " + value.getClass().getCanonicalName()); LOGGER.trace(" Set value ='" + beanName + "' propertyValue='" + value + "' " + value.getClass().getCanonicalName());
{ {
// by default use setter to set the property // by default use setter to set the property
final IntrospectionProperty propMethode = findBeanNodeDescription(beanName, attributeIndependent); final IntrospectionProperty propMethode = findBeanNodeDescription(beanName, attributeIndependent);
if (propMethode != null && propMethode.canSetValue()) { if (propMethode != null && propMethode.canSetValue()) {
Log.verbose(" ==> find '" + Arrays.toString(propMethode.getNames()) + " type=" + propMethode.getType() + " sub-type=" + propMethode.getSubType()); LOGGER.trace(" ==> find '" + Arrays.toString(propMethode.getNames()) + " type=" + propMethode.getType() + " sub-type=" + propMethode.getSubType());
if (propMethode.getType().isAssignableFrom(value.getClass())) { if (propMethode.getType().isAssignableFrom(value.getClass())) {
propMethode.setExistingValue(data, value); propMethode.setExistingValue(data, value);
} else if (value instanceof List) { } else if (value instanceof List) {
@ -941,8 +943,8 @@ public class IntrospectionModelComplex extends IntrospectionModel {
final Object newData = ArraysTools.listToPrimitiveAuto(propMethode.getType().componentType(), tmpp); final Object newData = ArraysTools.listToPrimitiveAuto(propMethode.getType().componentType(), tmpp);
propMethode.setExistingValue(data, newData); propMethode.setExistingValue(data, newData);
} else { } else {
Log.verbose(" datas type: " + autoCast(propMethode.getType().componentType(), tmpp).getClass().getCanonicalName()); LOGGER.trace(" datas type: " + autoCast(propMethode.getType().componentType(), tmpp).getClass().getCanonicalName());
Log.verbose(" methode type: " + propMethode.getType().getCanonicalName()); LOGGER.trace(" methode type: " + propMethode.getType().getCanonicalName());
propMethode.setExistingValue(data, autoCast(propMethode.getType().componentType(), tmpp)); propMethode.setExistingValue(data, autoCast(propMethode.getType().componentType(), tmpp));
} }
} else if (tmpp.size() == 1) { } else if (tmpp.size() == 1) {
@ -981,7 +983,7 @@ public class IntrospectionModelComplex extends IntrospectionModel {
{ {
final IntrospectionProperty propField = findBeanPropertyDescription(beanName); final IntrospectionProperty propField = findBeanPropertyDescription(beanName);
if (propField != null && propField.canSetValue()) { if (propField != null && propField.canSetValue()) {
Log.verbose(" ==> find '" + Arrays.toString(propField.getNames()) + " type=" + propField.getType() + " sub-type=" + propField.getSubType()); LOGGER.trace(" ==> find '" + Arrays.toString(propField.getNames()) + " type=" + propField.getType() + " sub-type=" + propField.getSubType());
if (propField.getType().isAssignableFrom(value.getClass())) { if (propField.getType().isAssignableFrom(value.getClass())) {
propField.setExistingValue(data, value); propField.setExistingValue(data, value);
// Some specific case for primitives values // Some specific case for primitives values
@ -1032,8 +1034,8 @@ public class IntrospectionModelComplex extends IntrospectionModel {
final double[] datas = ArraysTools.listDoubleToPrimitive(tmpp); final double[] datas = ArraysTools.listDoubleToPrimitive(tmpp);
propField.setExistingValue(data, datas); propField.setExistingValue(data, datas);
} else { } else {
Log.verbose(" datas type: " + autoCast(propField.getType().componentType(), tmpp).getClass().getCanonicalName()); LOGGER.trace(" datas type: " + autoCast(propField.getType().componentType(), tmpp).getClass().getCanonicalName());
Log.verbose(" methode type: " + propField.getType().getCanonicalName()); LOGGER.trace(" methode type: " + propField.getType().getCanonicalName());
propField.setExistingValue(data, autoCast(propField.getType().componentType(), tmpp)); propField.setExistingValue(data, autoCast(propField.getType().componentType(), tmpp));
} }
} else if (tmpp.size() == 1) { } else if (tmpp.size() == 1) {

View File

@ -8,12 +8,14 @@ import java.util.Map.Entry;
import org.atriasoft.aknot.StringSerializer; import org.atriasoft.aknot.StringSerializer;
import org.atriasoft.aknot.exception.AknotException; import org.atriasoft.aknot.exception.AknotException;
import org.atriasoft.aknot.internal.Log;
import org.atriasoft.aknot.model.InterfaceFactoryAccess; import org.atriasoft.aknot.model.InterfaceFactoryAccess;
import org.atriasoft.aknot.model.IntrospectionPropertyGetter; import org.atriasoft.aknot.model.IntrospectionPropertyGetter;
import org.atriasoft.aknot.model.IntrospectionPropertySetter; import org.atriasoft.aknot.model.IntrospectionPropertySetter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class IntrospectionProperty { public final class IntrospectionProperty {
final static Logger LOGGER = LoggerFactory.getLogger(IntrospectionProperty.class);
// if the element is not managed by us (set at null while not define by a function attribute, parameter ...) // if the element is not managed by us (set at null while not define by a function attribute, parameter ...)
private Boolean managed = null; private Boolean managed = null;
// Case sensitive in parsing XML or not (set at null while not define by a function attribute, parameter ...) // Case sensitive in parsing XML or not (set at null while not define by a function attribute, parameter ...)
@ -118,18 +120,18 @@ public final class IntrospectionProperty {
if (this.caseSensitive) { if (this.caseSensitive) {
for (final String elem : this.names) { for (final String elem : this.names) {
if (elem.contentEquals(name)) { if (elem.contentEquals(name)) {
Log.verbose(" - '{}' ==> true", elem); LOGGER.trace(" - '{}' ==> true", elem);
return getType(); return getType();
} }
Log.verbose(" - '{}' == false", elem); LOGGER.trace(" - '{}' == false", elem);
} }
} else { } else {
for (final String elem : this.names) { for (final String elem : this.names) {
if (elem.equalsIgnoreCase(name)) { if (elem.equalsIgnoreCase(name)) {
Log.verbose(" - '{}' ==> true", elem); LOGGER.trace(" - '{}' ==> true", elem);
return getType(); return getType();
} }
Log.verbose(" - '{}' == false", elem); LOGGER.trace(" - '{}' == false", elem);
} }
} }
return null; return null;
@ -216,25 +218,25 @@ public final class IntrospectionProperty {
* @return true if the element is compatible, false otherwise * @return true if the element is compatible, false otherwise
*/ */
public boolean isCompatible(final String name) { public boolean isCompatible(final String name) {
Log.verbose("Check compatible : '{}' in {}", name, Arrays.toString(this.names)); LOGGER.trace("Check compatible : '{}' in {}", name, Arrays.toString(this.names));
final InterfaceFactoryAccess factoryGenerator = getFactory(); final InterfaceFactoryAccess factoryGenerator = getFactory();
if (factoryGenerator != null) { if (factoryGenerator != null) {
Log.verbose(" ===> Detect factory !!!!"); LOGGER.trace(" ===> Detect factory !!!!");
if (this.caseSensitive) { if (this.caseSensitive) {
for (final Entry<String, Class<?>> elem : factoryGenerator.getConversionMap().entrySet()) { for (final Entry<String, Class<?>> elem : factoryGenerator.getConversionMap().entrySet()) {
if (elem.getKey().contentEquals(name)) { if (elem.getKey().contentEquals(name)) {
Log.verbose(" + '{}' ==> true", elem.getKey()); LOGGER.trace(" + '{}' ==> true", elem.getKey());
return true; return true;
} }
Log.verbose(" + '{}' == false", elem.getKey()); LOGGER.trace(" + '{}' == false", elem.getKey());
} }
} else { } else {
for (final Entry<String, Class<?>> elem : factoryGenerator.getConversionMap().entrySet()) { for (final Entry<String, Class<?>> elem : factoryGenerator.getConversionMap().entrySet()) {
if (elem.getKey().equalsIgnoreCase(name)) { if (elem.getKey().equalsIgnoreCase(name)) {
Log.verbose(" + '{}' ==> true", elem.getKey()); LOGGER.trace(" + '{}' ==> true", elem.getKey());
return true; return true;
} }
Log.verbose(" + '{}' == false", elem.getKey()); LOGGER.trace(" + '{}' == false", elem.getKey());
} }
} }
return false; return false;
@ -242,18 +244,18 @@ public final class IntrospectionProperty {
if (this.caseSensitive) { if (this.caseSensitive) {
for (final String elem : this.names) { for (final String elem : this.names) {
if (elem.contentEquals(name)) { if (elem.contentEquals(name)) {
Log.verbose(" - '{}' ==> true", elem); LOGGER.trace(" - '{}' ==> true", elem);
return true; return true;
} }
Log.verbose(" - '{}' == false", elem); LOGGER.trace(" - '{}' == false", elem);
} }
} else { } else {
for (final String elem : this.names) { for (final String elem : this.names) {
if (elem.equalsIgnoreCase(name)) { if (elem.equalsIgnoreCase(name)) {
Log.verbose(" - '{}' ==> true", elem); LOGGER.trace(" - '{}' ==> true", elem);
return true; return true;
} }
Log.verbose(" - '{}' == false", elem); LOGGER.trace(" - '{}' == false", elem);
} }
} }
return false; return false;

View File

@ -5,15 +5,18 @@
*/ */
package test.atriasoft.aknot; package test.atriasoft.aknot;
import org.atriasoft.aknot.internal.Log;
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;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ExmlTestElement { public class ExmlTestElement {
final static Logger LOGGER = LoggerFactory.getLogger(ExmlTestElement.class);
@BeforeAll @BeforeAll
public static void beforeClass() { public static void beforeClass() {
Log.verbose("----------------------------------------------------------------"); LOGGER.trace("----------------------------------------------------------------");
} }
@Test @Test