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;
8 import org.collectionspace.services.collectionobject.domain.nagpra.CollectionObjectsNAGPRA;
9 import org.collectionspace.services.collectionobject.domain.naturalhistory_extension.CollectionobjectsNaturalhistory;
12 * Singleton for the {@link JAXBContext} which the AdvancedSearch will use
13 * Eventually this should just be a bean which can be injected
16 public final class AdvancedSearchJAXBContext {
17 private static final AdvancedSearchJAXBContext INSTANCE = new AdvancedSearchJAXBContext();
19 private final JAXBContext jaxbContext;
21 private AdvancedSearchJAXBContext() {
23 jaxbContext = JAXBContext.newInstance(CollectionSpaceCore.class, CollectionobjectsCommon.class,
24 CollectionobjectsNaturalhistory.class, CollectionObjectsNAGPRA.class);
25 } catch (JAXBException e) {
26 throw new RuntimeException("Unable to create JAXBContext for AdvancedSearch");
30 public static JAXBContext getJaxbContext() {
31 return INSTANCE.jaxbContext;