04.06.2008 | 22:12:22
immagine
Ing. Emanuele Scapin

Java, es4, classe Address serializzabile
  •  

  • Definizione dell'oggetto Address, che gestisce i dati di una località, con marcatori per la definizione in Xml.

    import javax.xml.bind.annotation.XmlElement;
    import javax.xml.bind.annotation.XmlRootElement;
    
    @XmlRootElement()
    public class Address {
        private Point Location;
        @XmlElement()
        public Point getLocation() {
            return Location; //String.valueOf(Velocita);
        }
    
        public void setLocation(Point x) {
            Location = x;
        }  
        
        private String Country;
        @XmlElement()
        public String getCountry() {
            return Country; 
        }
    
        public void setCountry(String x) {
            Country = x;
        } 
        
        private String City;
        @XmlElement()
        public String getCity() {
            return City; 
        }
    
        public void setCity(String x) {
            City = x;
        } 
        
        private String Street;
        @XmlElement()
        public String getStreet() {
            return Street; 
        }
    
        public void setStreet(String x) {
            Street = x;
        } 
        
        private String HouseNumber;
        @XmlElement()
        public String getHouseNumber() {
            return HouseNumber; 
        }
    
        public void setHouseNumber(String x) {
            HouseNumber = x;
        } 
        
        private String PostCode;
        @XmlElement()
        public String getPostCode() {
            return PostCode; 
        }
    
        public void setPostCode(String x) {
            PostCode = x;
        }     
    }
            

© Emanuele Scapin 2009-2014

 

Valid HTML 4.01! Valid CSS!