Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions src/main/java/org/springframework/hateoas/Link.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;

import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

Expand All @@ -47,7 +43,6 @@
* @author Oliver Gierke
* @author Greg Turnquist
*/
@XmlType(name = "link", namespace = Link.ATOM_NAMESPACE)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(value = "templated", ignoreUnknown = true)
@AllArgsConstructor(access = AccessLevel.PACKAGE)
Expand All @@ -66,15 +61,15 @@ public class Link implements Serializable {
public static final String REL_NEXT = "next";
public static final String REL_LAST = "last";

private @XmlAttribute @Wither String rel;
private @XmlAttribute @Wither String href;
private @XmlAttribute @Wither String hreflang;
private @XmlAttribute @Wither String media;
private @XmlAttribute @Wither String title;
private @XmlAttribute @Wither String type;
private @XmlAttribute @Wither String deprecation;
private @XmlTransient @JsonIgnore UriTemplate template;
private @XmlTransient @JsonIgnore List<Affordance> affordances;
private @Wither String rel;
private @Wither String href;
private @Wither String hreflang;
private @Wither String media;
private @Wither String title;
private @Wither String type;
private @Wither String deprecation;
private @JsonIgnore UriTemplate template;
private @JsonIgnore List<Affordance> affordances;

/**
* Creates a new link to the given URI with the self rel.
Expand Down
14 changes: 5 additions & 9 deletions src/main/java/org/springframework/hateoas/PagedResources.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
import java.util.Collection;
import java.util.Optional;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

import org.springframework.util.Assert;

import com.fasterxml.jackson.annotation.JsonIgnore;
Expand All @@ -33,10 +30,9 @@
*
* @author Oliver Gierke
*/
@XmlRootElement(name = "pagedEntities")
public class PagedResources<T> extends Resources<T> {

public static PagedResources<?> NO_PAGE = new PagedResources<Object>();
public static PagedResources<?> NO_PAGE = new PagedResources<>();

private PageMetadata metadata;

Expand Down Expand Up @@ -169,10 +165,10 @@ public int hashCode() {
*/
public static class PageMetadata {

@XmlAttribute @JsonProperty private long size;
@XmlAttribute @JsonProperty private long totalElements;
@XmlAttribute @JsonProperty private long totalPages;
@XmlAttribute @JsonProperty private long number;
@JsonProperty private long size;
@JsonProperty private long totalElements;
@JsonProperty private long totalPages;
@JsonProperty private long number;

protected PageMetadata() {

Expand Down
5 changes: 0 additions & 5 deletions src/main/java/org/springframework/hateoas/Resource.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
import java.util.Arrays;
import java.util.Collection;

import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlRootElement;

import org.springframework.util.Assert;

import com.fasterxml.jackson.annotation.JsonUnwrapped;
Expand All @@ -31,7 +28,6 @@
* @author Oliver Gierke
* @author Greg Turnquist
*/
@XmlRootElement
public class Resource<T> extends ResourceSupport {

private final T content;
Expand Down Expand Up @@ -73,7 +69,6 @@ public Resource(T content, Iterable<Link> links) {
* @return the content
*/
@JsonUnwrapped
@XmlAnyElement
public T getContent() {
return content;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import java.util.Optional;
import java.util.stream.Collectors;

import javax.xml.bind.annotation.XmlElement;

import org.springframework.util.Assert;

import com.fasterxml.jackson.annotation.JsonIgnore;
Expand Down Expand Up @@ -104,7 +102,6 @@ public boolean hasLink(String rel) {
*
* @return
*/
@XmlElement(name = "link", namespace = Link.ATOM_NAMESPACE)
@JsonProperty("links")
public List<Link> getLinks() {
return links;
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/org/springframework/hateoas/Resources.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
import java.util.Collections;
import java.util.Iterator;

import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

import org.springframework.util.Assert;

import com.fasterxml.jackson.annotation.JsonProperty;
Expand All @@ -34,7 +30,6 @@
*
* @author Oliver Gierke
*/
@XmlRootElement(name = "entities")
public class Resources<T> extends ResourceSupport implements Iterable<T> {

private final Collection<T> content;
Expand Down Expand Up @@ -98,8 +93,6 @@ public static <T extends Resource<S>, S> Resources<T> wrap(Iterable<S> content)
*
* @return the content will never be {@literal null}.
*/
@XmlAnyElement
@XmlElementWrapper
@JsonProperty("content")
public Collection<T> getContent() {
return Collections.unmodifiableCollection(content);
Expand Down
12 changes: 2 additions & 10 deletions src/main/java/org/springframework/hateoas/VndErrors.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
import java.util.Iterator;
import java.util.List;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

Expand All @@ -38,10 +33,8 @@
* @see https://github.com/blongden/vnd.error
* @author Oliver Gierke
*/
@XmlRootElement(name = "errors")
public class VndErrors implements Iterable<VndErrors.VndError> {

@XmlElement(name = "error")//
private final List<VndError> vndErrors;

/**
Expand Down Expand Up @@ -162,11 +155,10 @@ public boolean equals(Object obj) {
*
* @author Oliver Gierke
*/
@XmlType
public static class VndError extends ResourceSupport {

@XmlAttribute @JsonProperty private final String logref;
@XmlElement @JsonProperty private final String message;
@JsonProperty private final String logref;
@JsonProperty private final String message;

/**
* Creates a new {@link VndError} with the given logref, a message as well as some {@link Link}s.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

import java.util.List;

import javax.xml.bind.annotation.XmlElement;

import org.springframework.hateoas.Link;
import org.springframework.hateoas.ResourceSupport;

Expand All @@ -33,18 +31,17 @@
* Jackson 2 mixin to invoke the related serializer/deserializer.
*
* @author Greg Turnquist
* @author Jens Schauder
*/
@JsonSerialize(using = CollectionJsonResourceSupportSerializer.class)
@JsonDeserialize(using = CollectionJsonResourceSupportDeserializer.class)
abstract class ResourceSupportMixin extends ResourceSupport {

@Override
@XmlElement(name = "collection")
@JsonProperty("collection")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonSerialize(using = CollectionJsonLinkListSerializer.class)
@JsonDeserialize(using = CollectionJsonLinkListDeserializer.class)
public abstract List<Link> getLinks();


}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

import java.util.List;

import javax.xml.bind.annotation.XmlElement;

import org.springframework.hateoas.Link;
import org.springframework.hateoas.ResourceSupport;

Expand All @@ -38,7 +36,6 @@
public abstract class ResourceSupportMixin extends ResourceSupport {

@Override
@XmlElement(name = "link")
@JsonProperty("_links")
@JsonInclude(Include.NON_EMPTY)
@JsonSerialize(using = Jackson2HalModule.HalLinkListSerializer.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

import java.util.Collection;

import javax.xml.bind.annotation.XmlElement;

import org.springframework.hateoas.Resources;

import com.fasterxml.jackson.annotation.JsonInclude;
Expand All @@ -39,7 +37,6 @@
public abstract class ResourcesMixin<T> extends Resources<T> {

@Override
@XmlElement(name = "embedded")
@JsonProperty("_embedded")
@JsonInclude(Include.NON_EMPTY)
@JsonSerialize(using = Jackson2HalModule.HalResourcesSerializer.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import java.util.HashMap;
import java.util.Map;

import javax.xml.bind.annotation.XmlElement;

import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.hateoas.Link;
Expand Down Expand Up @@ -89,7 +87,6 @@ static interface ResourceMixin {}
abstract class ResourcesMixin<T> extends Resources<T> {

@Override
@XmlElement(name = "embedded")
@JsonProperty("_embedded")
@JsonInclude(Include.NON_EMPTY)
@JsonDeserialize(using = HalFormsResourcesDeserializer.class)
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/org/springframework/hateoas/package-info.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/**
* Value objects to ease creating {@link org.springframework.hateoas.Link}s and link driven representations for REST webservices.
*/
@XmlSchema(xmlns = { @XmlNs(prefix = "atom", namespaceURI = org.springframework.hateoas.Link.ATOM_NAMESPACE) }, elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package org.springframework.hateoas;

import javax.xml.bind.annotation.XmlNs;
import javax.xml.bind.annotation.XmlSchema;

This file was deleted.

Loading