diff --git a/.checkstyle b/.checkstyle
index 428926e..5783bc0 100644
--- a/.checkstyle
+++ b/.checkstyle
@@ -1,7 +1,7 @@
-
+
diff --git a/.classpath b/.classpath
index 3231f67..fc30a74 100644
--- a/.classpath
+++ b/.classpath
@@ -1,15 +1,22 @@
-
+
+
-
-
+
+
+
+
+
+
+
+
@@ -17,15 +24,10 @@
-
+
-
+
-
-
-
-
-
-
+
diff --git a/.project b/.project
index 993f532..eeb61ae 100644
--- a/.project
+++ b/.project
@@ -12,14 +12,26 @@
- net.sf.eclipsecs.core.CheckstyleBuilder
+ org.eclipse.ui.externaltools.ExternalToolBuilder
+ full,incremental,
+
+
+ LaunchConfigHandle
+ <project>/.externalToolBuilders/net.sf.eclipsecs.core.CheckstyleBuilder (2).launch
+
+
+
+
+ org.eclipse.m2e.core.maven2Builder
+ org.eclipse.m2e.core.maven2Nature
org.eclipse.jdt.core.javanature
net.sf.eclipsecs.core.CheckstyleNature
+ org.python.pydev.pythonNature
diff --git a/exml.iml b/exml.iml
deleted file mode 100644
index d47abfb..0000000
--- a/exml.iml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/lutin_org-atriasoft-exml.py b/lutin_org-atriasoft-exml.py
index 8092ade..e8d5444 100644
--- a/lutin_org-atriasoft-exml.py
+++ b/lutin_org-atriasoft-exml.py
@@ -40,7 +40,6 @@ def configure(target, my_module):
'src/org/atriasoft/exml/model/XmlNodeType.java',
'src/org/atriasoft/exml/model/XmlDeclaration.java',
'src/org/atriasoft/exml/model/XmlComment.java',
- 'src/org/atriasoft/exml/internal/Log.java',
'src/org/atriasoft/exml/annotation/ExmlAnnotation.java',
'src/org/atriasoft/exml/annotation/XmlDefaultManaged.java',
'src/org/atriasoft/exml/annotation/XmlDefaultOptional.java',
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..05a8175
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,127 @@
+
+ 4.0.0
+ org.atriasoft
+ exml
+ 0.1.0
+
+ 3.11.0
+ 20
+ 20
+
+
+
+
+ gitea
+ https://gitea.atria-soft.org/api/packages/jatria-soft/maven
+
+
+
+
+ gitea
+ https://gitea.atria-soft.org/api/packages/jatria-soft/maven
+
+
+ gitea
+ https://gitea.atria-soft.org/api/packages/jatria-soft/maven
+
+
+
+
+
+ jatria-soft
+ etk
+ 0.1.0
+
+
+ jatria-soft
+ aknot
+ 0.1.0
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ 5.9.3
+ test
+
+
+ org.slf4j
+ slf4j-simple
+ 2.0.7
+ test
+
+
+
+
+ src
+ test/src
+ ${project.basedir}/out/maven/
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ ${maven.compiler.version}
+
+ ${maven.compiler.source}
+ ${maven.compiler.target}
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+
+
+ attach-sources
+
+ jar
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 3.0.0-M5
+
+
+ maven-assembly-plugin
+
+
+
+ fully.qualified.MainClass
+
+
+
+ jar-with-dependencies
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.2.0
+
+ private
+ true
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.2.0
+
+ public
+
+
+
+
+
+
diff --git a/src/module-info.java b/src/module-info.java
index 1336a5a..29177aa 100644
--- a/src/module-info.java
+++ b/src/module-info.java
@@ -13,7 +13,6 @@ open module org.atriasoft.exml {
requires transitive org.atriasoft.etk;
requires transitive org.atriasoft.aknot;
- requires transitive org.atriasoft.reggol;
requires java.base;
}
diff --git a/src/org/atriasoft/exml/Exml.java b/src/org/atriasoft/exml/Exml.java
index 1684c61..a6e35b7 100644
--- a/src/org/atriasoft/exml/Exml.java
+++ b/src/org/atriasoft/exml/Exml.java
@@ -17,20 +17,24 @@ import org.atriasoft.exml.builder.BuilderGeneric;
import org.atriasoft.exml.exception.ExmlException;
import org.atriasoft.exml.exception.ExmlParserErrorMulti;
import org.atriasoft.exml.generator.GeneratorGeneric;
-import org.atriasoft.exml.internal.Log;
+
import org.atriasoft.exml.model.XmlElement;
import org.atriasoft.exml.model.XmlNode;
import org.atriasoft.exml.parser.ParseXml;
import org.atriasoft.exml.parser.ParsingProperty;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
public class Exml {
+ final static Logger LOGGER = LoggerFactory.getLogger(Exml.class);
/**
* Display the Document on console
*/
public static void display(final XmlElement node) {
final StringBuilder tmpp = new StringBuilder();
Exml.generate(node, tmpp);
- Log.info("Generated XML : \n" + tmpp.toString());
+ LOGGER.info("Generated XML : \n" + tmpp.toString());
}
/**
@@ -60,7 +64,7 @@ public class Exml {
e.printStackTrace();
}
if (elemData == null) {
- Log.error("Can not read the Stream : " + data);
+ LOGGER.error("Can not read the Stream : " + data);
return null;
}
final String dataToParse = new String(elemData);
@@ -82,7 +86,7 @@ public class Exml {
property.setDisplayError(true);
final byte[] elemData = Uri.getAllData(data);
if (elemData == null) {
- Log.error("Can not read the Stream : " + data);
+ LOGGER.error("Can not read the Stream : " + data);
return null;
}
final String dataToParse = new String(elemData);
diff --git a/src/org/atriasoft/exml/XmlMapper.java b/src/org/atriasoft/exml/XmlMapper.java
index 172a9a0..cdf28cf 100644
--- a/src/org/atriasoft/exml/XmlMapper.java
+++ b/src/org/atriasoft/exml/XmlMapper.java
@@ -16,11 +16,14 @@ import org.atriasoft.exml.exception.ExmlBuilderException;
import org.atriasoft.exml.exception.ExmlException;
import org.atriasoft.exml.exception.ExmlNodeDoesNotExist;
import org.atriasoft.exml.generator.GeneratorIntrospection;
-import org.atriasoft.exml.internal.Log;
+
import org.atriasoft.exml.parser.ParseXml;
import org.atriasoft.exml.parser.ParsingProperty;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class XmlMapper {
+ final static Logger LOGGER = LoggerFactory.getLogger(XmlMapper.class);
private static String readFile(final Path path, final Charset encoding) throws IOException {
final byte[] encoded = Files.readAllBytes(path);
@@ -53,7 +56,7 @@ public class XmlMapper {
e.printStackTrace();
}
if (elemData == null) {
- Log.error("Can not read the Stream : " + path);
+ LOGGER.error("Can not read the Stream : " + path);
return null;
}
final String dataToParse = new String(elemData);
@@ -113,7 +116,7 @@ public class XmlMapper {
final byte[] elemData = Uri.getAllData(uri);
if (elemData == null) {
- Log.error("Can not read the Stream : " + uri);
+ LOGGER.error("Can not read the Stream : " + uri);
return null;
}
final String content = new String(elemData);
diff --git a/src/org/atriasoft/exml/builder/Builder.java b/src/org/atriasoft/exml/builder/Builder.java
index b8672d6..ba2003a 100644
--- a/src/org/atriasoft/exml/builder/Builder.java
+++ b/src/org/atriasoft/exml/builder/Builder.java
@@ -6,10 +6,14 @@
package org.atriasoft.exml.builder;
import org.atriasoft.aknot.exception.AknotException;
+import org.atriasoft.exml.Exml;
import org.atriasoft.exml.exception.ExmlBuilderException;
import org.atriasoft.exml.exception.ExmlException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public interface Builder {
+ final static Logger LOGGER = LoggerFactory.getLogger(Builder.class);
/**
* Detect the end of the element : {@code}
diff --git a/src/org/atriasoft/exml/builder/BuilderGeneric.java b/src/org/atriasoft/exml/builder/BuilderGeneric.java
index a540c50..a16830f 100644
--- a/src/org/atriasoft/exml/builder/BuilderGeneric.java
+++ b/src/org/atriasoft/exml/builder/BuilderGeneric.java
@@ -13,8 +13,11 @@ import org.atriasoft.exml.model.XmlComment;
import org.atriasoft.exml.model.XmlDeclaration;
import org.atriasoft.exml.model.XmlElement;
import org.atriasoft.exml.model.XmlText;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class BuilderGeneric implements Builder {
+ final static Logger LOGGER = LoggerFactory.getLogger(BuilderGeneric.class);
@Override
public void endElement(final Object element) {
diff --git a/src/org/atriasoft/exml/builder/BuilderIntrospection.java b/src/org/atriasoft/exml/builder/BuilderIntrospection.java
index 3bab5d8..3cb43db 100644
--- a/src/org/atriasoft/exml/builder/BuilderIntrospection.java
+++ b/src/org/atriasoft/exml/builder/BuilderIntrospection.java
@@ -13,9 +13,12 @@ import org.atriasoft.exml.exception.ExmlAttributeDoesNotExist;
import org.atriasoft.exml.exception.ExmlBuilderException;
import org.atriasoft.exml.exception.ExmlException;
import org.atriasoft.exml.exception.ExmlNodeDoesNotExist;
-import org.atriasoft.exml.internal.Log;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class BuilderIntrospection implements Builder {
+ final static Logger LOGGER = LoggerFactory.getLogger(BuilderIntrospection.class);
// Keep in cach all the object alredy parsed ==> optimize CPU
CacheIntrospectionModel cacheModel = new CacheIntrospectionModel();
// The root class (need to keep it if we use 2 time the builder, the root class is no more accessible).
@@ -24,7 +27,8 @@ public class BuilderIntrospection implements Builder {
final InterfaceFactoryAccess factory;
public BuilderIntrospection(final InterfaceFactoryAccess factory) throws ExmlException, AknotException {
- Log.critical("is it used ????");
+ LOGGER.error("[CRITICAL] is it used ????");
+ System.exit(-50);
this.factory = factory;
this.rootNodeName = null;
this.rootClassType = null;
@@ -41,7 +45,8 @@ public class BuilderIntrospection implements Builder {
}
public BuilderIntrospection(final ModelType model, final Class> classType, final String rootNodeName) throws ExmlException, AknotException {
- Log.critical("is it used ????");
+ LOGGER.error("is it used ????");
+ System.exit(-50);
this.factory = null;
this.rootNodeName = rootNodeName;
this.rootClassType = classType;
@@ -50,7 +55,7 @@ public class BuilderIntrospection implements Builder {
@Override
public void endElement(final Object element) throws ExmlBuilderException, AknotException {
- Log.verbose("End of Element: {}", element);
+ LOGGER.trace("End of Element: {}", element);
if (element == null) {
return;
}
@@ -90,7 +95,7 @@ public class BuilderIntrospection implements Builder {
if (parent == null) {
return null;
}
- Log.verbose("new element on NodeName=" + nodeName);
+ LOGGER.trace("new element on NodeName=" + nodeName);
final IntrospectionObject introspectionObject = (IntrospectionObject) parent;
final IntrospectionModel model = introspectionObject.getModelIntrospection();
Class> typeClass = null;
@@ -107,7 +112,7 @@ public class BuilderIntrospection implements Builder {
typeClass = model.getClassType();
} else {
if (!introspectionObject.isSubNodeOrPropertyExist(nodeName) && model.isIgnoreUnknown()) {
- Log.debug("Ignore node: '" + nodeName + "' Does not exist...");
+ LOGGER.debug("Ignore node: '" + nodeName + "' Does not exist...");
return null;
}
try {
@@ -121,7 +126,7 @@ public class BuilderIntrospection implements Builder {
// specific case for List ==> need to get the subType in introspection ...
if (typeClass.isArray()) {
final Class> subTypeClass = typeClass.getComponentType();
- Log.verbose("Create array new 'SUB' class: '" + typeClass.getCanonicalName() + "' for node '" + nodeName + "'");
+ LOGGER.trace("Create array new 'SUB' class: '" + typeClass.getCanonicalName() + "' for node '" + nodeName + "'");
IntrospectionModel inferData = null;
if (listTreeName == null) {
inferData = this.cacheModel.findOrCreate(ModelType.NORMAL, null, subTypeClass);
@@ -139,7 +144,7 @@ public class BuilderIntrospection implements Builder {
} catch (final AknotException e) {
throw new ExmlNodeDoesNotExist("Node does not exist: " + e.getMessage());
}
- Log.verbose("Create List new 'SUB' class: '" + typeClass.getCanonicalName() + "' for node '" + nodeName + "'");
+ LOGGER.trace("Create List new 'SUB' class: '" + typeClass.getCanonicalName() + "' for node '" + nodeName + "'");
IntrospectionModel inferData = null;
if (listTreeName == null) {
inferData = this.cacheModel.findOrCreate(ModelType.NORMAL, null, subTypeClass);
@@ -149,7 +154,7 @@ public class BuilderIntrospection implements Builder {
// Create the data when object is ended created...
return new IntrospectionObject(inferData);
}
- Log.verbose("Create new class: '" + typeClass.getCanonicalName() + "' for node '" + nodeName + "'");
+ LOGGER.trace("Create new class: '" + typeClass.getCanonicalName() + "' for node '" + nodeName + "'");
final IntrospectionModel inferData = this.cacheModel.findOrCreate(ModelType.NORMAL, listTreeName, typeClass);
// Create the data when object is ended created...
return new IntrospectionObject(inferData);
@@ -160,7 +165,7 @@ public class BuilderIntrospection implements Builder {
@Override
public void newElementFinished(final Object parent, final String tmpName, final Object element) throws ExmlException, AknotException {
- Log.debug("new element fionished : ==> " + tmpName);
+ LOGGER.debug("new element fionished : ==> " + tmpName);
if (parent == null || element == null) {
return;
}
@@ -198,7 +203,7 @@ public class BuilderIntrospection implements Builder {
final String beanName = model.getBeanName(propertyName);
if (beanName == null) {
if (model.isIgnoreUnknown()) {
- Log.debug("Ignore node : '" + propertyName + "'");
+ LOGGER.debug("Ignore node : '" + propertyName + "'");
return;
}
throw new ExmlAttributeDoesNotExist("The node '" + propertyName + "' Does not exist...");
@@ -223,7 +228,7 @@ public class BuilderIntrospection implements Builder {
} else if (List.class.isAssignableFrom(typeClass)) {
final String[] elems = propertyValue.split(";");
final Class> subTypeClass = introspectionObject.getTypeOfSubProperty(propertyName);
- Log.verbose("Create List new 'SUB' class: '" + typeClass.getCanonicalName() + "' for property '" + propertyName + "'");
+ LOGGER.trace("Create List new 'SUB' class: '" + typeClass.getCanonicalName() + "' for property '" + propertyName + "'");
final IntrospectionModel inferData = this.cacheModel.findOrCreate(ModelType.NORMAL, null, subTypeClass);
final List