Package org.exolab.castor.xml.util
Class DefaultNaming
- java.lang.Object
-
- org.exolab.castor.xml.AbstractXMLNaming
-
- org.exolab.castor.xml.util.DefaultNaming
-
- All Implemented Interfaces:
XMLNaming
public final class DefaultNaming extends AbstractXMLNaming implements XMLNaming
The default implementation of org.exolab.castor.xml.Naming- Version:
- $Revision: 7390 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $
- Author:
- Keith Visco
-
-
Field Summary
Fields Modifier and Type Field Description 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.
-
Constructor Summary
Constructors Constructor Description DefaultNaming()
Creates a new DefaultNaming
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
createXMLName(java.lang.Class c)
Deprecated.extracting name parts from a Class is responsibility of JavaNamingvoid
setStyle(short style)
Sets the style for this DefaultNaming.java.lang.String
toXMLName(java.lang.String name)
Converts the given name to an XML name.-
Methods inherited from class org.exolab.castor.xml.AbstractXMLNaming
getInstance
-
-
-
-
Field Detail
-
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".- See Also:
- Constant Field Values
-
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".- See Also:
- Constant Field Values
-
-
Method Detail
-
setStyle
public void setStyle(short style)
Sets the style for this DefaultNaming. Valid options are as followsDefaultNaming.LOWER_CASE_STYLE DefaultNaming.MIXED_CASE_STYLE
- Parameters:
style
- the style to use
-
createXMLName
public java.lang.String createXMLName(java.lang.Class c)
Deprecated.extracting name parts from a Class is responsibility of JavaNamingCreates 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.- Specified by:
createXMLName
in interfaceXMLNaming
- Specified by:
createXMLName
in classAbstractXMLNaming
- Parameters:
c
- the Class to create the XML Name for- Returns:
- the xml name representation of the given String
examples:
"Blob" becomes "blob" and "DataSource" becomes "data-source". - See Also:
AbstractXMLNaming
-
toXMLName
public java.lang.String toXMLName(java.lang.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.- Specified by:
toXMLName
in interfaceXMLNaming
- Specified by:
toXMLName
in classAbstractXMLNaming
- Parameters:
name
- the String to convert to an XML name- Returns:
- the xml name representation of the given String
examples:
"Blob" becomes "blob" and "DataSource" becomes "data-source". - See Also:
AbstractXMLNaming
-
-