View Javadoc
1   /*
2    * Copyright 2007 Joachim Grueneis
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  package org.castor.xml;
17  
18  /**
19   * XMLNaming contains all methods required by Castor to build valid XML names.
20   * It was originally an abstract class by <a href="mailto:kvisco@intalio.com">Keith Visco</a>
21   * for which I create this interface.
22   * 
23   * @author Joachim Grueneis, jgrueneis_at_codehaus_dot_org
24   * @version $Id$
25   */
26  public interface XMLNaming {
27  
28  	/**
29  	 * Creates the XML Name for the given class The actual
30  	 * behavior of this method is determined by the
31  	 * implementation. The only restriction is that the name
32  	 * returned must be a valid xml name.
33  	 * 
34  	 * @param c the Class to create the XML Name for
35  	 * @return the XML name based on the given class
36  	 * @deprecated because this method removes the package part which is JavaNaming responsibility
37  	 **/
38  	public abstract String createXMLName(Class c);
39  
40  	/**
41  	 * Converts the given String to an XML name. The actual
42  	 * behavior of this method is determined by the
43  	 * implementation. The only restriction is that the name
44  	 * returned must be a valid xml name.
45  	 *
46  	 * @return an XML name based on the given String
47  	 **/
48  	public abstract String toXMLName(String name);
49  
50  }