1 /* 2 * Copyright 2003, 2004 The Apache Software Foundation 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 16 */ 17 package org.apache.ws.jaxme; 18 19 import javax.xml.bind.JAXBException; 20 import javax.xml.namespace.QName; 21 22 import org.apache.ws.jaxme.impl.JAXBContextImpl; 23 import org.apache.ws.jaxme.impl.JMSAXDriver; 24 import org.apache.ws.jaxme.impl.JMSAXElementParser; 25 import org.xml.sax.SAXException; 26 27 28 /** <p>A JMManager controls the object factory (aka JAXBContext) 29 * for a given document type. The document type is both identified 30 * by its QName and its interface, which is extending JMElement.</p> 31 */ 32 public interface JMManager { 33 /** <p>Returns a property value, which is used to configure 34 * the manager. The property value is set in the configuration 35 * file.</p> 36 * 37 * @param pName The property name 38 * @return pValue The property value; null, if the property is not 39 * set. 40 */ 41 public String getProperty(String pName); 42 43 /** <p>Returns the {@link org.apache.ws.jaxme.impl.JAXBContextImpl}, 44 * that created this manager.</p> 45 */ 46 public JAXBContextImpl getFactory(); 47 48 /** <p>Returns the QName of the document type that this 49 * Manager controls.</p> 50 */ 51 public QName getQName(); 52 53 /** Returns the interface matching the document type. 54 * Usually, this is a a subinterface of 55 * {@link JMElement}. 56 * However, for support of POJO's, we should not depend 57 * on this. 58 */ 59 public Class getElementInterface(); 60 61 /** Returns an instance of the element class. Same as 62 * {@link #getElementS()}, except that it throws a 63 * different exception. 64 */ 65 public Object getElementJ() throws JAXBException; 66 67 /** Returns an instance of the element class. Same as 68 * {@link #getElementJ()}, except that it throws a 69 * different exception. 70 */ 71 public Object getElementS() throws SAXException; 72 73 /** Returns the document types handler class. 74 */ 75 public Class getHandlerClass(); 76 77 /** Returns an instance of the document types handler class. 78 */ 79 public JMSAXElementParser getHandler() throws SAXException; 80 81 /** Returns the document types driverr class. 82 */ 83 public Class getDriverClass(); 84 85 /** Returns an instance of the document types driver class. 86 */ 87 public JMSAXDriver getDriver() throws SAXException; 88 89 /** <p>Returns the persistency class. The persistency class 90 * must be able to store documents in a database, update, 91 * delete or retrieve them.</p> 92 */ 93 public Class getPmClass(); 94 } 95