Skip to content
Permalink
Browse files

Remove needless XmlRootElement annotations

They are supposed to indicate ROOT elements, such as a map or tileset.
Chunks need it so that they can be used with @XmlMixed.
  • Loading branch information...
TheRamenChef committed Dec 2, 2018
1 parent 776fa54 commit 4d3a500c608b6079c2a3d0ffdff4a598d0668848
@@ -7,12 +7,10 @@
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import de.gurkenlabs.litiengine.environment.tilemap.ITileAnimation;
import de.gurkenlabs.litiengine.environment.tilemap.ITileAnimationFrame;

@XmlRootElement(name = "animation")
@XmlAccessorType(XmlAccessType.FIELD)
public class Animation implements ITileAnimation, Serializable {
private static final long serialVersionUID = -6359129685451548791L;
@@ -9,14 +9,12 @@
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.adapters.XmlAdapter;

import de.gurkenlabs.litiengine.environment.tilemap.ICustomProperty;

public class CustomPropertyAdapter extends XmlAdapter<CustomPropertyAdapter.PropertyList, Map<String, ICustomProperty>> {
@XmlRootElement(name = "property")
@XmlAccessorType(XmlAccessType.FIELD)
static class Property {
@XmlAttribute
@@ -37,7 +35,6 @@
}
}

@XmlRootElement(name = "properties")
@XmlAccessorType(XmlAccessType.FIELD)
static class PropertyList {
@XmlElement(name = "property")
@@ -5,12 +5,10 @@
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import de.gurkenlabs.litiengine.environment.tilemap.ITileAnimationFrame;

@XmlRootElement(name = "frame")
@XmlAccessorType(XmlAccessType.FIELD)
public class Frame implements ITileAnimationFrame, Serializable {
private static final long serialVersionUID = -1230720730915515967L;
@@ -4,13 +4,11 @@

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

import de.gurkenlabs.litiengine.environment.tilemap.IImageLayer;
import de.gurkenlabs.litiengine.environment.tilemap.IMapImage;
import de.gurkenlabs.litiengine.util.ColorHelper;

@XmlRootElement(name = "imagelayer")
public class ImageLayer extends Layer implements IImageLayer {
private static final long serialVersionUID = 3233918712579479523L;

@@ -7,7 +7,6 @@
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import de.gurkenlabs.litiengine.environment.tilemap.IMapImage;
@@ -17,7 +16,6 @@
/**
* The Class MapImage.
*/
@XmlRootElement(name = "image")
@XmlAccessorType(XmlAccessType.FIELD)
public class MapImage extends CustomPropertyProvider implements IMapImage {
private static final long serialVersionUID = -3571362172734426098L;
@@ -7,7 +7,6 @@
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

@@ -18,7 +17,6 @@
/**
* The Class MapObject.
*/
@XmlRootElement(name = "object")
public class MapObject extends CustomPropertyProvider implements IMapObject {
private static final long serialVersionUID = -6001981756772928868L;

@@ -14,7 +14,6 @@
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import de.gurkenlabs.litiengine.environment.tilemap.IMapObject;
import de.gurkenlabs.litiengine.environment.tilemap.IMapObjectLayer;
@@ -23,7 +22,6 @@
/**
* The Class ShapeLayer.
*/
@XmlRootElement(name = "objectgroup")
public class MapObjectLayer extends Layer implements IMapObjectLayer {
private static final long serialVersionUID = -6130660578937427531L;

@@ -8,11 +8,9 @@
import java.util.logging.Logger;

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

import de.gurkenlabs.litiengine.environment.tilemap.IPolyline;

@XmlRootElement(name = "polyline")
public class Polyline implements IPolyline, Serializable {
private static final Logger log = Logger.getLogger(Polyline.class.getName());
private static final long serialVersionUID = -9046398175130339L;
@@ -7,13 +7,11 @@
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

import de.gurkenlabs.litiengine.environment.tilemap.ICustomProperty;
import de.gurkenlabs.litiengine.environment.tilemap.ITile;
import de.gurkenlabs.litiengine.environment.tilemap.ITilesetEntry;

@XmlRootElement(name = "tile")
@XmlAccessorType(XmlAccessType.FIELD)
public class Tile extends CustomPropertyProvider implements ITile, Serializable {
public static final int NONE = 0;
@@ -14,12 +14,10 @@
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlMixed;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import de.gurkenlabs.litiengine.util.ArrayUtilities;

@XmlRootElement(name = "data")
public class TileData {
protected static final String ENCODING_BASE64 = "base64";
protected static final String ENCODING_CSV = "csv";
@@ -7,13 +7,11 @@
import java.util.concurrent.CopyOnWriteArrayList;

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

import de.gurkenlabs.litiengine.environment.tilemap.ITile;
import de.gurkenlabs.litiengine.environment.tilemap.ITileLayer;
import de.gurkenlabs.litiengine.environment.tilemap.ITileset;

@XmlRootElement(name = "layer")
public class TileLayer extends Layer implements ITileLayer {
private static final long serialVersionUID = -6588787132358068892L;

@@ -6,14 +6,12 @@
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import de.gurkenlabs.litiengine.environment.tilemap.ITerrain;
import de.gurkenlabs.litiengine.environment.tilemap.ITileAnimation;
import de.gurkenlabs.litiengine.environment.tilemap.ITilesetEntry;
import de.gurkenlabs.litiengine.util.ArrayUtilities;

@XmlRootElement(name = "tile")
@XmlAccessorType(XmlAccessType.FIELD)
public class TilesetEntry extends CustomPropertyProvider implements ITilesetEntry {

0 comments on commit 4d3a500

Please sign in to comment.
You can’t perform that action at this time.