01: /*
02: * XML 2 Java Binding (X2JB) - the excellent Java tool.
03: * Copyright 2007, by Richard Opalka.
04: *
05: * This is free software; you can redistribute it and/or modify it
06: * under the terms of the GNU Lesser General Public License as
07: * published by the Free Software Foundation; either version 2.1 of
08: * the License, or (at your option) any later version.
09: *
10: * This software is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this software; if not see the FSF site:
17: * http://www.fsf.org/ and search for the LGPL License document there.
18: */
19: package org.x2jb.bind.provider;
20:
21: import java.lang.reflect.Method;
22: import org.x2jb.bind.BindingException;
23:
24: /**
25: * Users that wish to write their own <b>XML 2 Java Binding Provider</b>
26: * have to implement this interface. The provider implementation
27: * does not need to implement caching or synchronization mechanisms
28: * because they are already implemented in <b>X2JB runtime</b>.
29: * It is guaranted to the provider implementator that
30: * only one thread in the time will access its <b>getBinding</b> method.
31: *
32: * <p>Each binding factory provider implementation:</p>
33: * <ul>
34: * <li>have to provide default accessible constructor</li>
35: * <li>should be stateless</li>
36: * </ul>
37: *
38: * @author <a href="mailto:richard_opalka@yahoo.com">Richard Opalka</a>
39: * @version 1.0
40: * @see org.x2jb.bind.provider.BindingDefinition
41: */
42: public interface BindingFactory {
43:
44: /**
45: * Returns {@link BindingDefinition} associated with the method <code>method</code>
46: * or <code>null</code> if there is no associated mapping definition
47: * @param method method which {@link BindingDefinition} will be returned
48: * @throws BindingException if a binding error occurs
49: * @return {@link BindingDefinition} associated with the method <code>method</code>
50: */
51: public BindingDefinition getBinding(Method method)
52: throws BindingException;
53:
54: }
|