-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yazan
committed
Nov 13, 2017
1 parent
19e9188
commit c300b7b
Showing
33 changed files
with
426 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
package edu.iris.dmc; | ||
|
||
import java.io.InputStream; | ||
import java.io.StringReader; | ||
|
||
import javax.xml.bind.JAXBContext; | ||
import javax.xml.bind.JAXBException; | ||
import javax.xml.bind.Unmarshaller; | ||
import javax.xml.transform.stream.StreamSource; | ||
|
||
import edu.iris.dmc.fdsn.station.model.FDSNStationXML; | ||
|
||
public class DocumentMarshaller { | ||
|
||
public static FDSNStationXML unmarshal(InputStream is) throws JAXBException { | ||
public static FDSNStationXML unmarshal(InputStream inputStream) throws JAXBException { | ||
JAXBContext jaxbContext = JAXBContext.newInstance(edu.iris.dmc.fdsn.station.model.ObjectFactory.class); | ||
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); | ||
return (FDSNStationXML) jaxbUnmarshaller.unmarshal(new StreamSource(is)); | ||
return (FDSNStationXML) jaxbUnmarshaller.unmarshal(inputStream); | ||
} | ||
|
||
public static FDSNStationXML unmarshalString(String inputStream) throws JAXBException { | ||
JAXBContext jaxbContext = JAXBContext.newInstance(edu.iris.dmc.fdsn.station.model.ObjectFactory.class); | ||
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); | ||
return (FDSNStationXML) jaxbUnmarshaller.unmarshal(new StringReader(inputStream)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.