diff --git a/src/org/atriasoft/island/model/Volatile.java b/src/org/atriasoft/island/model/Volatile.java index 6da9995..2eda317 100644 --- a/src/org/atriasoft/island/model/Volatile.java +++ b/src/org/atriasoft/island/model/Volatile.java @@ -1,27 +1,31 @@ package org.atriasoft.island.model; -import org.atriasoft.exml.annotation.XmlDefaultAttibute; -import org.atriasoft.exml.annotation.XmlName; +import org.atriasoft.aknot.annotation.AknotName; +import org.atriasoft.aknot.annotation.AknotDefaultAttribute; -@XmlDefaultAttibute +@AknotDefaultAttribute public class Volatile { private String address; private String path; - @XmlName({"address", "path"}) + @AknotName({ "address", "path" }) public Volatile(final String gitAddress, final String path) { this.address = gitAddress; this.path = path; } + public String getAddress() { return this.address; } - public void setAddress(final String gitAddress) { - this.address = gitAddress; - } + public String getPath() { return this.path; } + + public void setAddress(final String gitAddress) { + this.address = gitAddress; + } + public void setPath(final String path) { this.path = path; } diff --git a/src/org/atriasoft/island/model/manifest/Artifactory.java b/src/org/atriasoft/island/model/manifest/Artifactory.java index b26f57c..f63e720 100644 --- a/src/org/atriasoft/island/model/manifest/Artifactory.java +++ b/src/org/atriasoft/island/model/manifest/Artifactory.java @@ -1,50 +1,31 @@ package org.atriasoft.island.model.manifest; -import org.atriasoft.exml.annotation.XmlDefaultAttibute; -import org.atriasoft.exml.annotation.XmlName; +import org.atriasoft.aknot.annotation.AknotName; +import org.atriasoft.aknot.annotation.AknotDefaultAttribute; -@XmlDefaultAttibute +@AknotDefaultAttribute public class Artifactory { private String name; // Local name of the remote. private String fetch; // Address to fetch. private String type; // type of artifactory (default maven to update later ...) - - @XmlName({"name", "fetch", "type"}) - public Artifactory(final String name, final String fetch, final String type) { - this.name = name; - this.fetch = fetch; - this.type = type; - } - @XmlName({"name", "fetch"}) - public Artifactory(final String name, final String fetch) { - this.name = name; - this.fetch = fetch; - this.type = "maven"; - } + public Artifactory() { this.name = ""; this.fetch = ""; this.type = "maven"; } - public String getName() { - return this.name; - } - public void setName(final String name) { + @AknotName({ "name", "fetch" }) + public Artifactory(final String name, final String fetch) { this.name = name; + this.fetch = fetch; + this.type = "maven"; } - public String getFetch() { - return this.fetch; - } - public void setFetch(final String fetch) { + @AknotName({ "name", "fetch", "type" }) + public Artifactory(final String name, final String fetch, final String type) { + this.name = name; this.fetch = fetch; - } - - public String getType() { - return this.type; - } - public void setType(final String type) { this.type = type; } @@ -54,5 +35,28 @@ public class Artifactory { return new Artifactory(this.name, this.fetch, this.type); } + public String getFetch() { + return this.fetch; + } + + public String getName() { + return this.name; + } + + public String getType() { + return this.type; + } + + public void setFetch(final String fetch) { + this.fetch = fetch; + } + + public void setName(final String name) { + this.name = name; + } + + public void setType(final String type) { + this.type = type; + } } \ No newline at end of file diff --git a/src/org/atriasoft/island/model/manifest/ConfigManifest.java b/src/org/atriasoft/island/model/manifest/ConfigManifest.java index fa54ffa..d8d2fd9 100644 --- a/src/org/atriasoft/island/model/manifest/ConfigManifest.java +++ b/src/org/atriasoft/island/model/manifest/ConfigManifest.java @@ -6,106 +6,26 @@ import java.util.ArrayList; import java.util.List; import java.util.ListIterator; +import org.atriasoft.aknot.annotation.AknotList; +import org.atriasoft.aknot.annotation.AknotName; import org.atriasoft.exml.Exml; -import org.atriasoft.exml.annotation.XmlList; -import org.atriasoft.exml.annotation.XmlName; import org.atriasoft.exml.exception.ExmlBuilderException; import org.atriasoft.exml.exception.ExmlException; import org.atriasoft.island.Env; import org.atriasoft.island.internal.Log; import org.atriasoft.island.model.Volatile; + public class ConfigManifest { - private String repo = ""; - private String branch = "master"; - private String manifestName = "default.xml"; - private List volatiles = new ArrayList<>(); - private List links = new ArrayList<>(); - - public ConfigManifest() { - } - - public String getRepo() { - return this.repo; - } - public void setRepo(final String repo) { - this.repo = repo; - } - public String getBranch() { - return this.branch; - } - public void setBranch(final String branch) { - this.branch = branch; - } - @XmlName(value="manifest-name") - public String getManifestName() { - return this.manifestName; - } - public void setManifestName(final String manifestName) { - this.manifestName = manifestName; - } - @XmlList(value="volatile") - public List getVolatiles() { - return this.volatiles; - } - public void setVolatiles(final List volatiles) { - this.volatiles = volatiles; - } - public void addVolatile(final String gitAddress, final String path) { - rmVolatile(path); - this.volatiles.add(new Volatile(gitAddress, path)); - } - public void rmVolatile(final String path) { - ListIterator it = this.volatiles.listIterator(); - while (it.hasNext()) { - Volatile elem = it.next(); - if (elem.getPath().equals(path)) { - it.remove(); - } - } - } - public boolean existVolatile(final String path) { - ListIterator it = this.volatiles.listIterator(); - while (it.hasNext()) { - Volatile elem = it.next(); - if (elem.getPath().equals(path)) { - return true; - } - } - return false; - } - @XmlList(value="link") - public List getLinks() { - return this.links; - } - public void setLinks(final List curentLink) { - this.links = curentLink; - } - public void addLink(final String source, final String destination) { - rmLink(destination); - this.links.add(new Link(source, destination)); - } - private void rmLink(final String destination) { - ListIterator it = this.links.listIterator(); - while (it.hasNext()) { - Link elem = it.next(); - if (elem.getDestination().equals(destination)) { - it.remove(); - } - } - } - public static ConfigManifest load() { return ConfigManifest.load(Env.getIslandPathConfig()); } + public static ConfigManifest load(final Path path) { ConfigManifest[] root = null; try { root = Exml.parse(path, ConfigManifest.class, "config-island"); - } catch (ExmlBuilderException e) { - Log.error("Can not parse the file.1. " + path); - e.printStackTrace(); - } catch (ExmlException e) { + } catch (final ExmlException e) { Log.error("Can not parse the file.1. " + path); e.printStackTrace(); } @@ -114,34 +34,32 @@ public class ConfigManifest { } return root[0]; } - public void store() { - try { - store(Env.getIslandPathConfig()); - } catch (ExmlBuilderException e) { - Log.error("Can not store the configuration ... "); - e.printStackTrace(); - } + + private String repo = ""; + private String branch = "master"; + private String manifestName = "default.xml"; + + private List volatiles = new ArrayList<>(); + + private List links = new ArrayList<>(); + + public ConfigManifest() {} + + public void addLink(final String source, final String destination) { + rmLink(destination); + this.links.add(new Link(source, destination)); } - public void store(final Path path) throws ExmlBuilderException { - try { - Exml.store(path, this, "config-island"); - } catch (ExmlException ex) { - Log.warning("detect throw: " + ex.getMessage()); - ex.printStackTrace(); - } catch (IOException ex) { - Log.warning("detect throw: " + ex.getMessage()); - ex.printStackTrace(); - } + + public void addVolatile(final String gitAddress, final String path) { + rmVolatile(path); + this.volatiles.add(new Volatile(gitAddress, path)); } - + public String createAdressGitRepo(final String fetch, final String name) { // check if it is a directAdress: - if (fetch.startsWith("git@") - || fetch.startsWith("http://") - || fetch.startsWith("https://")) { - if (fetch.startsWith("git@") - && fetch.substring(4).split(":").length <= 1) { + if (fetch.startsWith("git@") || fetch.startsWith("http://") || fetch.startsWith("https://")) { + if (fetch.startsWith("git@") && fetch.substring(4).split(":").length <= 1) { return fetch + ":" + name; } return fetch + "/" + name; @@ -152,7 +70,7 @@ public class ConfigManifest { while (offsetFetch.startsWith("..")) { if (offsetFetch.startsWith("../")) { offsetFetch = offsetFetch.substring(3); - } else if (offsetFetch.equals("..")){ + } else if (offsetFetch.equals("..")) { offsetFetch = offsetFetch.substring(2); } else { break; @@ -170,8 +88,100 @@ public class ConfigManifest { return addressManifest + offsetFetch + name; } - + + public boolean existVolatile(final String path) { + final ListIterator it = this.volatiles.listIterator(); + while (it.hasNext()) { + final Volatile elem = it.next(); + if (elem.getPath().equals(path)) { + return true; + } + } + return false; + } + + public String getBranch() { + return this.branch; + } + + @AknotList(value = "link") + public List getLinks() { + return this.links; + } + public ProjectConfig getManifestConfig() { return new ProjectConfig("manifest", Env.getIslandPathManifest().resolve(getManifestName()).toString()); } + + @AknotName(value = "manifest-name") + public String getManifestName() { + return this.manifestName; + } + + public String getRepo() { + return this.repo; + } + + @AknotList(value = "volatile") + public List getVolatiles() { + return this.volatiles; + } + + private void rmLink(final String destination) { + final ListIterator it = this.links.listIterator(); + while (it.hasNext()) { + final Link elem = it.next(); + if (elem.getDestination().equals(destination)) { + it.remove(); + } + } + } + + public void rmVolatile(final String path) { + final ListIterator it = this.volatiles.listIterator(); + while (it.hasNext()) { + final Volatile elem = it.next(); + if (elem.getPath().equals(path)) { + it.remove(); + } + } + } + + public void setBranch(final String branch) { + this.branch = branch; + } + + public void setLinks(final List curentLink) { + this.links = curentLink; + } + + public void setManifestName(final String manifestName) { + this.manifestName = manifestName; + } + + public void setRepo(final String repo) { + this.repo = repo; + } + + public void setVolatiles(final List volatiles) { + this.volatiles = volatiles; + } + + public void store() { + try { + store(Env.getIslandPathConfig()); + } catch (final ExmlBuilderException e) { + Log.error("Can not store the configuration ... "); + e.printStackTrace(); + } + } + + public void store(final Path path) throws ExmlBuilderException { + try { + Exml.store(path, this, "config-island"); + } catch (final ExmlException | IOException ex) { + Log.warning("detect throw: " + ex.getMessage()); + ex.printStackTrace(); + } + } } \ No newline at end of file diff --git a/src/org/atriasoft/island/model/manifest/Dependency.java b/src/org/atriasoft/island/model/manifest/Dependency.java index 5e12749..f935c94 100644 --- a/src/org/atriasoft/island/model/manifest/Dependency.java +++ b/src/org/atriasoft/island/model/manifest/Dependency.java @@ -1,29 +1,30 @@ package org.atriasoft.island.model.manifest; -import org.atriasoft.exml.annotation.XmlDefaultAttibute; -import org.atriasoft.exml.annotation.XmlName; -import org.atriasoft.exml.annotation.XmlOptional; +import org.atriasoft.aknot.annotation.AknotName; +import org.atriasoft.aknot.annotation.AknotOptional; +import org.atriasoft.aknot.annotation.AknotDefaultAttribute; -@XmlDefaultAttibute -public record Dependency ( - String org, - String name, - @XmlOptional String revision, - @XmlOptional String remote) { // TODO this is a big mistake for xml , can not parse multiple type... use @XmlOptionnal(nullDefaultValue=true) - - @XmlName({"org", "name", "rev", "remote"}) +@AknotDefaultAttribute +public record Dependency( + String org, + String name, + @AknotOptional String revision, + @AknotOptional String remote) { // TODO this is a big mistake for xml , can not parse multiple type... use @XmlOptionnal(nullDefaultValue=true) + + @AknotName({ "org", "name", "rev", "remote" }) public Dependency(final String org, final String name, final String revision, final String remote) { this.org = org; this.name = name; this.revision = revision; - this.remote = remote==null?"default":remote; + this.remote = remote == null ? "default" : remote; } - @XmlName({"org", "name", "rev"}) + + @AknotName({ "org", "name", "rev" }) public Dependency(final String org, final String name, final String revision) { this(org, name, revision, null); } - @XmlName({"org", "name"}) + @AknotName({ "org", "name" }) public Dependency(final String org, final String name) { this(org, name, null, null); } diff --git a/src/org/atriasoft/island/model/manifest/Link.java b/src/org/atriasoft/island/model/manifest/Link.java index ea3c01d..9902f1b 100644 --- a/src/org/atriasoft/island/model/manifest/Link.java +++ b/src/org/atriasoft/island/model/manifest/Link.java @@ -1,8 +1,8 @@ package org.atriasoft.island.model.manifest; -import org.atriasoft.exml.annotation.XmlDefaultAttibute; +import org.atriasoft.aknot.annotation.AknotDefaultAttribute; -@XmlDefaultAttibute +@AknotDefaultAttribute public class Link { private String source; private String destination; diff --git a/src/org/atriasoft/island/model/manifest/ManifestFile.java b/src/org/atriasoft/island/model/manifest/ManifestFile.java index 964ebdb..2569bd8 100644 --- a/src/org/atriasoft/island/model/manifest/ManifestFile.java +++ b/src/org/atriasoft/island/model/manifest/ManifestFile.java @@ -4,12 +4,12 @@ import java.nio.file.Path; import java.util.ArrayList; import java.util.List; -import org.atriasoft.exml.annotation.XmlIgnoreUnknow; -import org.atriasoft.exml.annotation.XmlList; -import org.atriasoft.exml.annotation.XmlManaged; -import org.atriasoft.exml.annotation.XmlName; +import org.atriasoft.aknot.annotation.AknotIgnoreUnknown; +import org.atriasoft.aknot.annotation.AknotList; +import org.atriasoft.aknot.annotation.AknotManaged; +import org.atriasoft.aknot.annotation.AknotName; -@XmlIgnoreUnknow +@AknotIgnoreUnknown public class ManifestFile { private Path fileRealPath = null; private List projects = new ArrayList<>(); @@ -20,28 +20,28 @@ public class ManifestFile { private OptionRepository options = null; private List links = new ArrayList<>(); - @XmlName("artefactory") + @AknotName("artefactory") public List getArtefactories() { return this.artefactories; } - @XmlName(value = "dependencies") - @XmlList(value = "dependency") + @AknotName(value = "dependencies") + @AknotList(value = "dependency") public List getDependencies() { return this.dependencies; } - @XmlManaged(false) + @AknotManaged(false) public Path getFileRealPath() { return this.fileRealPath; } - @XmlName(value = "include") + @AknotName(value = "include") public List getIncludes() { return this.includes; } - @XmlName(value = "link") + @AknotName(value = "link") public List getLinks() { return this.links; } @@ -50,12 +50,12 @@ public class ManifestFile { return this.options; } - @XmlName(value = "project") + @AknotName(value = "project") public List getProjects() { return this.projects; } - @XmlName(value = "remote") + @AknotName(value = "remote") public List getRemotes() { return this.remotes; } diff --git a/src/org/atriasoft/island/model/manifest/MirrorConfig.java b/src/org/atriasoft/island/model/manifest/MirrorConfig.java index 72b29d6..ca31f27 100644 --- a/src/org/atriasoft/island/model/manifest/MirrorConfig.java +++ b/src/org/atriasoft/island/model/manifest/MirrorConfig.java @@ -1,30 +1,33 @@ package org.atriasoft.island.model.manifest; -import org.atriasoft.exml.annotation.XmlDefaultAttibute; -import org.atriasoft.exml.annotation.XmlName; +import org.atriasoft.aknot.annotation.AknotName; +import org.atriasoft.aknot.annotation.AknotDefaultAttribute; -@XmlDefaultAttibute +@AknotDefaultAttribute public class MirrorConfig { private String name; private String fetch; - - @XmlName({"name", "fetch"}) + + @AknotName({ "name", "fetch" }) public MirrorConfig(final String name, final String fetch) { this.name = name; this.fetch = fetch; } - public String getName() { - return this.name; - } - public void setName(final String name) { - this.name = name; - } + public String getFetch() { return this.fetch; } + + public String getName() { + return this.name; + } + public void setFetch(final String fetch) { this.fetch = fetch; } - + + public void setName(final String name) { + this.name = name; + } } \ No newline at end of file diff --git a/src/org/atriasoft/island/model/manifest/OptionRepository.java b/src/org/atriasoft/island/model/manifest/OptionRepository.java index 39295e0..de81639 100644 --- a/src/org/atriasoft/island/model/manifest/OptionRepository.java +++ b/src/org/atriasoft/island/model/manifest/OptionRepository.java @@ -1,6 +1,6 @@ package org.atriasoft.island.model.manifest; -import org.atriasoft.exml.annotation.XmlName; +import org.atriasoft.aknot.annotation.AknotName; public class OptionRepository { private String branchRelease; @@ -10,7 +10,6 @@ public class OptionRepository { private String defaultRemote; private boolean synchronizeSubmodule; - public OptionRepository() { this.branchRelease = "master"; this.branchDevelop = "dev"; @@ -19,7 +18,9 @@ public class OptionRepository { this.defaultRemote = "origin"; this.synchronizeSubmodule = false; } - public OptionRepository(final String branchRelease, final String branchDevelop, final DeliverMode deliverMode, final String defaultBranch, final String defaultRemote, final boolean synchronizeSubmodule) { + + public OptionRepository(final String branchRelease, final String branchDevelop, final DeliverMode deliverMode, final String defaultBranch, final String defaultRemote, + final boolean synchronizeSubmodule) { this.branchRelease = branchRelease; this.branchDevelop = branchDevelop; this.deliverMode = deliverMode; @@ -27,65 +28,71 @@ public class OptionRepository { this.defaultRemote = defaultRemote; this.synchronizeSubmodule = synchronizeSubmodule; } - @XmlName(value="branch-release") - public String getBranchRelease() { - return this.branchRelease; - } - public void setBranchRelease(final String branchRelease) { - this.branchRelease = branchRelease; + + @Override + public OptionRepository clone() { + // TODO Auto-generated method stub + return new OptionRepository(this.branchRelease, this.branchDevelop, this.deliverMode, this.defaultBranch, this.defaultRemote, this.synchronizeSubmodule); } - @XmlName(value="branch-develop") + @AknotName(value = "branch-develop") public String getBranchDevelop() { return this.branchDevelop; } + + @AknotName(value = "branch-release") + public String getBranchRelease() { + return this.branchRelease; + } + + @AknotName(value = "default-branch") + public String getDefaultBranch() { + return this.defaultBranch; + } + + @AknotName(value = "default-remote") + public String getDefaultRemote() { + return this.defaultRemote; + } + + @AknotName(value = "deliver-mode") + public DeliverMode getDeliverMode() { + return this.deliverMode; + } + + @AknotName(value = "synchronize-submodule") + public boolean isSynchronizeSubmodule() { + return this.synchronizeSubmodule; + } + public void setBranchDevelop(final String branchDevelop) { this.branchDevelop = branchDevelop; } - @XmlName(value="deliver-mode") - public DeliverMode getDeliverMode() { - return this.deliverMode; - } - public void setDeliverMode(final DeliverMode deliverMode) { - this.deliverMode = deliverMode; + public void setBranchRelease(final String branchRelease) { + this.branchRelease = branchRelease; } - @XmlName(value="default-branch") - public String getDefaultBranch() { - return this.defaultBranch; - } public void setDefaultBranch(final String defaultBranch) { this.defaultBranch = defaultBranch; } - @XmlName(value="default-remote") - public String getDefaultRemote() { - return this.defaultRemote; - } public void setDefaultRemote(final String defaultRemote) { this.defaultRemote = defaultRemote; } - @XmlName(value="synchronize-submodule") - public boolean isSynchronizeSubmodule() { - return this.synchronizeSubmodule; + public void setDeliverMode(final DeliverMode deliverMode) { + this.deliverMode = deliverMode; } + public void setSynchronizeSubmodule(final boolean downloadSubmodule) { this.synchronizeSubmodule = downloadSubmodule; } - @Override - public OptionRepository clone() { - // TODO Auto-generated method stub - return new OptionRepository( this.branchRelease, this.branchDevelop, this.deliverMode, this.defaultBranch, this.defaultRemote, this.synchronizeSubmodule); - } @Override public String toString() { - return "OptionRepository [branchRelease=" + this.branchRelease + ", branchDevelop=" + this.branchDevelop + ", deliverMode=" + this.deliverMode + ", defaultBranch=" + this.defaultBranch + ", defaultRemote=" - + this.defaultRemote + ", synchronizeSubmodule=" + this.synchronizeSubmodule + "]"; + return "OptionRepository [branchRelease=" + this.branchRelease + ", branchDevelop=" + this.branchDevelop + ", deliverMode=" + this.deliverMode + ", defaultBranch=" + this.defaultBranch + + ", defaultRemote=" + this.defaultRemote + ", synchronizeSubmodule=" + this.synchronizeSubmodule + "]"; } - - } diff --git a/src/org/atriasoft/island/model/manifest/ProjectConfig.java b/src/org/atriasoft/island/model/manifest/ProjectConfig.java index 163dc4b..053850c 100644 --- a/src/org/atriasoft/island/model/manifest/ProjectConfig.java +++ b/src/org/atriasoft/island/model/manifest/ProjectConfig.java @@ -3,12 +3,12 @@ package org.atriasoft.island.model.manifest; import java.util.ArrayList; import java.util.List; -import org.atriasoft.exml.annotation.XmlDefaultAttibute; -import org.atriasoft.exml.annotation.XmlManaged; -import org.atriasoft.exml.annotation.XmlName; -import org.atriasoft.exml.annotation.XmlOptional; +import org.atriasoft.aknot.annotation.AknotManaged; +import org.atriasoft.aknot.annotation.AknotName; +import org.atriasoft.aknot.annotation.AknotOptional; +import org.atriasoft.aknot.annotation.AknotDefaultAttribute; -@XmlDefaultAttibute +@AknotDefaultAttribute public class ProjectConfig { private String name; private String path; @@ -17,7 +17,7 @@ public class ProjectConfig { private boolean volatileElement = false; private List remotes = new ArrayList<>(); RemoteConfig selectRemotes = null; - + // TODO remove this when Xml parser is ready ... public ProjectConfig() { this.name = null; @@ -25,72 +25,87 @@ public class ProjectConfig { this.tag = null; this.branch = null; } - @XmlName({"name", "path"}) + + @AknotName({ "name", "path" }) public ProjectConfig(final String name, final String path) { this.name = name; this.path = path; this.tag = null; this.branch = null; } - @XmlName({"name", "path", "branch"}) + + @AknotName({ "name", "path", "branch" }) public ProjectConfig(final String name, final String path, final String branch) { this.name = name; this.path = path; this.tag = null; this.tag = branch; } - public String getName() { - return this.name; - } - public void setName(final String name) { - this.name = name; - } - public String getPath() { - return this.path; - } - public void setPath(final String path) { - this.path = path; - } - @XmlOptional - public String getTag() { - return this.tag; - } - public void setTag(final String tag) { - this.tag = tag; - } - - @XmlOptional - public void setBranch(final String branch) { - this.branch = branch; - } + public String getBranch() { return this.branch; } - - @XmlManaged(false) + + public String getName() { + return this.name; + } + + public String getPath() { + return this.path; + } + + @AknotManaged(false) public List getRemotes() { return this.remotes; } - public void setRemotes(final List remotes) { - this.remotes = remotes; - } - - @XmlManaged(false) + + @AknotManaged(false) public RemoteConfig getSelectRemotes() { return this.selectRemotes; } - public void setSelectRemotes(final RemoteConfig selectRemotes) { - this.selectRemotes = selectRemotes; + + @AknotOptional + public String getTag() { + return this.tag; } - @XmlManaged(false) + + @AknotManaged(false) public boolean isVolatile() { return this.volatileElement; } + + @AknotOptional + public void setBranch(final String branch) { + this.branch = branch; + } + + public void setName(final String name) { + this.name = name; + } + + public void setPath(final String path) { + this.path = path; + } + + public void setRemotes(final List remotes) { + this.remotes = remotes; + } + + public void setSelectRemotes(final RemoteConfig selectRemotes) { + this.selectRemotes = selectRemotes; + } + + public void setTag(final String tag) { + this.tag = tag; + } + public void setVolatile(final boolean volatileElement) { this.volatileElement = volatileElement; } + @Override public String toString() { - return "ProjectConfig [name=" + this.name + ", path=" + this.path + ", tag=" + this.tag +", branch=" + this.branch + ", volatileElement=" + this.volatileElement + ", remotes=" + this.remotes + ", selectRemotes=" + this.selectRemotes + "]"; + return "ProjectConfig [name=" + this.name + ", path=" + this.path + ", tag=" + this.tag + ", branch=" + this.branch + ", volatileElement=" + this.volatileElement + ", remotes=" + this.remotes + + ", selectRemotes=" + this.selectRemotes + "]"; } } \ No newline at end of file diff --git a/src/org/atriasoft/island/model/manifest/RemoteConfig.java b/src/org/atriasoft/island/model/manifest/RemoteConfig.java index 7146928..b5141bf 100644 --- a/src/org/atriasoft/island/model/manifest/RemoteConfig.java +++ b/src/org/atriasoft/island/model/manifest/RemoteConfig.java @@ -3,62 +3,67 @@ package org.atriasoft.island.model.manifest; import java.util.ArrayList; import java.util.List; -import org.atriasoft.exml.annotation.XmlAttribute; -import org.atriasoft.exml.annotation.XmlDefaultAttibute; -import org.atriasoft.exml.annotation.XmlName; -import org.atriasoft.exml.annotation.XmlOptional; +import org.atriasoft.aknot.annotation.AknotName; +import org.atriasoft.aknot.annotation.AknotOptional; +import org.atriasoft.aknot.annotation.AknotAttribute; +import org.atriasoft.aknot.annotation.AknotDefaultAttribute; -@XmlDefaultAttibute +@AknotDefaultAttribute public class RemoteConfig { private String name; // Local name of the remote. private String fetch; // Address to fetch. private boolean sync = true; // Need to sync the submodule. List mirror; // List of all mirror available. - - @XmlName({"name", "fetch", "mirror"}) - public RemoteConfig(final String name, final String fetch, final List mirror) { - this.name = name; - this.fetch = fetch; - this.mirror = mirror; - } + public RemoteConfig() { this.name = ""; this.fetch = ""; this.mirror = new ArrayList<>(); } - public String getName() { - return this.name; - } - public void setName(final String name) { + @AknotName({ "name", "fetch", "mirror" }) + public RemoteConfig(final String name, final String fetch, final List mirror) { this.name = name; - } - - public String getFetch() { - return this.fetch; - } - public void setFetch(final String fetch) { this.fetch = fetch; - } - - @XmlAttribute(false) - public List getMirror() { - return this.mirror; - } - public void setMirror(final List mirror) { this.mirror = mirror; } + @Override public RemoteConfig clone() { // TODO Auto-generated method stub return new RemoteConfig(this.name, this.fetch, new ArrayList<>(this.mirror)); } - @XmlOptional + public String getFetch() { + return this.fetch; + } + + @AknotAttribute(false) + public List getMirror() { + return this.mirror; + } + + public String getName() { + return this.name; + } + + @AknotOptional public boolean isSync() { return this.sync; } - + + public void setFetch(final String fetch) { + this.fetch = fetch; + } + + public void setMirror(final List mirror) { + this.mirror = mirror; + } + + public void setName(final String name) { + this.name = name; + } + public void setSync(final boolean sync) { this.sync = sync; } diff --git a/src/org/atriasoft/island/model/maven/MavenMetadata.java b/src/org/atriasoft/island/model/maven/MavenMetadata.java index 9255ec7..38101ff 100644 --- a/src/org/atriasoft/island/model/maven/MavenMetadata.java +++ b/src/org/atriasoft/island/model/maven/MavenMetadata.java @@ -1,14 +1,14 @@ package org.atriasoft.island.model.maven; -import org.atriasoft.exml.annotation.XmlDefaultAttibute; -import org.atriasoft.exml.annotation.XmlIgnoreUnknow; -import org.atriasoft.exml.annotation.XmlName; +import org.atriasoft.aknot.annotation.AknotIgnoreUnknown; +import org.atriasoft.aknot.annotation.AknotName; +import org.atriasoft.aknot.annotation.AknotDefaultAttribute; -@XmlDefaultAttibute(false) -@XmlIgnoreUnknow +@AknotDefaultAttribute(false) +@AknotIgnoreUnknown public record MavenMetadata( - @XmlName("groupId") String groupId, - @XmlName("artifactId") String artifactId, - @XmlName("versioning") Versioning versioning) { + @AknotName("groupId") String groupId, + @AknotName("artifactId") String artifactId, + @AknotName("versioning") Versioning versioning) { } diff --git a/src/org/atriasoft/island/model/maven/PomDependency.java b/src/org/atriasoft/island/model/maven/PomDependency.java index 2340f0d..e08c952 100644 --- a/src/org/atriasoft/island/model/maven/PomDependency.java +++ b/src/org/atriasoft/island/model/maven/PomDependency.java @@ -1,16 +1,16 @@ package org.atriasoft.island.model.maven; -import org.atriasoft.exml.annotation.XmlDefaultNullValue; -import org.atriasoft.exml.annotation.XmlIgnoreUnknow; -import org.atriasoft.exml.annotation.XmlName; -import org.atriasoft.exml.annotation.XmlOptional; +import org.atriasoft.aknot.annotation.AknotDefaultNullValue; +import org.atriasoft.aknot.annotation.AknotIgnoreUnknown; +import org.atriasoft.aknot.annotation.AknotName; +import org.atriasoft.aknot.annotation.AknotOptional; -@XmlDefaultNullValue -@XmlIgnoreUnknow +@AknotDefaultNullValue +@AknotIgnoreUnknown public record PomDependency( - @XmlName("groupId") String groupId, - @XmlName("artifactId") String artifactId, - @XmlOptional @XmlName("version") String version, - @XmlOptional @XmlName("scope") String scope) { + @AknotName("groupId") String groupId, + @AknotName("artifactId") String artifactId, + @AknotOptional @AknotName("version") String version, + @AknotOptional @AknotName("scope") String scope) { } diff --git a/src/org/atriasoft/island/model/maven/PomMaven.java b/src/org/atriasoft/island/model/maven/PomMaven.java index 3ca3059..11e141b 100644 --- a/src/org/atriasoft/island/model/maven/PomMaven.java +++ b/src/org/atriasoft/island/model/maven/PomMaven.java @@ -2,21 +2,20 @@ package org.atriasoft.island.model.maven; import java.util.List; -import org.atriasoft.exml.annotation.XmlDefaultNullValue; -import org.atriasoft.exml.annotation.XmlIgnoreUnknow; -import org.atriasoft.exml.annotation.XmlList; -import org.atriasoft.exml.annotation.XmlName; -import org.atriasoft.exml.annotation.XmlOptional; +import org.atriasoft.aknot.annotation.AknotDefaultNullValue; +import org.atriasoft.aknot.annotation.AknotIgnoreUnknown; +import org.atriasoft.aknot.annotation.AknotList; +import org.atriasoft.aknot.annotation.AknotName; +import org.atriasoft.aknot.annotation.AknotOptional; -@XmlDefaultNullValue -@XmlIgnoreUnknow -public record PomMaven ( - @XmlName("modelVersion") String modelVersion, - @XmlName("groupId") String groupId, - @XmlName("artifactId") String artifactId, - @XmlName("version") String version, - @XmlOptional @XmlName("name") String name, - @XmlOptional @XmlName("description") String description, - @XmlOptional @XmlName("url") String url, - @XmlOptional @XmlName("dependencies") @XmlList(value="dependency") List dependencies) { -} +@AknotDefaultNullValue +@AknotIgnoreUnknown +public record PomMaven( + @AknotName("modelVersion") String modelVersion, + @AknotName("groupId") String groupId, + @AknotName("artifactId") String artifactId, + @AknotName("version") String version, + @AknotOptional @AknotName("name") String name, + @AknotOptional @AknotName("description") String description, + @AknotOptional @AknotName("url") String url, + @AknotOptional @AknotName("dependencies") @AknotList(value = "dependency") List dependencies) {} diff --git a/src/org/atriasoft/island/model/maven/Versioning.java b/src/org/atriasoft/island/model/maven/Versioning.java index f48e487..d228646 100644 --- a/src/org/atriasoft/island/model/maven/Versioning.java +++ b/src/org/atriasoft/island/model/maven/Versioning.java @@ -2,13 +2,13 @@ package org.atriasoft.island.model.maven; import java.util.List; -import org.atriasoft.exml.annotation.XmlList; -import org.atriasoft.exml.annotation.XmlName; +import org.atriasoft.aknot.annotation.AknotList; +import org.atriasoft.aknot.annotation.AknotName; public record Versioning( - @XmlName("latest") String latest, - @XmlName("release") String release, - @XmlName("lastUpdated") String lastUpdated, - @XmlName("versions") @XmlList(value="version") List versions) { + @AknotName("latest") String latest, + @AknotName("release") String release, + @AknotName("lastUpdated") String lastUpdated, + @AknotName("versions") @AknotList(value = "version") List versions) { }