net.craftforge.essential.supply.jaxb
Class JaxbConsumer
java.lang.Object
net.craftforge.essential.supply.Consumer
net.craftforge.essential.supply.jaxb.JaxbConsumer
public class JaxbConsumer
- extends Consumer
Serializes objects.
- Since:
- 26.02.2011
- Author:
- Christian Bick
| Fields inherited from class net.craftforge.essential.supply.Consumer |
config |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JaxbConsumer
public JaxbConsumer(Configuration config)
xml
public Object xml(Class<?> type,
InputStream input,
String charset)
throws JAXBException,
IOException
- Deserializes the input stream in XML format to an object of the specified type.
- Parameters:
type - The typeinput - The input streamcharset - The charset encoding
- Returns:
- The object
- Throws:
JAXBException - Failed to convert the input to an object
UnsupportedEncodingException - Failed to process the charset
IOException
json
public Object json(Class<?> type,
InputStream input,
String charset)
throws IOException
- Deserializes the input stream in JSON format to an object of the specified type.
- Parameters:
type - The typeinput - The input streamcharset - The charset encoding
- Returns:
- The object
- Throws:
IOException - Failed to convert the input to an object
Copyright © 2011. All Rights Reserved.