Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.
/ gwtjaxb Public archive

XML parser using GWT code generation and JAXB annotations

License

Notifications You must be signed in to change notification settings

pfranza/gwtjaxb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gwtjaxb

A GWT library that supports basic JAXB annotations to bind xml to a bean hierarchy.

Usage

Creating a jaxb parser is easy:

@JAXBBindings(value=RootBean.class, objects={NestedSubObjectOne.class, NestedSubObjectTwo.class})
public interface RootBeanParserFactory extends JAXBParserFactory<RootBean>{}

You create an interface that extends JAXBParserFactory<> with a generic that matches the @XMLRootEntity node.

Then you add a @JAXBBindings to the interface where value is the @XmlRootEntity and objects is an array of all other beans that the parser should use.

Using the jaxb parser is easy:

RootBeanParserFactory p = GWT.create(RootBeanParserFactory .class);
RootBean bean = p.create().parse("<RootBean />");

Create and instance of the parser using GWT.create() and pass an xml string in for parsing.

Supported Annotations

  • @XmlAccessorType(XmlAccessType.FIELD): Only the attributes on fields are supported
  • @XmlRootElement
  • @XmlAttribute
  • @XmlElement
  • @XmlTransient
  • @XmlValue Adding more support soon

About

XML parser using GWT code generation and JAXB annotations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages