diff --git a/src/main/java/pl/labno/bernard/nbp/exchangerate/Updater.java b/src/main/java/pl/labno/bernard/nbp/exchangerate/Updater.java index c15b132..d5a5064 100644 --- a/src/main/java/pl/labno/bernard/nbp/exchangerate/Updater.java +++ b/src/main/java/pl/labno/bernard/nbp/exchangerate/Updater.java @@ -27,11 +27,11 @@ public class Updater { public ExchangeRateTable getRecentExchangeTable() throws IOException, YarfrawException, JAXBException { final List feedList = FeedReaderUtils.readAll(Executors.newCachedThreadPool(), new HttpURL(feedURL)); - if(feedList.size() < 1) { + if (feedList.size() < 1) { throw new IllegalArgumentException("Read 0 feeds."); } final List entries = feedList.get(0).getItems(); - if(entries.size() < 1) { + if (entries.size() < 1) { return null; } return ExchangeRateTableUnmarshaller.unmarshal(entries.get(0).getEnclosure().getUrl()); diff --git a/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/RateConverter.java b/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/RateConverter.java index 699dc2d..e886a0b 100644 --- a/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/RateConverter.java +++ b/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/RateConverter.java @@ -5,6 +5,6 @@ import java.math.BigDecimal; public class RateConverter { public static BigDecimal convert(String value) { - return new BigDecimal(value.replaceAll(",",".")); + return new BigDecimal(value.replaceAll(",", ".")); } } diff --git a/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/Adapter1.java b/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/Adapter1.java index 37fd62b..25f4abb 100644 --- a/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/Adapter1.java +++ b/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/Adapter1.java @@ -5,16 +5,13 @@ // Generated on: 2010.12.16 at 02:23:57 PM GMT // - package pl.labno.bernard.nbp.exchangerate.rest.generated; -import java.math.BigDecimal; import javax.xml.bind.annotation.adapters.XmlAdapter; +import java.math.BigDecimal; public class Adapter1 - extends XmlAdapter -{ - + extends XmlAdapter { public BigDecimal unmarshal(String value) { return (pl.labno.bernard.nbp.exchangerate.rest.RateConverter.convert(value)); diff --git a/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/ExchangeRate.java b/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/ExchangeRate.java index 7da6a1c..fdf96bc 100644 --- a/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/ExchangeRate.java +++ b/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/ExchangeRate.java @@ -5,24 +5,22 @@ // Generated on: 2010.12.16 at 02:23:57 PM GMT // - package pl.labno.bernard.nbp.exchangerate.rest.generated; -import java.math.BigDecimal; -import java.math.BigInteger; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - +import java.math.BigDecimal; +import java.math.BigInteger; /** *

Java class for anonymous complex type. - * + *

*

The following schema fragment specifies the expected content contained within this class. - * + *

*

  * <complexType>
  *   <complexContent>
@@ -37,8 +35,6 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
  *   </complexContent>
  * </complexType>
  * 
- * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { @@ -56,17 +52,15 @@ public class ExchangeRate { @XmlElement(name = "kod_waluty", required = true) protected String currencySymbol; @XmlElement(name = "kurs_sredni", required = true, type = String.class) - @XmlJavaTypeAdapter(Adapter1 .class) + @XmlJavaTypeAdapter(Adapter1.class) @XmlSchemaType(name = "float") protected BigDecimal value; /** * Gets the value of the currencyName property. - * - * @return - * possible object is - * {@link String } - * + * + * @return possible object is + * {@link String } */ public String getCurrencyName() { return currencyName; @@ -74,11 +68,9 @@ public class ExchangeRate { /** * Sets the value of the currencyName property. - * - * @param value - * allowed object is - * {@link String } - * + * + * @param value allowed object is + * {@link String } */ public void setCurrencyName(String value) { this.currencyName = value; @@ -86,11 +78,9 @@ public class ExchangeRate { /** * Gets the value of the przelicznik property. - * - * @return - * possible object is - * {@link BigInteger } - * + * + * @return possible object is + * {@link BigInteger } */ public BigInteger getPrzelicznik() { return przelicznik; @@ -98,11 +88,9 @@ public class ExchangeRate { /** * Sets the value of the przelicznik property. - * - * @param value - * allowed object is - * {@link BigInteger } - * + * + * @param value allowed object is + * {@link BigInteger } */ public void setPrzelicznik(BigInteger value) { this.przelicznik = value; @@ -110,11 +98,9 @@ public class ExchangeRate { /** * Gets the value of the currencySymbol property. - * - * @return - * possible object is - * {@link String } - * + * + * @return possible object is + * {@link String } */ public String getCurrencySymbol() { return currencySymbol; @@ -122,11 +108,9 @@ public class ExchangeRate { /** * Sets the value of the currencySymbol property. - * - * @param value - * allowed object is - * {@link String } - * + * + * @param value allowed object is + * {@link String } */ public void setCurrencySymbol(String value) { this.currencySymbol = value; @@ -134,11 +118,9 @@ public class ExchangeRate { /** * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * + * + * @return possible object is + * {@link String } */ public BigDecimal getValue() { return value; @@ -146,11 +128,9 @@ public class ExchangeRate { /** * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * + * + * @param value allowed object is + * {@link String } */ public void setValue(BigDecimal value) { this.value = value; diff --git a/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/ExchangeRateTable.java b/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/ExchangeRateTable.java index bb3a3d3..4d53cb4 100644 --- a/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/ExchangeRateTable.java +++ b/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/ExchangeRateTable.java @@ -5,7 +5,6 @@ // Generated on: 2010.12.16 at 02:23:57 PM GMT // - package pl.labno.bernard.nbp.exchangerate.rest.generated; import javax.xml.bind.annotation.XmlAccessType; @@ -16,12 +15,11 @@ import javax.xml.bind.annotation.XmlType; import java.util.ArrayList; import java.util.List; - /** *

Java class for tabela_kursow element declaration. - * + *

*

The following schema fragment specifies the expected content contained within this class. - * + *

*

  * <element name="tabela_kursow">
  *   <complexType>
@@ -50,8 +48,6 @@ import java.util.List;
  *   </complexType>
  * </element>
  * 
- * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { @@ -71,11 +67,9 @@ public class ExchangeRateTable { /** * Gets the value of the number property. - * - * @return - * possible object is - * {@link String } - * + * + * @return possible object is + * {@link String } */ public String getNumber() { return number; @@ -83,11 +77,9 @@ public class ExchangeRateTable { /** * Sets the value of the number property. - * - * @param value - * allowed object is - * {@link String } - * + * + * @param value allowed object is + * {@link String } */ public void setNumber(String value) { this.number = value; @@ -95,11 +87,9 @@ public class ExchangeRateTable { /** * Gets the value of the publicationDate property. - * - * @return - * possible object is - * {@link String } - * + * + * @return possible object is + * {@link String } */ public String getPublicationDate() { return publicationDate; @@ -107,11 +97,9 @@ public class ExchangeRateTable { /** * Sets the value of the publicationDate property. - * - * @param value - * allowed object is - * {@link String } - * + * + * @param value allowed object is + * {@link String } */ public void setPublicationDate(String value) { this.publicationDate = value; @@ -119,25 +107,23 @@ public class ExchangeRateTable { /** * Gets the value of the items property. - * - *

+ *

+ *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a set method for the items property. - * - *

+ *

+ *

* For example, to add a new item, do as follows: *

      *    getItems().add(newItem);
      * 
- * - * - *

+ *

+ *

+ *

* Objects of the following type(s) are allowed in the list * {@link ExchangeRate } - * - * */ public List getItems() { if (items == null) { diff --git a/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/ObjectFactory.java b/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/ObjectFactory.java index 02537c1..fb1171b 100644 --- a/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/ObjectFactory.java +++ b/src/main/java/pl/labno/bernard/nbp/exchangerate/rest/generated/ObjectFactory.java @@ -5,40 +5,34 @@ // Generated on: 2010.12.16 at 02:23:57 PM GMT // - package pl.labno.bernard.nbp.exchangerate.rest.generated; import javax.xml.bind.annotation.XmlRegistry; - /** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the pl.labno.bernard.nbp.exchangerate.rest.generated package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the pl.labno.bernard.nbp.exchangerate.rest.generated package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are * provided in this class. - * */ @XmlRegistry public class ObjectFactory { - /** * 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 - * */ public ObjectFactory() { } /** * Create an instance of {@link ExchangeRateTable } - * */ public ExchangeRateTable createExchangeRateTable() { return new ExchangeRateTable(); @@ -46,7 +40,6 @@ public class ObjectFactory { /** * Create an instance of {@link ExchangeRate } - * */ public ExchangeRate createExchangeRate() { return new ExchangeRate();