1 package org.collectionspace.services.advancedsearch;
3 import javax.xml.bind.JAXBContext;
4 import javax.xml.bind.JAXBException;
6 import org.collectionspace.collectionspace_core.CollectionSpaceCore;
7 import org.collectionspace.services.collectionobject.CollectionobjectsCommon;
10 * Singleton for the {@link JAXBContext} which the AdvancedSearch will use
11 * Eventually this should just be a bean which can be injected
14 public final class AdvancedSearchJAXBContext {
15 private static final AdvancedSearchJAXBContext INSTANCE = new AdvancedSearchJAXBContext();
17 private final JAXBContext jaxbContext;
19 private AdvancedSearchJAXBContext() {
21 jaxbContext = JAXBContext.newInstance(CollectionSpaceCore.class, CollectionobjectsCommon.class);
22 } catch (JAXBException e) {
23 throw new RuntimeException("Unable to create JAXBContext for AdvancedSearch");
27 public static JAXBContext getJaxbContext() {
28 return INSTANCE.jaxbContext;