diff --git a/apache-poi/.gitignore b/apache-poi/.gitignore index 9552c1e63d..ac62b36227 100644 --- a/apache-poi/.gitignore +++ b/apache-poi/.gitignore @@ -1,3 +1,5 @@ *.docx temp.xls temp.xlsx + +CellStyleTest_output.xlsx \ No newline at end of file diff --git a/core-java-modules/core-java-lang-math-2/.gitignore b/core-java-modules/core-java-lang-math-2/.gitignore index 30b2b7442c..e4c6fe9355 100644 --- a/core-java-modules/core-java-lang-math-2/.gitignore +++ b/core-java-modules/core-java-lang-math-2/.gitignore @@ -1,4 +1,6 @@ /target/ .settings/ .classpath -.project \ No newline at end of file +.project + +*.log diff --git a/core-java-modules/core-java-serialization/src/test/java/com/baeldung/externalizable/ExternalizableUnitTest.java b/core-java-modules/core-java-serialization/src/test/java/com/baeldung/externalizable/ExternalizableUnitTest.java index 651364fb13..9012928d92 100644 --- a/core-java-modules/core-java-serialization/src/test/java/com/baeldung/externalizable/ExternalizableUnitTest.java +++ b/core-java-modules/core-java-serialization/src/test/java/com/baeldung/externalizable/ExternalizableUnitTest.java @@ -1,14 +1,29 @@ package com.baeldung.externalizable; +import org.junit.Before; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.TemporaryFolder; import java.io.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; public class ExternalizableUnitTest { - private final static String OUTPUT_FILE = "externalizable.txt"; + private final static String OUTPUT_FILE_NAME = "externalizable.txt"; + + @Rule + public TemporaryFolder tempFolder = new TemporaryFolder(); + + private File outputFile; + + @Before + public void setUp() throws Exception { + outputFile = tempFolder.newFile(OUTPUT_FILE_NAME); + } @Test public void whenSerializing_thenUseExternalizable() throws IOException, ClassNotFoundException { @@ -18,7 +33,7 @@ public class ExternalizableUnitTest { c.setCode(374); c.setName("Armenia"); - FileOutputStream fileOutputStream = new FileOutputStream(OUTPUT_FILE); + FileOutputStream fileOutputStream = new FileOutputStream(outputFile); ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); c.writeExternal(objectOutputStream); @@ -26,7 +41,7 @@ public class ExternalizableUnitTest { objectOutputStream.close(); fileOutputStream.close(); - FileInputStream fileInputStream = new FileInputStream(OUTPUT_FILE); + FileInputStream fileInputStream = new FileInputStream(outputFile); ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); Country c2 = new Country(); @@ -35,8 +50,8 @@ public class ExternalizableUnitTest { objectInputStream.close(); fileInputStream.close(); - assertTrue(c2.getCode() == c.getCode()); - assertTrue(c2.getName().equals(c.getName())); + assertEquals(c2.getCode(), c.getCode()); + assertEquals(c2.getName(), c.getName()); } @Test @@ -49,7 +64,7 @@ public class ExternalizableUnitTest { r.setClimate("Mediterranean"); r.setPopulation(120.000); - FileOutputStream fileOutputStream = new FileOutputStream(OUTPUT_FILE); + FileOutputStream fileOutputStream = new FileOutputStream(outputFile); ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); r.writeExternal(objectOutputStream); @@ -57,7 +72,7 @@ public class ExternalizableUnitTest { objectOutputStream.close(); fileOutputStream.close(); - FileInputStream fileInputStream = new FileInputStream(OUTPUT_FILE); + FileInputStream fileInputStream = new FileInputStream(outputFile); ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); Region r2 = new Region(); @@ -66,6 +81,6 @@ public class ExternalizableUnitTest { objectInputStream.close(); fileInputStream.close(); - assertTrue(r2.getPopulation() == null); + assertNull(r2.getPopulation()); } } diff --git a/core-java-modules/core-java-serialization/src/test/java/com/baeldung/serialization/PersonUnitTest.java b/core-java-modules/core-java-serialization/src/test/java/com/baeldung/serialization/PersonUnitTest.java index dbcdf0ec9d..47dc0b9293 100644 --- a/core-java-modules/core-java-serialization/src/test/java/com/baeldung/serialization/PersonUnitTest.java +++ b/core-java-modules/core-java-serialization/src/test/java/com/baeldung/serialization/PersonUnitTest.java @@ -1,36 +1,54 @@ package com.baeldung.serialization; +import org.junit.Before; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class PersonUnitTest { + @Rule + public TemporaryFolder tempFolder = new TemporaryFolder(); + + private File outputFile; + + private File outputFile2; + + @Before + public void setUp() throws Exception { + outputFile = tempFolder.newFile("yourfile.txt"); + outputFile2 = tempFolder.newFile("yourfile2.txt"); + } + @Test public void whenSerializingAndDeserializing_ThenObjectIsTheSame() throws IOException, ClassNotFoundException { Person p = new Person(); p.setAge(20); p.setName("Joe"); - FileOutputStream fileOutputStream = new FileOutputStream("yofile.txt"); + FileOutputStream fileOutputStream = new FileOutputStream(outputFile); ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); objectOutputStream.writeObject(p); objectOutputStream.flush(); objectOutputStream.close(); - FileInputStream fileInputStream = new FileInputStream("yofile.txt"); + FileInputStream fileInputStream = new FileInputStream(outputFile); ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); Person p2 = (Person) objectInputStream.readObject(); objectInputStream.close(); - assertTrue(p2.getAge() == p.getAge()); - assertTrue(p2.getName().equals(p.getName())); + assertEquals(p2.getAge(), p.getAge()); + assertEquals(p2.getName(), p.getName()); } @Test @@ -46,19 +64,19 @@ public class PersonUnitTest { e.setPerson(p); e.setAddress(a); - FileOutputStream fileOutputStream = new FileOutputStream("yofile2.txt"); + FileOutputStream fileOutputStream = new FileOutputStream(outputFile2); ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); objectOutputStream.writeObject(e); objectOutputStream.flush(); objectOutputStream.close(); - FileInputStream fileInputStream = new FileInputStream("yofile2.txt"); + FileInputStream fileInputStream = new FileInputStream(outputFile2); ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); Employee e2 = (Employee) objectInputStream.readObject(); objectInputStream.close(); - assertTrue(e2.getPerson().getAge() == e.getPerson().getAge()); - assertTrue(e2.getAddress().getHouseNumber() == (e.getAddress().getHouseNumber())); + assertEquals(e2.getPerson().getAge(), e.getPerson().getAge()); + assertEquals(e2.getAddress().getHouseNumber(), (e.getAddress().getHouseNumber())); } } diff --git a/core-java-modules/core-java-serialization/src/test/java/com/baeldung/serialization/SerializationUnitTest.java b/core-java-modules/core-java-serialization/src/test/java/com/baeldung/serialization/SerializationUnitTest.java index dde9beb2bb..a7cbc0599b 100644 --- a/core-java-modules/core-java-serialization/src/test/java/com/baeldung/serialization/SerializationUnitTest.java +++ b/core-java-modules/core-java-serialization/src/test/java/com/baeldung/serialization/SerializationUnitTest.java @@ -4,6 +4,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; @@ -13,17 +14,32 @@ import java.io.ObjectOutputStream; import java.io.Serializable; import org.apache.commons.lang3.SerializationUtils; +import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import com.baeldung.util.MySerializationUtils; +import org.junit.rules.TemporaryFolder; public class SerializationUnitTest { + private final static String OUTPUT_FILE_NAME = "yourfile.txt"; + + @Rule + public TemporaryFolder tempFolder = new TemporaryFolder(); + + private File outputFile; + + @Before + public void setUp() throws Exception { + outputFile = tempFolder.newFile(OUTPUT_FILE_NAME); + } + @Test(expected = NotSerializableException.class) public void whenSerializing_ThenThrowsError() throws IOException { Address address = new Address(); address.setHouseNumber(10); - FileOutputStream fileOutputStream = new FileOutputStream("yofile.txt"); + FileOutputStream fileOutputStream = new FileOutputStream(outputFile); try (ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream)) { objectOutputStream.writeObject(address); } @@ -35,12 +51,12 @@ public class SerializationUnitTest { p.setAge(20); p.setName("Joe"); - FileOutputStream fileOutputStream = new FileOutputStream("yofile.txt"); + FileOutputStream fileOutputStream = new FileOutputStream(outputFile); try (ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream)) { objectOutputStream.writeObject(p); } - FileInputStream fileInputStream = new FileInputStream("yofile.txt"); + FileInputStream fileInputStream = new FileInputStream(outputFile); try (ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream)) { Person p2 = (Person) objectInputStream.readObject(); assertEquals(p2.getAge(), p.getAge()); diff --git a/jaxb/src/main/java/com/baeldung/jaxb/gen/ObjectFactory.java b/jaxb/src/main/java/com/baeldung/jaxb/gen/ObjectFactory.java index 26cd5814ac..0a3da677ce 100644 --- a/jaxb/src/main/java/com/baeldung/jaxb/gen/ObjectFactory.java +++ b/jaxb/src/main/java/com/baeldung/jaxb/gen/ObjectFactory.java @@ -1,48 +1,48 @@ - -package com.baeldung.jaxb.gen; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the com.baeldung.jaxb.gen 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: com.baeldung.jaxb.gen - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link UserRequest } - * - */ - public UserRequest createUserRequest() { - return new UserRequest(); - } - - /** - * Create an instance of {@link UserResponse } - * - */ - public UserResponse createUserResponse() { - return new UserResponse(); - } - -} + +package com.baeldung.jaxb.gen; + +import javax.xml.bind.annotation.XmlRegistry; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.baeldung.jaxb.gen 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: com.baeldung.jaxb.gen + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link UserRequest } + * + */ + public UserRequest createUserRequest() { + return new UserRequest(); + } + + /** + * Create an instance of {@link UserResponse } + * + */ + public UserResponse createUserResponse() { + return new UserResponse(); + } + +} diff --git a/jaxb/src/main/java/com/baeldung/jaxb/gen/UserRequest.java b/jaxb/src/main/java/com/baeldung/jaxb/gen/UserRequest.java index 4cfbeb8d46..1c1abc61a6 100644 --- a/jaxb/src/main/java/com/baeldung/jaxb/gen/UserRequest.java +++ b/jaxb/src/main/java/com/baeldung/jaxb/gen/UserRequest.java @@ -1,87 +1,87 @@ - -package com.baeldung.jaxb.gen; - -import java.io.Serializable; -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 javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for UserRequest complex type. - * - *

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

- * <complexType name="UserRequest">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}int"/>
- *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "UserRequest", propOrder = { - "id", - "name" -}) -@XmlRootElement(name = "userRequest") -public class UserRequest - implements Serializable -{ - - private final static long serialVersionUID = -1L; - protected int id; - @XmlElement(required = true) - protected String name; - - /** - * Gets the value of the id property. - * - */ - public int getId() { - return id; - } - - /** - * Sets the value of the id property. - * - */ - public void setId(int value) { - this.id = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - -} + +package com.baeldung.jaxb.gen; + +import java.io.Serializable; +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 javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for UserRequest complex type. + * + *

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

+ * <complexType name="UserRequest">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "UserRequest", propOrder = { + "id", + "name" +}) +@XmlRootElement(name = "userRequest") +public class UserRequest + implements Serializable +{ + + private final static long serialVersionUID = -1L; + protected int id; + @XmlElement(required = true) + protected String name; + + /** + * Gets the value of the id property. + * + */ + public int getId() { + return id; + } + + /** + * Sets the value of the id property. + * + */ + public void setId(int value) { + this.id = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + +} diff --git a/jaxb/src/main/java/com/baeldung/jaxb/gen/UserResponse.java b/jaxb/src/main/java/com/baeldung/jaxb/gen/UserResponse.java index d86778403a..b80405e4a9 100644 --- a/jaxb/src/main/java/com/baeldung/jaxb/gen/UserResponse.java +++ b/jaxb/src/main/java/com/baeldung/jaxb/gen/UserResponse.java @@ -1,149 +1,149 @@ - -package com.baeldung.jaxb.gen; - -import java.io.Serializable; -import java.util.Calendar; -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 javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import org.w3._2001.xmlschema.Adapter1; - - -/** - *

Java class for UserResponse complex type. - * - *

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

- * <complexType name="UserResponse">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}int"/>
- *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="gender" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="created" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "UserResponse", propOrder = { - "id", - "name", - "gender", - "created" -}) -@XmlRootElement(name = "userResponse") -public class UserResponse - implements Serializable -{ - - private final static long serialVersionUID = -1L; - protected int id; - @XmlElement(required = true) - protected String name; - @XmlElement(required = true) - protected String gender; - @XmlElement(required = true, type = String.class) - @XmlJavaTypeAdapter(Adapter1 .class) - @XmlSchemaType(name = "dateTime") - protected Calendar created; - - /** - * Gets the value of the id property. - * - */ - public int getId() { - return id; - } - - /** - * Sets the value of the id property. - * - */ - public void setId(int value) { - this.id = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the gender property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getGender() { - return gender; - } - - /** - * Sets the value of the gender property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setGender(String value) { - this.gender = value; - } - - /** - * Gets the value of the created property. - * - * @return - * possible object is - * {@link String } - * - */ - public Calendar getCreated() { - return created; - } - - /** - * Sets the value of the created property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCreated(Calendar value) { - this.created = value; - } - -} + +package com.baeldung.jaxb.gen; + +import java.io.Serializable; +import java.util.Calendar; +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 javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import org.w3._2001.xmlschema.Adapter1; + + +/** + *

Java class for UserResponse complex type. + * + *

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

+ * <complexType name="UserResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="gender" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="created" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "UserResponse", propOrder = { + "id", + "name", + "gender", + "created" +}) +@XmlRootElement(name = "userResponse") +public class UserResponse + implements Serializable +{ + + private final static long serialVersionUID = -1L; + protected int id; + @XmlElement(required = true) + protected String name; + @XmlElement(required = true) + protected String gender; + @XmlElement(required = true, type = String.class) + @XmlJavaTypeAdapter(Adapter1 .class) + @XmlSchemaType(name = "dateTime") + protected Calendar created; + + /** + * Gets the value of the id property. + * + */ + public int getId() { + return id; + } + + /** + * Sets the value of the id property. + * + */ + public void setId(int value) { + this.id = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the gender property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getGender() { + return gender; + } + + /** + * Sets the value of the gender property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGender(String value) { + this.gender = value; + } + + /** + * Gets the value of the created property. + * + * @return + * possible object is + * {@link String } + * + */ + public Calendar getCreated() { + return created; + } + + /** + * Sets the value of the created property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCreated(Calendar value) { + this.created = value; + } + +} diff --git a/jaxb/src/main/java/com/baeldung/jaxb/gen/package-info.java b/jaxb/src/main/java/com/baeldung/jaxb/gen/package-info.java index 6384eab27f..639d00179c 100644 --- a/jaxb/src/main/java/com/baeldung/jaxb/gen/package-info.java +++ b/jaxb/src/main/java/com/baeldung/jaxb/gen/package-info.java @@ -1,2 +1,2 @@ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.baeldung.com/jaxb/gen", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package com.baeldung.jaxb.gen; +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.baeldung.com/jaxb/gen", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package com.baeldung.jaxb.gen; diff --git a/jaxb/src/main/java/org/w3/_2001/xmlschema/Adapter1.java b/jaxb/src/main/java/org/w3/_2001/xmlschema/Adapter1.java index b4865b5510..54b3c360dc 100644 --- a/jaxb/src/main/java/org/w3/_2001/xmlschema/Adapter1.java +++ b/jaxb/src/main/java/org/w3/_2001/xmlschema/Adapter1.java @@ -1,23 +1,23 @@ - -package org.w3._2001.xmlschema; - -import java.util.Calendar; -import javax.xml.bind.annotation.adapters.XmlAdapter; - -public class Adapter1 - extends XmlAdapter -{ - - - public Calendar unmarshal(String value) { - return (javax.xml.bind.DatatypeConverter.parseDateTime(value)); - } - - public String marshal(Calendar value) { - if (value == null) { - return null; - } - return (javax.xml.bind.DatatypeConverter.printDateTime(value)); - } - -} + +package org.w3._2001.xmlschema; + +import java.util.Calendar; +import javax.xml.bind.annotation.adapters.XmlAdapter; + +public class Adapter1 + extends XmlAdapter +{ + + + public Calendar unmarshal(String value) { + return (javax.xml.bind.DatatypeConverter.parseDateTime(value)); + } + + public String marshal(Calendar value) { + if (value == null) { + return null; + } + return (javax.xml.bind.DatatypeConverter.printDateTime(value)); + } + +}