org.exolab.castor.xml.util
Class DefaultNaming
- XMLNaming
public final class DefaultNaming
The default implementation of org.exolab.castor.xml.Naming
$Revision: 7390 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $static short | LOWER_CASE_STYLE - The lower case style with hyphens to separate words.
|
static short | MIXED_CASE_STYLE - The mixed case style with uppercase characters to separate words.
|
String | createXMLName(Class c) - extracting name parts from a Class is responsibility of JavaNaming
|
void | setStyle(short style) - Sets the style for this DefaultNaming.
|
String | toXMLName(String name) - Converts the given name to an XML name.
|
LOWER_CASE_STYLE
public static final short LOWER_CASE_STYLE
The lower case style with hyphens to separate words. Default
examples:
"Blob" becomes "blob" and "DataSource" becomes "data-source".
MIXED_CASE_STYLE
public static final short MIXED_CASE_STYLE
The mixed case style with uppercase characters to separate words.
examples:
"Blob" becomes "blob" and "DataSource" becomes "dataSource".
DefaultNaming
public DefaultNaming()
Creates a new DefaultNaming
createXMLName
public String createXMLName(Class c)
extracting name parts from a Class is responsibility of JavaNaming
Creates the XML Name for the given class. It would be nearly impossible
for this method to please every one, so I picked common "de-facto" XML
naming conventions. This can be overridden by either extending
org.exolab.castor.xml.Naming and implementing the proper methods, or by
ClassDescriptors for your classes.
- createXMLName in interface XMLNaming
- createXMLName in interface AbstractXMLNaming
c
- the Class to create the XML Name for
- the xml name representation of the given String
examples:
"Blob" becomes "blob" and "DataSource" becomes "data-source".
setStyle
public void setStyle(short style)
Sets the style for this DefaultNaming.
Valid options are as follows
DefaultNaming.LOWER_CASE_STYLE
DefaultNaming.MIXED_CASE_STYLE
toXMLName
public String toXMLName(String name)
Converts the given name to an XML name. It would be nearly impossible for
this method to please every one, so I picked common "de-facto" XML naming
conventions. This can be overridden by either extending
org.exolab.castor.xml.Naming and implementing the proper methods, or by
ClassDescriptors for your classes.
- toXMLName in interface XMLNaming
- toXMLName in interface AbstractXMLNaming
name
- the String to convert to an XML name
- the xml name representation of the given String
examples:
"Blob" becomes "blob" and "DataSource" becomes "data-source".
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com