Commit 78226a799bcf929acf6097fa9fbe9201e20ee489

Authored by bernard
1 parent de43f484

Reformatted code.

... ... @@ -27,11 +27,11 @@ public class Updater {
27 27
28 28 public ExchangeRateTable getRecentExchangeTable() throws IOException, YarfrawException, JAXBException {
29 29 final List<ChannelFeed> feedList = FeedReaderUtils.readAll(Executors.newCachedThreadPool(), new HttpURL(feedURL));
30   - if(feedList.size() < 1) {
  30 + if (feedList.size() < 1) {
31 31 throw new IllegalArgumentException("Read 0 feeds.");
32 32 }
33 33 final List<ItemEntry> entries = feedList.get(0).getItems();
34   - if(entries.size() < 1) {
  34 + if (entries.size() < 1) {
35 35 return null;
36 36 }
37 37 return ExchangeRateTableUnmarshaller.unmarshal(entries.get(0).getEnclosure().getUrl());
... ...
... ... @@ -5,6 +5,6 @@ import java.math.BigDecimal;
5 5 public class RateConverter {
6 6
7 7 public static BigDecimal convert(String value) {
8   - return new BigDecimal(value.replaceAll(",","."));
  8 + return new BigDecimal(value.replaceAll(",", "."));
9 9 }
10 10 }
... ...
... ... @@ -5,16 +5,13 @@
5 5 // Generated on: 2010.12.16 at 02:23:57 PM GMT
6 6 //
7 7
8   -
9 8 package pl.labno.bernard.nbp.exchangerate.rest.generated;
10 9
11   -import java.math.BigDecimal;
12 10 import javax.xml.bind.annotation.adapters.XmlAdapter;
  11 +import java.math.BigDecimal;
13 12
14 13 public class Adapter1
15   - extends XmlAdapter<String, BigDecimal>
16   -{
17   -
  14 + extends XmlAdapter<String, BigDecimal> {
18 15
19 16 public BigDecimal unmarshal(String value) {
20 17 return (pl.labno.bernard.nbp.exchangerate.rest.RateConverter.convert(value));
... ...
... ... @@ -5,24 +5,22 @@
5 5 // Generated on: 2010.12.16 at 02:23:57 PM GMT
6 6 //
7 7
8   -
9 8 package pl.labno.bernard.nbp.exchangerate.rest.generated;
10 9
11   -import java.math.BigDecimal;
12   -import java.math.BigInteger;
13 10 import javax.xml.bind.annotation.XmlAccessType;
14 11 import javax.xml.bind.annotation.XmlAccessorType;
15 12 import javax.xml.bind.annotation.XmlElement;
16 13 import javax.xml.bind.annotation.XmlSchemaType;
17 14 import javax.xml.bind.annotation.XmlType;
18 15 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
19   -
  16 +import java.math.BigDecimal;
  17 +import java.math.BigInteger;
20 18
21 19 /**
22 20 * <p>Java class for anonymous complex type.
23   - *
  21 + * <p/>
24 22 * <p>The following schema fragment specifies the expected content contained within this class.
25   - *
  23 + * <p/>
26 24 * <pre>
27 25 * &lt;complexType>
28 26 * &lt;complexContent>
... ... @@ -37,8 +35,6 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
37 35 * &lt;/complexContent>
38 36 * &lt;/complexType>
39 37 * </pre>
40   - *
41   - *
42 38 */
43 39 @XmlAccessorType(XmlAccessType.FIELD)
44 40 @XmlType(name = "", propOrder = {
... ... @@ -56,17 +52,15 @@ public class ExchangeRate {
56 52 @XmlElement(name = "kod_waluty", required = true)
57 53 protected String currencySymbol;
58 54 @XmlElement(name = "kurs_sredni", required = true, type = String.class)
59   - @XmlJavaTypeAdapter(Adapter1 .class)
  55 + @XmlJavaTypeAdapter(Adapter1.class)
60 56 @XmlSchemaType(name = "float")
61 57 protected BigDecimal value;
62 58
63 59 /**
64 60 * Gets the value of the currencyName property.
65   - *
66   - * @return
67   - * possible object is
68   - * {@link String }
69   - *
  61 + *
  62 + * @return possible object is
  63 + * {@link String }
70 64 */
71 65 public String getCurrencyName() {
72 66 return currencyName;
... ... @@ -74,11 +68,9 @@ public class ExchangeRate {
74 68
75 69 /**
76 70 * Sets the value of the currencyName property.
77   - *
78   - * @param value
79   - * allowed object is
80   - * {@link String }
81   - *
  71 + *
  72 + * @param value allowed object is
  73 + * {@link String }
82 74 */
83 75 public void setCurrencyName(String value) {
84 76 this.currencyName = value;
... ... @@ -86,11 +78,9 @@ public class ExchangeRate {
86 78
87 79 /**
88 80 * Gets the value of the przelicznik property.
89   - *
90   - * @return
91   - * possible object is
92   - * {@link BigInteger }
93   - *
  81 + *
  82 + * @return possible object is
  83 + * {@link BigInteger }
94 84 */
95 85 public BigInteger getPrzelicznik() {
96 86 return przelicznik;
... ... @@ -98,11 +88,9 @@ public class ExchangeRate {
98 88
99 89 /**
100 90 * Sets the value of the przelicznik property.
101   - *
102   - * @param value
103   - * allowed object is
104   - * {@link BigInteger }
105   - *
  91 + *
  92 + * @param value allowed object is
  93 + * {@link BigInteger }
106 94 */
107 95 public void setPrzelicznik(BigInteger value) {
108 96 this.przelicznik = value;
... ... @@ -110,11 +98,9 @@ public class ExchangeRate {
110 98
111 99 /**
112 100 * Gets the value of the currencySymbol property.
113   - *
114   - * @return
115   - * possible object is
116   - * {@link String }
117   - *
  101 + *
  102 + * @return possible object is
  103 + * {@link String }
118 104 */
119 105 public String getCurrencySymbol() {
120 106 return currencySymbol;
... ... @@ -122,11 +108,9 @@ public class ExchangeRate {
122 108
123 109 /**
124 110 * Sets the value of the currencySymbol property.
125   - *
126   - * @param value
127   - * allowed object is
128   - * {@link String }
129   - *
  111 + *
  112 + * @param value allowed object is
  113 + * {@link String }
130 114 */
131 115 public void setCurrencySymbol(String value) {
132 116 this.currencySymbol = value;
... ... @@ -134,11 +118,9 @@ public class ExchangeRate {
134 118
135 119 /**
136 120 * Gets the value of the value property.
137   - *
138   - * @return
139   - * possible object is
140   - * {@link String }
141   - *
  121 + *
  122 + * @return possible object is
  123 + * {@link String }
142 124 */
143 125 public BigDecimal getValue() {
144 126 return value;
... ... @@ -146,11 +128,9 @@ public class ExchangeRate {
146 128
147 129 /**
148 130 * Sets the value of the value property.
149   - *
150   - * @param value
151   - * allowed object is
152   - * {@link String }
153   - *
  131 + *
  132 + * @param value allowed object is
  133 + * {@link String }
154 134 */
155 135 public void setValue(BigDecimal value) {
156 136 this.value = value;
... ...
... ... @@ -5,7 +5,6 @@
5 5 // Generated on: 2010.12.16 at 02:23:57 PM GMT
6 6 //
7 7
8   -
9 8 package pl.labno.bernard.nbp.exchangerate.rest.generated;
10 9
11 10 import javax.xml.bind.annotation.XmlAccessType;
... ... @@ -16,12 +15,11 @@ import javax.xml.bind.annotation.XmlType;
16 15 import java.util.ArrayList;
17 16 import java.util.List;
18 17
19   -
20 18 /**
21 19 * <p>Java class for tabela_kursow element declaration.
22   - *
  20 + * <p/>
23 21 * <p>The following schema fragment specifies the expected content contained within this class.
24   - *
  22 + * <p/>
25 23 * <pre>
26 24 * &lt;element name="tabela_kursow">
27 25 * &lt;complexType>
... ... @@ -50,8 +48,6 @@ import java.util.List;
50 48 * &lt;/complexType>
51 49 * &lt;/element>
52 50 * </pre>
53   - *
54   - *
55 51 */
56 52 @XmlAccessorType(XmlAccessType.FIELD)
57 53 @XmlType(name = "", propOrder = {
... ... @@ -71,11 +67,9 @@ public class ExchangeRateTable {
71 67
72 68 /**
73 69 * Gets the value of the number property.
74   - *
75   - * @return
76   - * possible object is
77   - * {@link String }
78   - *
  70 + *
  71 + * @return possible object is
  72 + * {@link String }
79 73 */
80 74 public String getNumber() {
81 75 return number;
... ... @@ -83,11 +77,9 @@ public class ExchangeRateTable {
83 77
84 78 /**
85 79 * Sets the value of the number property.
86   - *
87   - * @param value
88   - * allowed object is
89   - * {@link String }
90   - *
  80 + *
  81 + * @param value allowed object is
  82 + * {@link String }
91 83 */
92 84 public void setNumber(String value) {
93 85 this.number = value;
... ... @@ -95,11 +87,9 @@ public class ExchangeRateTable {
95 87
96 88 /**
97 89 * Gets the value of the publicationDate property.
98   - *
99   - * @return
100   - * possible object is
101   - * {@link String }
102   - *
  90 + *
  91 + * @return possible object is
  92 + * {@link String }
103 93 */
104 94 public String getPublicationDate() {
105 95 return publicationDate;
... ... @@ -107,11 +97,9 @@ public class ExchangeRateTable {
107 97
108 98 /**
109 99 * Sets the value of the publicationDate property.
110   - *
111   - * @param value
112   - * allowed object is
113   - * {@link String }
114   - *
  100 + *
  101 + * @param value allowed object is
  102 + * {@link String }
115 103 */
116 104 public void setPublicationDate(String value) {
117 105 this.publicationDate = value;
... ... @@ -119,25 +107,23 @@ public class ExchangeRateTable {
119 107
120 108 /**
121 109 * Gets the value of the items property.
122   - *
123   - * <p>
  110 + * <p/>
  111 + * <p/>
124 112 * This accessor method returns a reference to the live list,
125 113 * not a snapshot. Therefore any modification you make to the
126 114 * returned list will be present inside the JAXB object.
127 115 * This is why there is not a <CODE>set</CODE> method for the items property.
128   - *
129   - * <p>
  116 + * <p/>
  117 + * <p/>
130 118 * For example, to add a new item, do as follows:
131 119 * <pre>
132 120 * getItems().add(newItem);
133 121 * </pre>
134   - *
135   - *
136   - * <p>
  122 + * <p/>
  123 + * <p/>
  124 + * <p/>
137 125 * Objects of the following type(s) are allowed in the list
138 126 * {@link ExchangeRate }
139   - *
140   - *
141 127 */
142 128 public List<ExchangeRate> getItems() {
143 129 if (items == null) {
... ...
... ... @@ -5,40 +5,34 @@
5 5 // Generated on: 2010.12.16 at 02:23:57 PM GMT
6 6 //
7 7
8   -
9 8 package pl.labno.bernard.nbp.exchangerate.rest.generated;
10 9
11 10 import javax.xml.bind.annotation.XmlRegistry;
12 11
13   -
14 12 /**
15   - * This object contains factory methods for each
16   - * Java content interface and Java element interface
17   - * generated in the pl.labno.bernard.nbp.exchangerate.rest.generated package.
18   - * <p>An ObjectFactory allows you to programatically
19   - * construct new instances of the Java representation
20   - * for XML content. The Java representation of XML
21   - * content can consist of schema derived interfaces
22   - * and classes representing the binding of schema
23   - * type definitions, element declarations and model
24   - * groups. Factory methods for each of these are
  13 + * This object contains factory methods for each
  14 + * Java content interface and Java element interface
  15 + * generated in the pl.labno.bernard.nbp.exchangerate.rest.generated package.
  16 + * <p>An ObjectFactory allows you to programatically
  17 + * construct new instances of the Java representation
  18 + * for XML content. The Java representation of XML
  19 + * content can consist of schema derived interfaces
  20 + * and classes representing the binding of schema
  21 + * type definitions, element declarations and model
  22 + * groups. Factory methods for each of these are
25 23 * provided in this class.
26   - *
27 24 */
28 25 @XmlRegistry
29 26 public class ObjectFactory {
30 27
31   -
32 28 /**
33 29 * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: pl.labno.bernard.nbp.exchangerate.rest.generated
34   - *
35 30 */
36 31 public ObjectFactory() {
37 32 }
38 33
39 34 /**
40 35 * Create an instance of {@link ExchangeRateTable }
41   - *
42 36 */
43 37 public ExchangeRateTable createExchangeRateTable() {
44 38 return new ExchangeRateTable();
... ... @@ -46,7 +40,6 @@ public class ObjectFactory {
46 40
47 41 /**
48 42 * Create an instance of {@link ExchangeRate }
49   - *
50 43 */
51 44 public ExchangeRate createExchangeRate() {
52 45 return new ExchangeRate();
... ...
Please register or login to post a comment