|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.rexsl.page.JaxbGroup
public final class JaxbGroup
JAXB group of elements.
A convenient utility class that enables on-fly creation of JAXB annotated collections of elements, for example:
@XmlRootElement
public class Page {
@XmlElement
public Object getEmployees() {
Collection<Employee> employees = this.retrieve();
return JaxbGroup.build(employees, "employee");
}
}
It's even more convenient in combination with JaxbBundle, for
example:
@XmlRootElement
public class Page {
@XmlElement
public Object getEmployee() {
return new JaxbBundle("employee")
.attr("age", "45")
.add("depts", JaxbGroup.build(this.depts(), "dept"))
.up()
.element();
}
}
The class is immutable and thread-safe.
| Constructor Summary | |
|---|---|
|
JaxbGroup()
Public ctor, for JAXB (always throws a runtime exception). |
protected |
JaxbGroup(Collection<?> grp)
Protected ctor, for on-fly instantiating (you're not supposed to use it). |
| Method Summary | |
|---|---|
static Object |
build(Collection<?> grp,
String name)
Creates a new JAXB-annotated collection of elements. |
Collection<?> |
getGroup()
Get group of elements. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JaxbGroup()
protected JaxbGroup(Collection<?> grp)
grp - Group of elements| Method Detail |
|---|
public static Object build(@NotNull
Collection<?> grp,
@NotNull
String name)
grp - Group of elements (JAXB-annotated)name - Name of parent XML element
public Collection<?> getGroup()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||