Public Member Functions | |
DefaultNaming () | |
void | setStyle (short style) |
String | createXMLName (Class c) |
String | toXMLName (String name) |
Static Public Attributes | |
static final short | LOWER_CASE_STYLE = 0 |
static final short | MIXED_CASE_STYLE = 1 |
The default implementation of org.exolab.castor.xml.Naming
org.exolab.castor.xml.util.DefaultNaming.DefaultNaming | ( | ) |
Creates a new DefaultNaming
String org.exolab.castor.xml.util.DefaultNaming.createXMLName | ( | Class | c | ) | [virtual] |
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.
name | the String to convert to an XML name |
c | the Class to create the XML Name for |
Implements org.exolab.castor.xml.XMLNaming.
References org.exolab.castor.xml.util.DefaultNaming.toXMLName().
void org.exolab.castor.xml.util.DefaultNaming.setStyle | ( | short | style | ) |
Sets the style for this DefaultNaming. Valid options are as follows
DefaultNaming.LOWER_CASE_STYLE DefaultNaming.MIXED_CASE_STYLE
style | the style to use |
References org.exolab.castor.xml.util.DefaultNaming.LOWER_CASE_STYLE, and org.exolab.castor.xml.util.DefaultNaming.MIXED_CASE_STYLE.
Referenced by org.exolab.castor.util.Configuration.getDefaultXMLNaming(), and org.exolab.castor.util.LocalConfiguration.getXMLNaming().
String org.exolab.castor.xml.util.DefaultNaming.toXMLName | ( | String | name | ) | [virtual] |
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.
name | the String to convert to an XML name |
Implements org.exolab.castor.xml.XMLNaming.
References org.exolab.castor.xml.util.DefaultNaming.LOWER_CASE_STYLE.
Referenced by org.exolab.castor.xml.util.DefaultNaming.createXMLName().
final short org.exolab.castor.xml.util.DefaultNaming.LOWER_CASE_STYLE = 0 [static] |
The lower case style with hyphens to separate words. Default
examples:
"Blob" becomes "blob" and "DataSource" becomes "data-source".
Referenced by org.exolab.castor.xml.util.DefaultNaming.setStyle(), and org.exolab.castor.xml.util.DefaultNaming.toXMLName().
final short org.exolab.castor.xml.util.DefaultNaming.MIXED_CASE_STYLE = 1 [static] |
The mixed case style with uppercase characters to separate words.
examples:
"Blob" becomes "blob" and "DataSource" becomes "dataSource".
Referenced by org.exolab.castor.xml.util.DefaultNaming.setStyle().