KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > util > xml > idefix > DefaultNamespaceFactory


1 package org.sapia.util.xml.idefix;
2
3 import org.sapia.util.xml.Namespace;
4
5 import java.lang.reflect.Method JavaDoc;
6
7
8 /**
9  * This implementation of the <code>NamespaceFactoryIF</code> interface always
10  * returns the default namespace instance define in the implemented interface.<p>
11  *
12  * This class is usefull when generating XML strings that does not use namespace
13  * or when an hierarchy of namespace factories are used, this default implementation
14  * can be use as a fallback.
15  *
16  * @author <a HREF="mailto:jc@sapia-oss.org">Jean-Cedric Desrochers</a>
17  * <dl>
18  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
19  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
20  * <a HREF="http://www.sapia-oss.org/license.html" target="sapia-license">license page</a> at the Sapia OSS web site</dd></dt>
21  * </dl>
22  */

23 public class DefaultNamespaceFactory implements NamespaceFactoryIF {
24   /**
25    * Creates a new DefaultNamespaceFactory instance.
26    */

27   public DefaultNamespaceFactory() {
28   }
29
30   /**
31    * Returns the default namespace using the attribute
32    * <code>NamespaceFactoryIF.DEFAULT_NAMESPACE</code>.
33    *
34    * @param aClass The class for which to retrieve a namespace.
35    * @return The default namespace.
36    * @see NamespaceFactoryIF#DEFAULT_NAMESPACE
37    */

38   public Namespace getNamespaceFor(Class JavaDoc aClass) {
39     return DEFAULT_NAMESPACE;
40   }
41
42   /**
43    * Returns the default namespace using the attribute
44    * <code>NamespaceFactoryIF.DEFAULT_NAMESPACE</code>.
45    *
46    * @param aMethod The method for which to retrieve a namespace.
47    * @return The default namespace.
48    * @see NamespaceFactoryIF#DEFAULT_NAMESPACE
49    */

50   public Namespace getNamespaceFor(Method JavaDoc aMethod) {
51     return DEFAULT_NAMESPACE;
52   }
53 }
54
Popular Tags