Dowload and configure the Xesta jar and dependencies.
Download the jar and dependencies or declare the dependency on the maven pom file.
Options:
-
Declare the dependency on the pom file.
> net.vionta.xml > xesta > 1.0.0 >
-
If the version is not available on maven central you can download the last version from http://github.com/vionta/xesta/releases and install it locally.
Annotate your first class.
Xesta defines the xml document locations using Java annotations (Bind), the Xml locaitons are defined with the "expression" attribute. Classes should implement the Serializable interface.
@Bind(expression = "//*:CstmrCdtTrfInitn" )public class CheckNoNS implements Serializable {
They should also have a no args constructor.
public CheckNoNS() {}
Then you should annotate the fields.
@Bind(expression = ":PmtInf/:DbtrAcct/:Id/:Othr/*:Id")String debtorAccount;
A complete Pojo example from a class used to retrieve the value attribute from a console appender from a log4j file.
import java.io.Serializable;import net.vionta.xml.xesta.bind.annotation.Bind;
@Bind(expression = "/*:configuration/appender")public class LogLevelSimple implements Serializable {
@Bind(expression = "param/@value")private String level;
public LogLevelSimple() {super();}
public String getLevel() {return level;}
public void setLevel(String level)
}
Retrieve the document
In order to retrieve the document you use a repository. The simplest repository type is a File repository where you pass the file location.
FilePathRepository repo = new FilePathRepository("./cases/iso20022/GlobalPayment.xml");GlobalPayment globalPayment = new GlobalPayment();globalPayment = repo.load(globalPayment);
You can find more examples from the XmlPrague 2026 conference at http://www.github.com/vionta/xesta-samples.
Jump to content