com.bitplan.mediawiki.japi.jaxb.JaxbFactoryApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mediawiki-japi Show documentation
Show all versions of mediawiki-japi Show documentation
Java library to call Mediawiki API described at http://www.mediawiki.org/wiki/API:Main_page
/**
* Copyright (C) 2015 BITPlan GmbH
*
* Pater-Delp-Str. 1
* D-47877 Willich-Schiefbahn
*
* http://www.bitplan.com
*
* This source is part of
* https://github.com/WolfgangFahl/Mediawiki-Japi
* and the license for Mediawiki-Japi applies
*
*/
package com.bitplan.mediawiki.japi.jaxb;
import javax.xml.bind.JAXBException;
/**
* generic conversion of instance to and from xml/json
* @author wf
*
* @param
*/
public interface JaxbFactoryApi {
/**
* create an xml representation for the given instance
* @param instance - the instance to convert to xml
* @return a xml representation of the given instance
* @throws JAXBException
*/
public String asXML(T instance) throws JAXBException;
/**
* get a instance for the given xml
* @param xml - the xml representation of a instance
* @return a new instance
* @throws JAXBException - if there is an issue with the xml
* @throws Exception
*/
public T fromXML(final String xml) throws JAXBException, Exception;
/**
* create a Json representation for the given instance
* @param instance - the instance to convert to json
* @return a Json representation of the given
* @throws JAXBException
*/
public String asJson(T instance) throws JAXBException;
/**
* get a instance for the given json
* @param json - the json representation of a instance
* @return a new instance
* @throws Exception - if there is an issue with the json
*/
public T fromJson(final String json) throws Exception;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy